WS++  v0.5.0-1152
Workflow/Spaces - C++ Library
fc Namespace Reference

FileCatalyst namespace. More...

Classes

class  WS
 Objects of this class lets C++ applications easily communicate with Unlimi-Tech's FileCatalyst Workflow/Spaces servers. More...
 

Typedefs

typedef std::list< xmlNode * > LXmlNodes
 Ordered list of libxml2 XML nodes. More...
 

Functions

std::string to_string (const WS::EState state)
 Convert the WS internal state to a text string. More...
 
StrMap getNodeAttributes (xmlNode *node)
 Libxml2 helper function to get a map of all attribute names and values for the given node. More...
 
xmlNode * findAnyNodeWithName (xmlNode *node, const std::string &name)
 Libxml2 helper function to look through both siblings and children to find and return the first node with this name. More...
 
xmlNode * findAnyNodeWithName (xmlDoc *doc, const std::string &name)
 Libxml2 helper function to look through both siblings and children to find and return the first node with this name. More...
 
xmlNode * findImmediateChildWithName (xmlNode *node, const std::string &name)
 Libxml2 helper function to look only at immediate children nodes to find and return the first one with this name. More...
 
xmlNode * findImmediateChildWithName (xmlDoc *doc, const std::string &name)
 Libxml2 helper function to look only at immediate children nodes to find and return the first one with this name. More...
 
StrMap findAnyNodeAndGetAttribs (xmlNode *node, const std::string &name)
 Combination of findAnyNodeWithName() and getNodeAttributes() in one function call. More...
 
StrMap findAnyNodeAndGetAttribs (xmlDoc *doc, const std::string &name)
 Combination of findAnyNodeWithName() and getNodeAttributes() in one function call. More...
 
LXmlNodes findAllSiblingsWithName (xmlNode *node, const std::string &name)
 Libxml2 helper function to get a list of all sibling nodes with the given name. More...
 
LXmlNodes findAllSiblingsWithName (xmlDoc *doc, const std::string &name)
 Libxml2 helper function to get a list of all sibling nodes with the given name. More...
 

Detailed Description

FileCatalyst namespace.

Typedef Documentation

◆ LXmlNodes

typedef std::list<xmlNode*> fc::LXmlNodes

Ordered list of libxml2 XML nodes.

See also
findAllSiblingsWithName()

Function Documentation

◆ to_string()

std::string fc::to_string ( const WS::EState  state)

Convert the WS internal state to a text string.

◆ findAnyNodeWithName() [1/2]

xmlNode * fc::findAnyNodeWithName ( xmlNode *  node,
const std::string &  name 
)

Libxml2 helper function to look through both siblings and children to find and return the first node with this name.

Returns
nullptr if a node cannot be found.

For example:

auto doc = xmlParseDoc((xmlChar*)ws.server_xml.c_str());
auto node = fc::findAnyNodeWithName(doc, "orderform");
auto m = fc::getNodeAttributes(node);
for (const auto & [key, val] : m)
{
std::cout == "KEY=\"" << key << "\", VAL=\"" << val << "\"" << std::endl;
}

For example, the code above might print the following:

KEY="name", VAL="default"
KEY="displayName", VAL="Ingest"
KEY="type", VAL="job"

◆ findAnyNodeWithName() [2/2]

xmlNode * fc::findAnyNodeWithName ( xmlDoc *  doc,
const std::string &  name 
)

Libxml2 helper function to look through both siblings and children to find and return the first node with this name.

Returns
nullptr if a node cannot be found.

For example:

auto doc = xmlParseDoc((xmlChar*)ws.server_xml.c_str());
auto node = fc::findAnyNodeWithName(doc, "orderform");
auto m = fc::getNodeAttributes(node);
for (const auto & [key, val] : m)
{
std::cout == "KEY=\"" << key << "\", VAL=\"" << val << "\"" << std::endl;
}

For example, the code above might print the following:

KEY="name", VAL="default"
KEY="displayName", VAL="Ingest"
KEY="type", VAL="job"

◆ findImmediateChildWithName() [1/2]

xmlNode * fc::findImmediateChildWithName ( xmlNode *  node,
const std::string &  name 
)

Libxml2 helper function to look only at immediate children nodes to find and return the first one with this name.

Returns
nullptr if a node cannot be found.

◆ findImmediateChildWithName() [2/2]

xmlNode * fc::findImmediateChildWithName ( xmlDoc *  doc,
const std::string &  name 
)

Libxml2 helper function to look only at immediate children nodes to find and return the first one with this name.

Returns
nullptr if a node cannot be found.

◆ getNodeAttributes()

fc::StrMap fc::getNodeAttributes ( xmlNode *  node)

Libxml2 helper function to get a map of all attribute names and values for the given node.

◆ findAnyNodeAndGetAttribs() [1/2]

fc::StrMap fc::findAnyNodeAndGetAttribs ( xmlNode *  node,
const std::string &  name 
)

Combination of findAnyNodeWithName() and getNodeAttributes() in one function call.

◆ findAnyNodeAndGetAttribs() [2/2]

fc::StrMap fc::findAnyNodeAndGetAttribs ( xmlDoc *  doc,
const std::string &  name 
)

Combination of findAnyNodeWithName() and getNodeAttributes() in one function call.

◆ findAllSiblingsWithName() [1/2]

fc::LXmlNodes fc::findAllSiblingsWithName ( xmlNode *  node,
const std::string &  name 
)

Libxml2 helper function to get a list of all sibling nodes with the given name.

◆ findAllSiblingsWithName() [2/2]

fc::LXmlNodes fc::findAllSiblingsWithName ( xmlDoc *  doc,
const std::string &  name 
)

Libxml2 helper function to get a list of all sibling nodes with the given name.