class sfileinst_range¶
A range of (contiguous) locations in a single source file instance.
sfileinst_range Members¶
| Constructor | __init__() |
| Methods | __repr__(), __str__(), get_end(), get_file(), get_start() |
sfileinst_range Details¶
-
class
cs.sfileinst_range¶ A range of (contiguous) locations in a single source file instance.
-
__init__(_file, _start, _end)¶ Constructor.
Parameters: Raises: OverflowError>>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> sfi = cu.get_sfileinst() >>> sfileinst_range(sfi, (3, 4), (7, 10)) <cs.sfileinst_range <cs.sfileinst C:\alex\test\apitest.cpp>:3.4-7.10>
-
__repr__()¶ Get a representation of a
sfileinst_rangeobject that includes information useful for debugging.Return type: str Returns: The string representation. >>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> sfi = cu.get_sfileinst() >>> sfir = sfileinst_range(sfi, (3, 4), (7, 10)) >>> repr(sfir) '<cs.sfileinst_range <cs.sfileinst C:\\alex\\test\\apitest.cpp>:3.4-7.10>'
-
__str__()¶ Get a simple string representation of a
sfileinst_rangeobject.Return type: str Returns: The string representation. >>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> sfi = cu.get_sfileinst() >>> sfir = sfileinst_range(sfi, (3, 4), (7, 10)) >>> str(sfir) '<cs.sfileinst C:\\alex\\test\\apitest.cpp>:3.4-7.10'
-
get_end()¶ Get the end line and column number from a
sfileinst_range.Return type: (int, int) Returns: The end line and column number. >>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> sfi = cu.get_sfileinst() >>> sfir = sfileinst_range(sfi, (3, 4), (7, 10)) >>> sfir.get_end() (7, 10)
-
get_file()¶ Get the source file instance from a
sfileinst_range.Return type: sfileinstReturns: The source file instance ( sfileinst).>>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> sfi = cu.get_sfileinst() >>> sfir = sfileinst_range(sfi, (3, 4), (7, 10)) >>> sfir.get_file() <cs.sfileinst C:\alex\test\apitest.cpp>
-
get_start()¶ Get the start line and column number from a
sfileinst_range.Return type: (int, int) Returns: The start line and column number. >>> cu = next(c for c in project.current().compunits() if c.name().endswith('apitest.cpp')) >>> sfi = cu.get_sfileinst() >>> sfir = sfileinst_range(sfi, (3, 4), (7, 10)) >>> sfir.get_start() (3,4)
-