57 _bytestream.str(d._bytestream.str());
67 std::string bytes = _bytestream.str();
68 const char *bytebegin = bytes.c_str();
69 const char *bytepos = bytebegin;
70 const char *byteend = bytebegin + bytes.length() + 1;
72 if (bytes.length() <= 0)
throw EntryNotFoundException();
74 while (bytepos < byteend)
76 std::string dictstr(bytepos);
80 return bytepos - bytebegin;
83 bytepos += dictstr.length() + 1;
86 throw EntryNotFoundException();
89 bool Dictionary::exists(
const std::string &value)
const
91 std::string bytes = _bytestream.str();
92 const char *bytepos = bytes.c_str();
93 const char *byteend = bytepos + bytes.length();
95 if (bytes.length() <= 0)
return false;
97 while (bytepos < byteend)
99 std::string dictstr(bytepos);
101 if (dictstr == value)
106 bytepos += dictstr.length() + 1;
116 _bytestream << value <<
'\0';
128 list<EID>::const_iterator iter = eids.begin();
130 while (iter != eids.end())
148 const Block &b = (**iter);
157 _bytestream.seekg(scheme.
get<std::streampos>());
158 _bytestream.get(buffer, 1024,
'\0');
159 std::string scheme_str(buffer);
161 _bytestream.seekg(ssp.
get<std::streampos>());
162 _bytestream.get(buffer, 1024,
'\0');
163 std::string ssp_str(buffer);
165 return EID(scheme_str, ssp_str);
175 return _bytestream.str().length();
180 const std::string scheme = eid.
getScheme();
181 const std::string ssp = eid.
getSSP();
182 return make_pair(
get(scheme),
get(ssp));
189 stream << obj._bytestream.str();
203 obj._bytestream.str(
"");
204 std::vector<char> data(length.get<
size_t>());
205 stream.read(&data[0], data.size());
206 obj._bytestream.write(&data[0], data.size());