Access the fields of a package record contained inside a std::string. More...
#include <recordparser.h>
Public Member Functions | |
RecordParser () | |
RecordParser (const std::string &str) | |
void | scan (const std::string &str) |
Index a new record. | |
size_t | index (const std::string &str) const |
Get the index of the field with the given name. | |
std::string | field (size_t idx) const |
Return the field by its index. | |
std::string | name (size_t idx) const |
Return the name of a field by its index. | |
std::string | lookup (size_t idx) const |
Return the content of a field by its index. | |
std::string | lookup (const std::string &name) const |
Return the content of a field by its name. | |
std::string | operator[] (size_t idx) const |
Return the content of a field by its index. | |
std::string | operator[] (const std::string &name) const |
Return the content of a field by its name. | |
const std::string & | record () const |
Return the entire record. | |
std::string | record () |
Return the entire record. | |
size_t | size () const |
Return the number of fields in the record. |
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.
ept::apt::RecordParser::RecordParser | ( | ) | [inline] |
ept::apt::RecordParser::RecordParser | ( | const std::string & | str | ) | [inline] |
References scan().
std::string ept::apt::RecordParser::field | ( | size_t | idx | ) | const |
Return the field by its index.
Referenced by TestAptRecordparser::fieldTuples(), lookup(), TestAptRecordparser::missingBehaviour(), name(), and TestAptRecordparser::realLife().
size_t ept::apt::RecordParser::index | ( | const std::string & | str | ) | const |
Get the index of the field with the given name.
size() is returned if not found
References name(), and size().
Referenced by TestAptRecordparser::findByName(), and lookup().
std::string ept::apt::RecordParser::lookup | ( | size_t | idx | ) | const |
Return the content of a field by its index.
References field().
Referenced by ept::apt::PackageRecord::architecture(), ept::apt::PackageRecord::buildEssential(), ept::apt::PackageRecord::conflicts(), ept::apt::PackageRecord::depends(), ept::apt::PackageRecord::description(), ept::apt::PackageRecord::enhances(), ept::apt::PackageRecord::filename(), ept::apt::PackageRecord::installedSize(), ept::apt::PackageRecord::longDescription(), ept::apt::PackageRecord::maintainer(), ept::apt::PackageRecord::md5sum(), operator[](), ept::apt::PackageRecord::package(), ept::apt::PackageRecord::packageSize(), ept::apt::PackageRecord::preDepends(), ept::apt::PackageRecord::priority(), ept::apt::PackageRecord::provides(), ept::apt::PackageRecord::recommends(), ept::apt::PackageRecord::replaces(), ept::apt::PackageRecord::section(), ept::apt::PackageRecord::sha1(), ept::apt::PackageRecord::sha256(), ept::apt::PackageRecord::shortDescription(), ept::apt::PackageRecord::source(), ept::apt::PackageRecord::suggests(), ept::apt::PackageRecord::tag(), and ept::apt::PackageRecord::version().
std::string ept::apt::RecordParser::lookup | ( | const std::string & | name | ) | const [inline] |
std::string ept::apt::RecordParser::name | ( | size_t | idx | ) | const |
Return the name of a field by its index.
References field().
Referenced by TestAptRecordparser::fieldKeys(), TestAptRecordparser::findByName(), index(), and TestAptRecordparser::missingBehaviour().
std::string ept::apt::RecordParser::operator[] | ( | const std::string & | name | ) | const [inline] |
Return the content of a field by its name.
References lookup().
std::string ept::apt::RecordParser::operator[] | ( | size_t | idx | ) | const [inline] |
Return the content of a field by its index.
References lookup().
std::string ept::apt::RecordParser::record | ( | ) | [inline] |
Return the entire record.
const std::string& ept::apt::RecordParser::record | ( | ) | const [inline] |
Return the entire record.
Referenced by TestAptRecordparser::parsing().
void ept::apt::RecordParser::scan | ( | const std::string & | str | ) |
Index a new record.
Referenced by RecordParser(), and TestAptRecordparser::rescan().
size_t ept::apt::RecordParser::size | ( | ) | const [inline] |
Return the number of fields in the record.
Referenced by TestAptRecordparser::bufferTermination(), TestAptRecordparser::bufferTermination2(), TestAptRecordparser::bufferTermination3(), index(), TestAptRecordparser::parsing(), TestAptRecordparser::realLife(), TestAptRecordparser::rescan(), and TestAptPackagerecord::supportedFields().