![]() |
FMT 1.2.0
Forest management tools for forest planning
|
Main parent class of all the parsers in FMT. More...
#include <FMTParser.h>
Classes | |
| class | FMTLineInfo |
| Helper holding a line value, its number and its file, used during parsing. More... | |
Public Member Functions | |
| FMTParser () | |
| Default constructor for FMTParser. | |
| FMTParser (const FMTParser &rhs) | |
| Copy constructor for FMTParser. | |
| FMTParser & | operator= (const FMTParser &rhs) |
| Copy assignment operator for FMTParser. | |
| virtual | ~FMTParser ()=default |
| Default destructor for FMTParser. | |
| std::time_t | getMostRecentFiletime () const |
| Return the most recent file time of the files read by the parser. | |
| void | setHeader (const std::string &header) |
| Set a string as the header written when the file is opened in write mode, replacing the comment attribute. | |
| GDALDataset * | createOGRDataset (std::string location=std::string(), std::string gdaldrivername="CSV") const |
| Create an OGR vector dataset based on a driver name and a location. | |
| OGRLayer * | createLayer (GDALDataset *dataset, const std::string &name, std::vector< std::string > creationoptions=std::vector< std::string >()) const |
| Create a layer in a dataset, deleting any existing layer with the same name. | |
| std::vector< std::string > | getGDALVectorDriverNames (bool testcreation=true) const |
| Return a vector of GDAL vector driver names. | |
| std::vector< std::string > | getGDALRasterDriverNames (bool testcreation=true) const |
| Return a vector of GDAL raster driver names. | |
| std::vector< std::vector< std::string > > | getGDALVectorDriverExtensions (bool testcreation=true) const |
| Return a vector of GDAL vector driver extensions organized by driver. | |
| std::vector< std::vector< std::string > > | getGDALRasterDriverExtensions (bool testcreation=true) const |
| Return a vector of GDAL raster driver extensions organized by driver. | |
| bool | tryOpening (const std::ifstream &stream, const std::string &location) const |
| Open an input stream at a given location. | |
| bool | tryOpening (std::ofstream &stream, const std::string &location) const |
| Open an output stream at a given location. | |
| std::string | getCleanLine (std::istream &stream) const |
| Clean a line and make it ready to be read by a parser. | |
| std::string | getCleanLine (const std::string &p_input) const |
| Clean a line and make it ready to be read by a parser. | |
| std::string | createSubDirectory (const std::string &p_Directory, const std::string &p_SubDirectory) |
| Create a sub directory in directory. | |
Public Member Functions inherited from Core::FMTObject | |
| FMTObject () | |
| Default constructor for FMTObject. | |
| virtual | ~FMTObject () |
| Default virtual destructor for FMTObject. | |
| FMTObject (const std::unique_ptr< Exception::FMTExceptionHandler > exhandler) | |
| Construct a FMTObject passing in the exception handler of another FMTObject. | |
| FMTObject (const FMTObject &rhs) | |
| Copy constructor for FMTObject. | |
| FMTObject & | operator= (const FMTObject &rhs) |
| Copy assignment operator for FMTObject. | |
| virtual void | passInLogger (const std::unique_ptr< Logging::FMTLogger > &logger) |
| Pass in the logger of another FMTObject. | |
| void | passInExceptionHandler (const std::unique_ptr< Exception::FMTExceptionHandler > &exhandler) |
| Pass in the exception handler of another FMTObject. | |
| void | redirectLogToFile (const std::string &location) |
| Redirect the log to a specific file, appending to it. | |
| virtual void | setDefaultLogger () |
| Create and set a default logger to the FMTObject. | |
| virtual void | setQuietLogger () |
| Create and set a quiet logger to the FMTObject. | |
| virtual void | setTaskLogger () |
| Create and set a task logger to the FMTObject. | |
| virtual void | setDebugLogger () |
| Create and set a debug logger to the FMTObject. | |
| void | setDefaultExceptionHandler () |
| Create and set a default exception handler to the FMTObject. | |
| void | setQuietExceptionHandler () |
| Create and set a quiet exception handler to the FMTObject. | |
| void | setDebugExceptionHandler () |
| Create and set a debug exception handler to the FMTObject. | |
| void | setFreeExceptionHandler () |
| Create and set a free exception handler to the FMTObject. | |
| void | disableNestedExceptions () |
| Disable the nested exception throw of the exception handler. | |
| void | enableNestedExceptions () |
| Enable the nested exception throw of the exception handler. | |
| void | setErrorsToWarnings (const std::vector< Exception::FMTexc > &errors) |
| Set a list of errors to be cast to warnings on the exception handler. | |
| void | setMaxWarningsBeforeSilenced (const size_t &maxwarningcount) |
| Set the number of warnings raised before being silenced. | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Static Public Member Functions | |
| static Core::FMTsection | fromExtension (const std::string &p_Extension) |
| Return the FMTsection matching the extension of a file. | |
Static Public Member Functions inherited from Core::FMTObject | |
| static Logging::FMTLogger * | getLogger () |
| get a pointer to the actual logger. | |
| static Exception::FMTExceptionHandler * | getExceptionHandler () |
| get a pointer to the actual exception handler. | |
| static std::string | getRuntimeLocation () |
| Return the location of the FMT shared library. | |
| static unsigned long long | getAvailableMemory () |
| Return the available memory in bytes. | |
| static void | setTerminateStack () |
| will write the stack in the log when terminate called and raise a function failed. | |
| static void | setAbortStack () |
| will write the stack in the log when abort called with SIGABRT and raise a function failed. | |
Protected Member Functions | |
| void | _setSection (const Core::FMTsection §ion) const |
| Set the section member of the parser. | |
| std::vector< GDALDriver * > | _getAllGDALDrivers (const char *spatialtype, bool testcreation=true) const |
| Return the GDAL drivers for a given spatial type. | |
| std::vector< std::vector< std::string > > | getGDALExtensions (const char *spatialtype, bool testcreation=true) const |
| Return the GDAL extensions organized by driver for a given spatial type. | |
| void | _setCategories (GDALRasterBand *band, const std::vector< std::string > &categories) const |
| Write the categories in the band information. | |
| OGRCoordinateTransformation * | _getProjTransform (OGRLayer *baselayer, bool fittoforel=true) const |
| Return a coordinate transformation for a layer, optionally fitting to FOREL. | |
| GDALDataset * | _getTransFormMemLayerCopy (OGRLayer *baselayer, const OGRSpatialReference *newreference, const std::string &fieldname) const |
| Create a memory dataset copying a layer with a new field, optionally with a new spatial reference. | |
| std::unique_ptr< OGRSpatialReference > | _getFORELSpatialRef () const |
| Return the spatial reference used for FORELs in Quebec. | |
| template<typename T > | |
| GDALDataset * | _createDataset (const std::string &location, const Spatial::FMTLayer< T > &layer, const int datatypeid, std::string format="GTiff") const |
| Create an empty GDAL dataset for a layer. | |
| GDALDataset * | _getDataset (const std::string &location) const |
| Open a GDAL dataset in read only from a location, throwing on error. | |
| GDALDataset * | _getVectorDataset (const std::string &location) const |
| Open a GDAL vector dataset in read only from a location, throwing on error. | |
| OGRLayer * | _getLayer (GDALDataset *dataset, int id) const |
| Open a GDAL layer from a vector dataset by its id, throwing on error. | |
| GDALRasterBand * | _getBand (GDALDataset *dataset, int bandid=1) const |
| Open a GDAL raster band from a dataset. | |
| GDALRasterBand * | _createBand (GDALDataset *dataset, const std::vector< std::string > &categories, int bandid=1) const |
| Create a GDAL raster band in a dataset with categories. | |
| std::vector< std::string > | _getCat (GDALDataset *dataset, int bandid=1) const |
| Return the categories of a dataset for a given band. | |
| GDALRasterBand * | _getOverview (GDALRasterBand *band, int view=1) const |
| Return an overview of a raster band. | |
| void | _getWSFields (OGRLayer *layer, std::map< int, int > &themes, int &age, int &area, int &lock, std::string agefield="", std::string areafield="", std::string lockfield="") const |
| Fill up the field ids of the themes, age, area and lock of a layer. | |
| GDALDataset * | _createVectorMemoryDs () const |
| Create a vector memory dataset. | |
| bool | _isValidFile (const std::string &location) const |
| Check if a file location is valid. | |
| bool | _isValid (const std::string &line) const |
| Check if a line is valid and clean it. | |
| std::vector< std::string > | regexLoop (const boost::regex &cutregex, std::string &str) const |
| Capture a for loop from a line and return the variables to loop on. | |
| std::vector< std::string > | spliter (std::string strmask, const boost::regex &xspliter) const |
| Split a string into multiple strings. | |
| void | _clearComments (std::string &line) const |
| Clear the comments from a line and fill up the comment member. | |
| std::string | _upper (const std::string &lowercases) const |
| Convert a string to upper case. | |
| virtual std::queue< FMTLineInfo > | _tryInclude (const std::vector< Core::FMTTheme > &p_themes, const Core::FMTConstants &p_cons, std::queue< FMTLineInfo >p_ForOut) const |
| Return the next lines to be read by the parser, considering included files. | |
| virtual std::queue< FMTLineInfo > | _getCleanLinewfor (std::ifstream &p_stream, const std::vector< Core::FMTTheme > &p_themes, const Core::FMTConstants &p_cons) const |
| Get a clean line considering for loops when reading the file. | |
| std::queue< FMTLineInfo > | _getAllLines (std::ifstream &p_stream) const |
| Get all the lines of a file. | |
| std::queue< FMTLineInfo > | _processForLoopsNInclude (const std::vector< Core::FMTTheme > &p_themes, const Core::FMTConstants &p_cons, std::queue< FMTLineInfo >p_AllLines) const |
| Process the for loops and include lines. | |
| bool | _isNum (std::string value) const |
| Return true if the value is a number. | |
| bool | _isNum (const std::string &value, const Core::FMTConstants &constant, bool throwerror=true) const |
| Return true if the value is a number, raising if it is not a valid number when throwerror is true. | |
| template<typename T > | |
| T | _getNum (const std::string &value, const Core::FMTConstants &constant, int period=0) const |
| Return a numeric value from a string based on the constants and a period. | |
| template<typename T > | |
| T | _getNum (const std::string &value, bool omitnumtest=false) const |
| Return a numeric value from a string. | |
| template<typename T > | |
| bool | _tryFillNumber (T &number, const std::string &value, const Core::FMTConstants &constant, int period=0) const |
| Try to get a number from a string, returning false on failure. | |
| template<typename T > | |
| Core::FMTBounds< T > | bounds (const Core::FMTConstants &constants, const std::string &value, const std::string &ope, Core::FMTsection section) const |
| Return a FMTBounds from a value based on the constants and a section. | |
| std::array< std::string, 5 > | getBaseOperators () const |
| Return the operators normally found in the different sections. | |
| std::vector< std::string > | _sameAs (const std::string &allset) const |
| Handle the _sameAs keyword. | |
| std::map< Core::FMTsection, std::string > | _getPrimary (const std::string &primarylocation) |
| Return the file locations of the different sections from a primary file. | |
| bool | _isYld (const Core::FMTYields &p_ylds, const std::string &p_value, Core::FMTsection pm_section, bool p_throwError=true) const |
| Check if a value is a valid yield. | |
| bool | _isAct (Core::FMTsection section, const std::vector< Core::FMTAction > &actions, std::string action) const |
| Check if a value is an action. | |
| std::string | _setSpecs (Core::FMTsection section, Core::FMTkwor key, const Core::FMTYields &ylds, const Core::FMTConstants &constants, std::vector< Core::FMTSpec > &specs, const std::string &line) |
| Set the specifications of one or multiple specs and return the rest of the line. | |
| std::string | _setSpec (Core::FMTsection section, Core::FMTkwor key, const Core::FMTYields &ylds, const Core::FMTConstants &constants, Core::FMTSpec &spec, const std::string &line) |
| Set the specification of a spec and return the rest of the line. | |
| std::vector< std::vector< std::string > > | readCsv (const std::string &location, const char &separator) |
| Read a CSV file from a location using a separator. | |
| Core::FMTPerBounds | _getPerBound (const std::string &p_lower, const std::string &p_upper, const Core::FMTConstants &p_constants) const |
| Return the period bound of an input. | |
| void | _setPeriodWithBounds (Core::FMTSpec &p_spec, const std::string &p_lower, const std::string &p_upper, const Core::FMTConstants &p_constants) const |
| Set the periods of a spec from a lower and upper bound. | |
| bool | _setPeriods (Core::FMTSpec &p_spec, const std::string &p_periods, const Core::FMTConstants &p_constants) const |
| Set the periods of a spec from a parsed period string. | |
| std::map< std::string, std::vector< std::string > > | _getForLoops (const std::string &p_line, const std::vector< Core::FMTTheme > &p_themes, const Core::FMTConstants &p_cons) const |
| Fill up the for loops queue with the targeted variables. | |
| void | _processForLoops (const std::vector< Core::FMTTheme > &p_themes, const Core::FMTConstants &p_constants, std::queue< FMTLineInfo > &p_queue) const |
| Unroll the for loops in the queue and set the results in the queue. | |
| bool | _isForLoops (const std::string &p_line) const |
| Return true if a line is a for loop header. | |
| bool | _isForLoopsEnd (const std::string &p_line) const |
| Return true if a line is the end of a for loop. | |
| std::string | _getLine (std::queue< FMTLineInfo > &p_Lines) const |
| Get and pop the front line of a queue. | |
Protected Member Functions inherited from Core::FMTObject | |
| template<class Archive > | |
| void | forceSave (Archive &ar, const unsigned int version) const |
| Force the serialization to save useful information, which the default FMTObject serialization does not. | |
| template<class Archive > | |
| void | forceLoad (Archive &ar, const unsigned int version) |
| Force the serialization to load useful information, which the default FMTObject serialization does not. | |
| void | checkSignals () const |
| Check if the user has sent a ctrl-c signal using boost::python to FMT. | |
| void | setCplHandler () |
| Pass the FMT exception handler to the GDAL exception handler (GDAL only). | |
Protected Attributes | |
| boost::recursive_mutex | m_MTX |
| Mutex for multi-threading. | |
| Core::FMTsection | m_section |
| The section in which the child class is in. | |
| int | m_constrePlacement |
| Number of constant replaced by a numerical number. | |
| int | m_line |
| Line id at which the parser is reading the values. | |
| std::string | m_comment |
| Comment found in the actual line read by the parser. | |
| std::string | m_location |
| File location of the section read by the parser. | |
| std::time_t | m_MostRecentFile |
| The most recent file time read by this parser. | |
Static Protected Attributes | |
| static const boost::regex | m_SEPARATOR |
| A regex for splitting general string. | |
| static const boost::regex | m_AYLD |
| A regex for capturing age/period/yield specification. | |
| static const boost::regex | m_AAGE |
| A regex for capturing age specificaiton. | |
| static const boost::regex | m_AYLD_AGE |
| A regex for capturing age or yield specification. | |
| static const boost::regex | m_BOUNDS |
| A regex for capturing bounds for yield or age specification. | |
| static const boost::regex | m_OPERATORS |
| A regex for capturing simple operators. | |
| static const boost::regex | m_PRIMARY |
| A regex for capturing the primary file. | |
Static Protected Attributes inherited from Core::FMTObject | |
| static std::unique_ptr< Exception::FMTExceptionHandler > | _exhandler |
| A shared pointer to the exception handler. | |
| static std::unique_ptr< Logging::FMTLogger > | _logger |
| A shared pointer to the logger. | |
Friends | |
| class | Testing::UnitTestFMTParser |
Additional Inherited Members | |
Static Protected Member Functions inherited from Core::FMTObject | |
| static std::chrono::time_point< std::chrono::high_resolution_clock > | getClock () |
| Return a clock of the current time. | |
| template<class chrono > | |
| static double | getDuration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
| Return the time elapsed since a start clock as a double. | |
| static std::string | getDurationInSeconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
| Return the time elapsed since a start clock in seconds as a string. | |
| static void | _logStack () |
| Log the stack trace... | |
| static void | _terminate () |
| Raise an error with the boost stacktrace. | |
| static void | _abort (int p_signal) |
| Raise an error with the boost stacktrace on abort. | |
Main parent class of all the parsers in FMT.
Provides many functions common to all parsers for validation and error handling when turning a string into something usable in FMT.
| Parser::FMTParser::FMTParser | ( | ) |
Default constructor for FMTParser.
| Parser::FMTParser::FMTParser | ( | const FMTParser & | rhs | ) |
|
virtualdefault |
Default destructor for FMTParser.
|
protected |
Clear the comments from a line and fill up the comment member.
| [in,out] | line | the line. |
|
protected |
Create a GDAL raster band in a dataset with categories.
| [in] | dataset | the dataset. |
| [in] | categories | the categories. |
| [in] | bandid | the band id. |
|
protected |
Create an empty GDAL dataset for a layer.
| T | the layer value type. |
| [in] | location | the location. |
| [in] | layer | the layer. |
| [in] | datatypeid | the data type id. |
| [in] | format | the format. |
|
protected |
Create a vector memory dataset.
|
protected |
Return the GDAL drivers for a given spatial type.
| [in] | spatialtype | the spatial type (raster or vector). |
| [in] | testcreation | if true only returns drivers that support creation. |
|
protected |
Get all the lines of a file.
| [in,out] | p_stream | the file stream. |
|
protected |
Open a GDAL raster band from a dataset.
| [in] | dataset | the dataset. |
| [in] | bandid | the band id. |
|
protected |
Return the categories of a dataset for a given band.
| [in] | dataset | the dataset. |
| [in] | bandid | the band id. |
|
protectedvirtual |
Get a clean line considering for loops when reading the file.
| [in,out] | p_stream | the file stream. |
| [in] | p_themes | the model themes. |
| [in] | p_cons | the model constants. |
|
protected |
Open a GDAL dataset in read only from a location, throwing on error.
| [in] | location | the location. |
|
protected |
Return the spatial reference used for FORELs in Quebec.
|
protected |
Fill up the for loops queue with the targeted variables.
| [in] | p_line | the for loop header line. |
| [in] | p_themes | the model themes. |
| [in] | p_cons | the model constants. |
|
protected |
Open a GDAL layer from a vector dataset by its id, throwing on error.
| [in] | dataset | the dataset. |
| [in] | id | the layer id. |
|
protected |
Get and pop the front line of a queue.
| [in,out] | p_Lines | the queue of lines. |
|
protected |
Return a numeric value from a string.
| T | the numeric type. |
| [in] | value | the value. |
| [in] | omitnumtest | if true omits the number test. |
|
protected |
Return a numeric value from a string based on the constants and a period.
| T | the numeric type. |
| [in] | value | the value. |
| [in] | constant | the constants. |
| [in] | period | the period. |
|
protected |
Return an overview of a raster band.
| [in] | band | the raster band. |
| [in] | view | the overview index. |
|
protected |
Return the period bound of an input.
| [in] | p_lower | the lower bound. |
| [in] | p_upper | the upper bound. |
| [in] | p_constants | the constants. |
|
protected |
Return the file locations of the different sections from a primary file.
| [in] | primarylocation | the primary file location. |
|
protected |
Return a coordinate transformation for a layer, optionally fitting to FOREL.
| [in] | baselayer | the base layer. |
| [in] | fittoforel | if true fits to FOREL. |
|
protected |
Create a memory dataset copying a layer with a new field, optionally with a new spatial reference.
| [in] | baselayer | the base layer. |
| [in] | newreference | the new spatial reference. |
| [in] | fieldname | the new field name. |
|
protected |
Open a GDAL vector dataset in read only from a location, throwing on error.
| [in] | location | the location. |
|
protected |
Fill up the field ids of the themes, age, area and lock of a layer.
| [in] | layer | the layer. |
| [in,out] | themes | the theme field ids. |
| [in,out] | age | the age field id. |
| [in,out] | area | the area field id. |
| [in,out] | lock | the lock field id. |
| [in] | agefield | the age field name. |
| [in] | areafield | the area field name. |
| [in] | lockfield | the lock field name. |
|
protected |
Check if a value is an action.
| [in] | section | the section. |
| [in] | actions | the actions. |
| [in] | action | the value. |
|
protected |
Return true if a line is a for loop header.
| [in] | p_line | the line. |
|
protected |
Return true if a line is the end of a for loop.
| [in] | p_line | the line. |
|
protected |
Return true if the value is a number, raising if it is not a valid number when throwerror is true.
| [in] | value | the value. |
| [in] | constant | the constants. |
| [in] | throwerror | if true raises on a non valid number. |
|
protected |
Return true if the value is a number.
| [in] | value | the value. |
|
protected |
Check if a line is valid and clean it.
| [in] | line | the line. |
|
protected |
Check if a file location is valid.
| [in] | location | the location. |
|
protected |
Check if a value is a valid yield.
| [in] | p_ylds | the yield section. |
| [in] | p_value | the value. |
| [in] | pm_section | the section. |
| [in] | p_throwError | if true raises if the value is not a yield. |
|
protected |
Unroll the for loops in the queue and set the results in the queue.
| [in] | p_themes | the model themes. |
| [in] | p_constants | the model constants. |
| [in,out] | p_queue | the resulting queue of lines. |
|
protected |
Process the for loops and include lines.
| [in] | p_themes | the model themes. |
| [in] | p_cons | the model constants. |
| [in] | p_AllLines | all the lines read from the file. |
|
protected |
Handle the _sameAs keyword.
| [in] | allset | the set string. |
|
protected |
Write the categories in the band information.
| [in,out] | band | the raster band. |
| [in] | categories | the categories. |
|
protected |
Set the periods of a spec from a parsed period string.
| [in,out] | p_spec | the spec. |
| [in] | p_periods | the period string. |
| [in] | p_constants | the constants. |
|
protected |
Set the periods of a spec from a lower and upper bound.
| [in,out] | p_spec | the spec. |
| [in] | p_lower | the lower bound. |
| [in] | p_upper | the upper bound. |
| [in] | p_constants | the constants. |
|
protected |
Set the section member of the parser.
| [in] | section | the section to set. |
|
protected |
Set the specification of a spec and return the rest of the line.
| [in] | section | the section. |
| [in] | key | the keyword. |
| [in] | ylds | the yields. |
| [in] | constants | the constants. |
| [in,out] | spec | the specification. |
| [in] | line | the line. |
|
protected |
Set the specifications of one or multiple specs and return the rest of the line.
| [in] | section | the section. |
| [in] | key | the keyword. |
| [in] | ylds | the yields. |
| [in] | constants | the constants. |
| [in,out] | specs | the specifications. |
| [in] | line | the line. |
|
protected |
Try to get a number from a string, returning false on failure.
| T | the numeric type. |
| [out] | number | the number. |
| [in] | value | the value. |
| [in] | constant | the constants. |
| [in] | period | the period. |
|
protectedvirtual |
Return the next lines to be read by the parser, considering included files.
| [in] | p_themes | the model themes. |
| [in] | p_cons | the model constants. |
| [in] | p_ForOut | the output of the for loops unroll. |
|
protected |
Convert a string to upper case.
| [in] | lowercases | the string to convert. |
|
protected |
Return a FMTBounds from a value based on the constants and a section.
| T | the bounded value type. |
| [in] | constants | the constants. |
| [in] | value | the value. |
| [in] | ope | the operator. |
| [in] | section | the section. |
| OGRLayer * Parser::FMTParser::createLayer | ( | GDALDataset * | dataset, |
| const std::string & | name, | ||
| std::vector< std::string > | creationoptions = std::vector< std::string >() |
||
| ) | const |
Create a layer in a dataset, deleting any existing layer with the same name.
| [in] | dataset | the dataset. |
| [in] | name | the layer name. |
| [in] | creationoptions | the creation options. |
| GDALDataset * Parser::FMTParser::createOGRDataset | ( | std::string | location = std::string(), |
| std::string | gdaldrivername = "CSV" |
||
| ) | const |
Create an OGR vector dataset based on a driver name and a location.
| [in] | location | the location of the dataset. |
| [in] | gdaldrivername | the GDAL driver name. |
| std::string Parser::FMTParser::createSubDirectory | ( | const std::string & | p_Directory, |
| const std::string & | p_SubDirectory | ||
| ) |
Create a sub directory in directory.
| [in] | p_Directory | the base directory |
| [in] | p_SubDirectory | the sub directory |
|
static |
Return the FMTsection matching the extension of a file.
| [in] | p_Extension | the file extension. |
|
protected |
Return the operators normally found in the different sections.
| std::string Parser::FMTParser::getCleanLine | ( | const std::string & | p_input | ) | const |
Clean a line and make it ready to be read by a parser.
| [in] | p_input | the input line. |
| std::string Parser::FMTParser::getCleanLine | ( | std::istream & | stream | ) | const |
Clean a line and make it ready to be read by a parser.
| [in,out] | stream | the input stream. |
|
protected |
Return the GDAL extensions organized by driver for a given spatial type.
| [in] | spatialtype | the spatial type (raster or vector). |
| [in] | testcreation | if true only returns drivers that support creation. |
| std::vector< std::vector< std::string > > Parser::FMTParser::getGDALRasterDriverExtensions | ( | bool | testcreation = true | ) | const |
Return a vector of GDAL raster driver extensions organized by driver.
| [in] | testcreation | if true only returns drivers that support creation. |
| std::vector< std::string > Parser::FMTParser::getGDALRasterDriverNames | ( | bool | testcreation = true | ) | const |
Return a vector of GDAL raster driver names.
| [in] | testcreation | if true only returns drivers that support creation. |
| std::vector< std::vector< std::string > > Parser::FMTParser::getGDALVectorDriverExtensions | ( | bool | testcreation = true | ) | const |
Return a vector of GDAL vector driver extensions organized by driver.
| [in] | testcreation | if true only returns drivers that support creation. |
| std::vector< std::string > Parser::FMTParser::getGDALVectorDriverNames | ( | bool | testcreation = true | ) | const |
Return a vector of GDAL vector driver names.
| [in] | testcreation | if true only returns drivers that support creation. |
| std::time_t Parser::FMTParser::getMostRecentFiletime | ( | ) | const |
Return the most recent file time of the files read by the parser.
|
protected |
Read a CSV file from a location using a separator.
| [in] | location | the location. |
| [in] | separator | the separator. |
|
protected |
Capture a for loop from a line and return the variables to loop on.
| [in] | cutregex | the regex. |
| [in,out] | str | the line. |
| void Parser::FMTParser::setHeader | ( | const std::string & | header | ) |
Set a string as the header written when the file is opened in write mode, replacing the comment attribute.
| [in] | header | the header string. |
|
protected |
Split a string into multiple strings.
| [in] | strmask | the string to split. |
| [in] | xspliter | the splitting regex. |
| bool Parser::FMTParser::tryOpening | ( | const std::ifstream & | stream, |
| const std::string & | location | ||
| ) | const |
Open an input stream at a given location.
| [in] | stream | the input stream. |
| [in] | location | the location. |
| bool Parser::FMTParser::tryOpening | ( | std::ofstream & | stream, |
| const std::string & | location | ||
| ) | const |
Open an output stream at a given location.
| [in,out] | stream | the output stream. |
| [in] | location | the location. |
|
friend |
|
staticprotected |
A regex for capturing age specificaiton.
|
staticprotected |
A regex for capturing age/period/yield specification.
|
staticprotected |
A regex for capturing age or yield specification.
|
staticprotected |
A regex for capturing bounds for yield or age specification.
|
mutableprotected |
Comment found in the actual line read by the parser.
|
mutableprotected |
Number of constant replaced by a numerical number.
|
mutableprotected |
Line id at which the parser is reading the values.
|
mutableprotected |
File location of the section read by the parser.
|
mutableprotected |
The most recent file time read by this parser.
|
mutableprotected |
Mutex for multi-threading.
|
staticprotected |
A regex for capturing simple operators.
|
staticprotected |
A regex for capturing the primary file.
|
mutableprotected |
The section in which the child class is in.
|
staticprotected |
A regex for splitting general string.