|
| | FileSource (std::filesystem::path path) |
| | Creates a file source from a filesystem path. More...
|
| |
| void | set_working_path (const std::filesystem::path &path) |
| | Sets a working directory used to relativize the displayed path. More...
|
| |
| Location | from_coords (size_t row, size_t column) const override |
| | Maps (row, column) to a Location within the file. More...
|
| |
| Location | from_index (size_t index) const override |
| | Maps an absolute index to a Location within the file. More...
|
| |
| std::string | substr (const Location &start, const Location &end) const override |
| | Extracts a substring delimited by two locations. More...
|
| |
| std::string | line (const Location &location) const override |
| | Returns the contents of the line containing the given location. More...
|
| |
| std::string | line (size_t line_number) const override |
| | Returns the contents of the specified line number. More...
|
| |
| size_t | line_count () const override |
| | Returns the number of lines in the file. More...
|
| |
| std::string | contents () const override |
| | Returns the entire file contents. More...
|
| |
| std::string | path () const override |
| | Returns the file system path to the file (possibly working path relative) More...
|
| |
| size_t | size () const override |
| | Returns the total size of the file in characters. More...
|
| |
| virtual | ~Source ()=default |
| |
| virtual Location | from_coords (size_t row, size_t column) const =0 |
| | Returns a location corresponding to the given row and column. More...
|
| |
| virtual Location | from_index (size_t index) const =0 |
| | Returns a location for the given absolute character index. More...
|
| |
| virtual std::string | substr (const Location &start, const Location &end) const =0 |
| | Returns the substring between two locations. More...
|
| |
| virtual std::string | line (const Location &location) const =0 |
| | Returns the full line at the given location. More...
|
| |
| virtual std::string | line (size_t line_number) const =0 |
| | Returns the contents of the specified line number. More...
|
| |
| virtual size_t | line_count () const =0 |
| | Returns the total number of lines in the source. More...
|
| |
| virtual std::string | contents () const =0 |
| | Returns the entire contents of the source. More...
|
| |
| virtual std::string | path () const =0 |
| | Returns a displayable path or identifier of the source. More...
|
| |
| virtual size_t | size () const =0 |
| | Returns the total size (in characters) of the source. More...
|
| |
A Source implementation that reads from a file on disk.