Namespaces | |
| namespace | detail |
Functions | |
| unsigned int | TrailingRightBits (uint32_t aValue) |
| Helper function to calculate the number of zero-bits at the righthand end of a 32-bit number. More... | |
| void | ParseSemicolonDelimitedUriList (const std::string &aSemicolonDelimitedUriList, std::vector< std::pair< std::string, std::string > > &aUriList) |
| Parse a semicolon delimited list of URIs into a vector of protocol/address pairs. More... | |
| void | ShellExpandFilenameExpr (const std::string &aFilenameExpr, const boost::filesystem::path &aParentPath, std::vector< boost::filesystem::path > &aFiles) |
| Perform shell expansion of a linux shell expression ( e.g. More... | |
| template<bool DebugInfo> | |
| bool | HttpGet (const std::string &aURL, HttpResponseType &aResponse) |
| Retrieve a file by HTTP. More... | |
| void | OpenFileLocal (const std::string &aFilenameExpr, const boost::filesystem::path &aParentPath, const detail::FileCallback_t &aCallback) |
| Given a linux shell expression, open all files which match it and call the callback function on each of them. More... | |
| void | OpenFileHttp (const std::string &aURL, const detail::FileCallback_t &aCallback) |
| Given a URL, retrieve the file and call the callback function on each of them. More... | |
| void | OpenFile (const std::string &aProtocol, const std::string &aFilenameExpr, const boost::filesystem::path &aParentPath, const detail::FileCallback_t &aCallback) |
| Given a protocol and either a URL or a linux shell expression, open the file and call the callback function on each of them. More... | |
| void | PugiXMLParseResultPrettifier (const pugi::xml_parse_result &aLoadResult, const boost::filesystem::path &aPath, const std::vector< uint8_t > &aFile) |
| Helper function to make debugging failures when parsing XML files easier. More... | |
| template<bool DebugInfo> | |
| bool | GetXMLattribute (const pugi::xml_node &aNode, const std::string &aAttrName, std::string &aTarget) |
| Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type. More... | |
| template<bool DebugInfo> | |
| bool | GetXMLattribute (const pugi::xml_node &aNode, const std::string &aAttrName, int32_t &aTarget) |
| Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type. More... | |
| template<bool DebugInfo> | |
| bool | GetXMLattribute (const pugi::xml_node &aNode, const std::string &aAttrName, uint32_t &aTarget) |
| Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type. More... | |
| template<bool DebugInfo> | |
| bool | GetXMLattribute (const pugi::xml_node &aNode, const std::string &aAttrName, double &aTarget) |
| Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type. More... | |
| template<bool DebugInfo> | |
| bool | GetXMLattribute (const pugi::xml_node &aNode, const std::string &aAttrName, float &aTarget) |
| Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type. More... | |
| template<bool DebugInfo> | |
| bool | GetXMLattribute (const pugi::xml_node &aNode, const std::string &aAttrName, bool &aTarget) |
| Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type. More... | |
| template bool | HttpGet< false > (const std::string &, HttpResponseType &) |
| template bool | HttpGet< true > (const std::string &, HttpResponseType &) |
| template bool | GetXMLattribute< true > (const pugi::xml_node &aNode, const std::string &aAttrName, std::string &aTarget) |
| template bool | GetXMLattribute< false > (const pugi::xml_node &aNode, const std::string &aAttrName, std::string &aTarget) |
| template bool | GetXMLattribute< true > (const pugi::xml_node &aNode, const std::string &aAttrName, int32_t &aTarget) |
| template bool | GetXMLattribute< false > (const pugi::xml_node &aNode, const std::string &aAttrName, int32_t &aTarget) |
| template bool | GetXMLattribute< true > (const pugi::xml_node &aNode, const std::string &aAttrName, uint32_t &aTarget) |
| template bool | GetXMLattribute< false > (const pugi::xml_node &aNode, const std::string &aAttrName, uint32_t &aTarget) |
| template bool | GetXMLattribute< true > (const pugi::xml_node &aNode, const std::string &aAttrName, double &aTarget) |
| template bool | GetXMLattribute< false > (const pugi::xml_node &aNode, const std::string &aAttrName, double &aTarget) |
| template bool | GetXMLattribute< true > (const pugi::xml_node &aNode, const std::string &aAttrName, float &aTarget) |
| template bool | GetXMLattribute< false > (const pugi::xml_node &aNode, const std::string &aAttrName, float &aTarget) |
| template bool | GetXMLattribute< true > (const pugi::xml_node &aNode, const std::string &aAttrName, bool &aTarget) |
| template bool | GetXMLattribute< false > (const pugi::xml_node &aNode, const std::string &aAttrName, bool &aTarget) |
| bool uhal::utilities::GetXMLattribute | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| bool & | aTarget | ||
| ) |
Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type.
| aNode | a node from which the attribute is to be extracted |
| aAttrName | the name of the attribute to be extracted |
| aTarget | a variable into which the attribute's value id to be written |
Definition at line 342 of file xml.cpp.
References pugi::xml_attribute::as_bool(), pugi::xml_node::attribute(), pugi::xml_attribute::empty(), uhal::Error, uhal::log(), and uhal::Quote().
| bool uhal::utilities::GetXMLattribute | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| double & | aTarget | ||
| ) |
Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type.
| aNode | a node from which the attribute is to be extracted |
| aAttrName | the name of the attribute to be extracted |
| aTarget | a variable into which the attribute's value id to be written |
Definition at line 292 of file xml.cpp.
References pugi::xml_attribute::as_double(), pugi::xml_node::attribute(), pugi::xml_attribute::empty(), uhal::Error, uhal::log(), and uhal::Quote().
| bool uhal::utilities::GetXMLattribute | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| float & | aTarget | ||
| ) |
Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type.
| aNode | a node from which the attribute is to be extracted |
| aAttrName | the name of the attribute to be extracted |
| aTarget | a variable into which the attribute's value id to be written |
Definition at line 317 of file xml.cpp.
References pugi::xml_attribute::as_float(), pugi::xml_node::attribute(), pugi::xml_attribute::empty(), uhal::Error, uhal::log(), and uhal::Quote().
| bool uhal::utilities::GetXMLattribute | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| int32_t & | aTarget | ||
| ) |
Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type.
| aNode | a node from which the attribute is to be extracted |
| aAttrName | the name of the attribute to be extracted |
| aTarget | a variable into which the attribute's value id to be written |
Definition at line 141 of file xml.cpp.
References pugi::xml_node::attribute(), pugi::xml_attribute::empty(), uhal::Error, uhal::log(), uhal::Quote(), and pugi::xml_attribute::value().
| bool uhal::utilities::GetXMLattribute | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| std::string & | aTarget | ||
| ) |
Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type.
| aNode | a node from which the attribute is to be extracted |
| aAttrName | the name of the attribute to be extracted |
| aTarget | a variable into which the attribute's value id to be written |
Definition at line 116 of file xml.cpp.
References pugi::xml_node::attribute(), pugi::xml_attribute::empty(), uhal::Error, uhal::log(), uhal::Quote(), and pugi::xml_attribute::value().
| bool uhal::utilities::GetXMLattribute | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| uint32_t & | aTarget | ||
| ) |
Helper function to retrieve a named attribute from a PugiXML node and cast it to the correct type.
| aNode | a node from which the attribute is to be extracted |
| aAttrName | the name of the attribute to be extracted |
| aTarget | a variable into which the attribute's value id to be written |
Definition at line 217 of file xml.cpp.
References pugi::xml_node::attribute(), pugi::xml_attribute::empty(), uhal::Error, uhal::log(), uhal::Quote(), and pugi::xml_attribute::value().
| template bool uhal::utilities::GetXMLattribute< false > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| bool & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< false > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| double & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< false > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| float & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< false > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| int32_t & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< false > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| std::string & | aTarget | ||
| ) |
Referenced by uhal::NodeTreeBuilder::moduleNodeCreator(), uhal::NodeTreeBuilder::setAddr(), uhal::NodeTreeBuilder::setClassName(), uhal::NodeTreeBuilder::setDescription(), uhal::NodeTreeBuilder::setFirmwareInfo(), uhal::NodeTreeBuilder::setMask(), uhal::NodeTreeBuilder::setModeAndSize(), uhal::NodeTreeBuilder::setPars(), uhal::NodeTreeBuilder::setPermissions(), uhal::NodeTreeBuilder::setTags(), and uhal::NodeTreeBuilder::setUid().
| template bool uhal::utilities::GetXMLattribute< false > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| uint32_t & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< true > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| bool & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< true > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| double & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< true > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| float & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< true > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| int32_t & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< true > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| std::string & | aTarget | ||
| ) |
| template bool uhal::utilities::GetXMLattribute< true > | ( | const pugi::xml_node & | aNode, |
| const std::string & | aAttrName, | ||
| uint32_t & | aTarget | ||
| ) |
| bool uhal::utilities::HttpGet | ( | const std::string & | aURL, |
| HttpResponseType & | aResponse | ||
| ) |
Retrieve a file by HTTP.
| aURL | a URL to retrieve |
| aResponse | a structure into which the returned HTTP packet is parsed |
Definition at line 137 of file files.cpp.
References uhal::Error, uhal::Info, uhal::log(), uhal::HttpResponseType::method, uhal::Quote(), uhal::HttpResponseType::status, and ThisLocation.
| template bool uhal::utilities::HttpGet< false > | ( | const std::string & | , |
| HttpResponseType & | |||
| ) |
| template bool uhal::utilities::HttpGet< true > | ( | const std::string & | , |
| HttpResponseType & | |||
| ) |
Referenced by OpenFileHttp().
| void uhal::utilities::OpenFile | ( | const std::string & | aProtocol, |
| const std::string & | aFilenameExpr, | ||
| const boost::filesystem::path & | aParentPath, | ||
| const detail::FileCallback_t & | aCallback | ||
| ) |
Given a protocol and either a URL or a linux shell expression, open the file and call the callback function on each of them.
| aProtocol | the protocol to be used to retrieve the file |
| aFilenameExpr | a linux shell expression to be expanded or a URL to be retrieved |
| aParentPath | a path which will be prepended to relative file names for local files. No meaning for http files. |
| aCallback | a callback function to be called on the files |
Definition at line 329 of file files.cpp.
References uhal::log(), OpenFileHttp(), OpenFileLocal(), and uhal::Quote().
Referenced by uhal::ConnectionManager::ConnectionManager(), and uhal::NodeTreeBuilder::getNodeTree().
| void uhal::utilities::OpenFileHttp | ( | const std::string & | aURL, |
| const detail::FileCallback_t & | aCallback | ||
| ) |
Given a URL, retrieve the file and call the callback function on each of them.
| aURL | a URL to retrieve |
| aCallback | a callback function to be called on the retrieved URL |
Definition at line 313 of file files.cpp.
References uhal::HttpResponseType::content, HttpGet< true >(), uhal::log(), and uhal::Quote().
Referenced by OpenFile().
| void uhal::utilities::OpenFileLocal | ( | const std::string & | aFilenameExpr, |
| const boost::filesystem::path & | aParentPath, | ||
| const detail::FileCallback_t & | aCallback | ||
| ) |
Given a linux shell expression, open all files which match it and call the callback function on each of them.
| aFilenameExpr | a linux shell expression to be expanded |
| aParentPath | a path which will be prepended to relative file names |
| aCallback | a callback function to be called on each file matching the linux shell expression |
Definition at line 284 of file files.cpp.
References uhal::log(), uhal::Quote(), and ShellExpandFilenameExpr().
Referenced by OpenFile().
| void uhal::utilities::ParseSemicolonDelimitedUriList | ( | const std::string & | aSemicolonDelimitedUriList, |
| std::vector< std::pair< std::string, std::string > > & | aUriList | ||
| ) |
Parse a semicolon delimited list of URIs into a vector of protocol/address pairs.
| aSemicolonDelimitedUriList | a string containing a semicolon delimited list of URIs |
| aUriList | a vector to which the extracted protocol/address pairs are appended |
Definition at line 63 of file files.cpp.
References uhal::Debug, uhal::log(), and uhal::Quote().
Referenced by uhal::ConnectionManager::ConnectionManager(), and uhal::NodeTreeBuilder::getNodeTree().
| void uhal::utilities::PugiXMLParseResultPrettifier | ( | const pugi::xml_parse_result & | aLoadResult, |
| const boost::filesystem::path & | aPath, | ||
| const std::vector< uint8_t > & | aFile | ||
| ) |
Helper function to make debugging failures when parsing XML files easier.
| aLoadResult | the result of the parsing |
| aPath | the full filename of file whose parsing failed |
| aFile | a byte vector containing the contents of the file (stored like this because the file could be either local or retrieved by HTTP) |
Definition at line 57 of file xml.cpp.
References pugi::xml_parse_result::description(), uhal::Error, uhal::Integer(), uhal::log(), pugi::xml_parse_result::offset, and uhal::Quote().
Referenced by uhal::ConnectionManager::CallBack(), and uhal::NodeTreeBuilder::CallBack().
| void uhal::utilities::ShellExpandFilenameExpr | ( | const std::string & | aFilenameExpr, |
| const boost::filesystem::path & | aParentPath, | ||
| std::vector< boost::filesystem::path > & | aFiles | ||
| ) |
Perform shell expansion of a linux shell expression ( e.g.
"~/c*.xml" -> "/usr/home/awr/connections.xml" ) and convert into boost::filesystem::paths
| aFilenameExpr | a c-style string containing a linux shell expression to be expanded |
| aParentPath | a path which will be prepended to relative file names |
| aFiles | a pointer to a vector of boost::filesystem::paths onto which the returned file names are appended |
Definition at line 86 of file files.cpp.
References uhal::Debug, uhal::log(), and uhal::Quote().
Referenced by OpenFileLocal().
| unsigned int uhal::utilities::TrailingRightBits | ( | uint32_t | aValue | ) |
Helper function to calculate the number of zero-bits at the righthand end of a 32-bit number.
| aValue | a 32-bit number whose trailing zero-bits are to be counted |
Definition at line 44 of file bits.cpp.
Referenced by uhal::ValWord< T >::value(), and uhal::ClientInterface::write().