PROJ C++ API
Public Member Functions | Static Public Member Functions | List of all members
osgeo::proj::io::WKTNode Class Reference

Node in the tree-splitted WKT representation. More...

#include <io.hpp>

Public Member Functions

 WKTNode (const std::string &valueIn)
 Instanciate a WKTNode. More...
 
const std::string & value () const
 Return the value of a node.
 
const std::vector< WKTNodeNNPtr > & children () const
 Return the children of a node.
 
void addChild (WKTNodeNNPtr &&child)
 Adds a child to the current node. More...
 
const WKTNodePtrlookForChild (const std::string &childName, int occurrence=0) const noexcept
 Return the (occurrence-1)th sub-node of name childName. More...
 
int countChildrenOfName (const std::string &childName) const noexcept
 Return the count of children of given name. More...
 
std::string toString () const
 Return a WKT representation of the tree structure.
 

Static Public Member Functions

static WKTNodeNNPtr createFrom (const std::string &wkt, size_t indexStart=0)
 Instanciate a WKTNode hierarchy from a WKT string. More...
 

Detailed Description

Node in the tree-splitted WKT representation.

Constructor & Destructor Documentation

osgeo::proj::io::WKTNode::WKTNode ( const std::string &  valueIn)
explicit

Instanciate a WKTNode.

Parameters
valueInthe name of the node.

Member Function Documentation

void osgeo::proj::io::WKTNode::addChild ( WKTNodeNNPtr &&  child)

Adds a child to the current node.

Parameters
childchild to add. This should not be a parent of this node.
int osgeo::proj::io::WKTNode::countChildrenOfName ( const std::string &  childName) const
noexcept

Return the count of children of given name.

Parameters
childNamename of the children to look for.
Returns
count
WKTNodeNNPtr osgeo::proj::io::WKTNode::createFrom ( const std::string &  wkt,
size_t  indexStart = 0 
)
static

Instanciate a WKTNode hierarchy from a WKT string.

Parameters
wktthe WKT string to parse.
indexStartthe start index in the wkt string.
Exceptions
ParsingException
const WKTNodePtr & osgeo::proj::io::WKTNode::lookForChild ( const std::string &  childName,
int  occurrence = 0 
) const
noexcept

Return the (occurrence-1)th sub-node of name childName.

Parameters
childNamename of the child.
occurrenceoccurrence index (starting at 0)
Returns
the child, or nullptr.

The documentation for this class was generated from the following files: