2 #ifndef EPT_CORE_APT_RECORDPARSER_H
3 #define EPT_CORE_APT_RECORDPARSER_H
46 std::vector<size_t> ends;
49 std::vector<size_t> sorted;
56 void scan(
const std::string& str);
63 size_t index(
const std::string& str)
const;
66 std::string
field(
size_t idx)
const;
69 std::string
name(
size_t idx)
const;
72 std::string
lookup(
size_t idx)
const;
84 const std::string&
record()
const {
return buffer; }
87 std::string
record() {
return buffer; }
90 size_t size()
const {
return ends.size(); }
size_t index(const std::string &str) const
Get the index of the field with the given name.
Definition: recordparser.cpp:146
std::string operator[](const std::string &name) const
Return the content of a field by its name.
Definition: core/apt/recordparser.h:81
RecordParser(const std::string &str)
Definition: core/apt/recordparser.h:53
RecordParser()
Definition: core/apt/recordparser.h:52
std::string field(size_t idx) const
Return the field by its index.
Definition: recordparser.cpp:111
void scan(const std::string &str)
Index a new record.
Definition: recordparser.cpp:46
const std::string & record() const
Return the entire record.
Definition: core/apt/recordparser.h:84
Access the fields of a package record contained inside a std::string.
Definition: core/apt/recordparser.h:40
std::string operator[](size_t idx) const
Return the content of a field by its index.
Definition: core/apt/recordparser.h:78
std::string record()
Return the entire record.
Definition: core/apt/recordparser.h:87
std::string lookup(size_t idx) const
Return the content of a field by its index.
Definition: recordparser.cpp:130
size_t size() const
Return the number of fields in the record.
Definition: core/apt/recordparser.h:90
std::string name(size_t idx) const
Return the name of a field by its index.
Definition: recordparser.cpp:121
std::string lookup(const std::string &name) const
Return the content of a field by its name.
Definition: core/apt/recordparser.h:75