JODA
0.13.1 (59b41972)
JSON On-Demand Analysis
|
#include <FileOrigin.h>
Public Types | |
typedef std::pair< FILEID, std::pair< long, long > > | ParseInterval |
Public Member Functions | |
FileOrigin (FILEID id) | |
FileOrigin (FILEID file, long start, long end, int index) | |
bool | isReparsable () const override |
std::unique_ptr< IOrigin > | clone () const override |
std::unique_ptr< RJDocument > | reparse (RJMemoryPoolAlloc &alloc) const override |
std::string | toString () const override |
std::string | getStreamName () const override |
FILEID | getFile () const |
ParseInterval | getInterval () const |
Public Member Functions inherited from IDPositionOrigin | |
IDPositionOrigin (FILEID id) | |
IDPositionOrigin (FILEID id, long start, long end, int index) | |
std::unique_ptr< RJDocument > | reparse (RJMemoryPoolAlloc &alloc) const override |
bool | isReparsable () const override |
virtual | ~IDPositionOrigin () override=default |
long | getStart () const |
void | setStart (long start) |
long | getEnd () const |
void | setEnd (long end) |
int | getIndex () const |
void | setIndex (int index) |
virtual bool | operator< (const IOrigin &x) const override final |
bool | operator< (const IDPositionOrigin &other) const |
bool | operator== (const IDPositionOrigin &other) const |
Public Member Functions inherited from IOrigin | |
virtual | ~IOrigin ()=default |
bool | operator== (const IOrigin &x) const |
virtual bool | operator<= (const IOrigin &x) const |
virtual bool | operator> (const IOrigin &x) const |
virtual bool | operator>= (const IOrigin &x) const |
Static Public Member Functions | |
static std::vector< ParseInterval > | mergeIntervals (std::vector< ParseInterval > &&intervals) |
static std::vector< std::unique_ptr< RJDocument > > | parseIntervals (RJMemoryPoolAlloc &alloc, std::vector< ParseInterval > &&intervals) |
Additional Inherited Members | |
Protected Attributes inherited from IDPositionOrigin | |
FILEID | id |
long | start {} |
long | end {} |
int | index {} |
FileOrigin represents a document originating from a file on the disk. It stores the filepath and byte start/stop offsets for rapid reparsing
typedef std::pair<FILEID, std::pair<long, long> > FileOrigin::ParseInterval |
FileOrigin::FileOrigin | ( | FILEID | id | ) |
FileOrigin::FileOrigin | ( | FILEID | file, |
long | start, | ||
long | end, | ||
int | index | ||
) |
|
overridevirtual |
Clones the IOrigin for use in another document
Implements IDPositionOrigin.
FILEID FileOrigin::getFile | ( | ) | const |
Returns the FILEID of the origin file
FileOrigin::ParseInterval FileOrigin::getInterval | ( | ) | const |
Returns a ParseIntervalParseInterval for this specific document
|
overridevirtual |
Returns a human readable representation of the ID (without the offsets)
Implements IDPositionOrigin.
|
overridevirtual |
|
static |
Merges a list of ParseIntervals to the minimal possible list
intervals | the list of intervals to merge |
|
static |
Parses a list of ParseIntervals to a list of RJDocuments
alloc | The memory allocator to use |
intervals | the list of intervals to parse |
|
overridevirtual |
Reparses the origin into a new RJDocument. The allocator is used to increase performance
alloc | Allocator used for allocating memoty |
Reimplemented from IOrigin.
|
overridevirtual |