libept  0.5.25
Public Member Functions | List of all members
ept::core::record::RecordParser Class Reference

Access the fields of a package record contained inside a std::string. More...

#include <recordparser.h>

Inheritance diagram for ept::core::record::RecordParser:
Inheritance graph
[legend]

Public Member Functions

 RecordParser ()
 
 RecordParser (const std::string &str)
 
void scan (const std::string &str)
 Index a new record. More...
 
size_t index (const std::string &str) const
 Get the index of the field with the given name. More...
 
std::string field (size_t idx) const
 Return the field by its index. More...
 
std::string name (size_t idx) const
 Return the name of a field by its index. More...
 
std::string lookup (size_t idx) const
 Return the content of a field by its index. More...
 
std::string lookup (const std::string &name) const
 Return the content of a field by its name. More...
 
std::string operator[] (size_t idx) const
 Return the content of a field by its index. More...
 
std::string operator[] (const std::string &name) const
 Return the content of a field by its name. More...
 
const std::string & record () const
 Return the entire record. More...
 
std::string record ()
 Return the entire record. More...
 
size_t size () const
 Return the number of fields in the record. More...
 

Detailed Description

Access the fields of a package record contained inside a std::string.

Implementation note: this implementation should take advantage of std::string sharing buffer space among them.

Constructor & Destructor Documentation

ept::core::record::RecordParser::RecordParser ( )
inline
ept::core::record::RecordParser::RecordParser ( const std::string &  str)
inline

References field(), index(), lookup(), name(), and scan().

Member Function Documentation

std::string ept::core::record::RecordParser::field ( size_t  idx) const

Return the field by its index.

Referenced by RecordParser().

size_t ept::core::record::RecordParser::index ( const std::string &  str) const

Get the index of the field with the given name.

size() is returned if not found

Referenced by lookup(), and RecordParser().

std::string ept::core::record::RecordParser::lookup ( size_t  idx) const

Return the content of a field by its index.

Referenced by operator[](), and RecordParser().

std::string ept::core::record::RecordParser::lookup ( const std::string &  name) const
inline

Return the content of a field by its name.

References index(), and lookup().

Referenced by lookup().

std::string ept::core::record::RecordParser::name ( size_t  idx) const

Return the name of a field by its index.

Referenced by RecordParser().

std::string ept::core::record::RecordParser::operator[] ( size_t  idx) const
inline

Return the content of a field by its index.

References lookup().

std::string ept::core::record::RecordParser::operator[] ( const std::string &  name) const
inline

Return the content of a field by its name.

References lookup().

const std::string& ept::core::record::RecordParser::record ( ) const
inline

Return the entire record.

std::string ept::core::record::RecordParser::record ( )
inline

Return the entire record.

void ept::core::record::RecordParser::scan ( const std::string &  str)

Index a new record.

Referenced by RecordParser().

size_t ept::core::record::RecordParser::size ( ) const
inline

Return the number of fields in the record.


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