1 #ifndef PACK_STRING__HPP_INCLUDED
2 #define PACK_STRING__HPP_INCLUDED
57 : m_Length(
n.m_Length),
71 return memcmp(m_Chars, ptr, m_Length);
76 return m_Length <
n.m_Length ||
77 (m_Length ==
n.m_Length && x_Compare(
n.m_Chars) < 0);
81 return m_Length ==
n.m_Length && x_Compare(
n.m_Chars) == 0;
84 void AssignTo(
string& s)
const;
86 void SetString(
const string& s)
const;
87 void SetString(
void)
const;
95 return m_CompressedIn;
114 static bool Assign(
string& s,
const string& src);
116 size_t GetLengthLimit(
void)
const;
117 size_t GetCountLimit(
void)
const;
118 size_t GetCount(
void)
const;
121 bool Pack(
string& s);
124 pair<iterator, bool> Locate(
const char*
data,
size_t size);
125 void AddOld(
string& s,
const iterator& iter);
129 static bool s_GetEnvFlag(
const char*
env,
bool def_val);
131 static bool TryStringPack(
void);
139 static void x_RefCounterError(
void);
141 static bool x_Assign(
string& s,
const string& src);
209 if ( s.data() != src.data() ) {
232 _ASSERT(s.size() == m_Length && x_Compare(s.data()) == 0);
233 const_cast<SNode*
>(
this)->m_String = s;
234 const_cast<SNode*
>(
this)->m_Chars = m_String.data();
242 const_cast<SNode*
>(
this)->m_String.assign(m_Chars, m_Length);
243 const_cast<SNode*
>(
this)->m_Chars = m_String.data();
250 in.ReadPackedString(s, *
this);
255 pair<CPackString::iterator, bool>
258 pair<iterator, bool> ret;
void x_Assign(CObject_id &dst, const CObject_id &src)
void ReadString(CStreamBuffer &b)
void ReadChoiceVariant(CObjectIStream &in, const CObjectInfoCV &variant)
This method will be called at approriate time when the object of requested type is to be read.
void ReadClassMember(CObjectIStream &in, const CObjectInfoMI &member)
This method will be called at approriate time when the object of requested type is to be read.
void ReadString(CObjectIStream &in, string &s)
size_t GetLengthLimit(void) const
static bool Assign(string &s, const string &src)
pair< iterator, bool > Locate(const char *data, size_t size)
CPackString(const CPackString &)
static bool x_Assign(string &s, const string &src)
size_t GetCountLimit(void) const
void AddOld(string &s, const iterator &iter)
size_t GetCount(void) const
TStrings::iterator iterator
CPackString & operator=(const CPackString &)
CNcbiOstream & DumpStatistics(CNcbiOstream &out) const
Read hook for a choice variant (CHOICE)
Read hook for data member of a containing object (eg, SEQUENCE)
parent_type::iterator iterator
const_iterator end() const
const_iterator lower_bound(const key_type &key) const
std::ofstream out("events_result.xml")
main entry point for tests
static const char * str(char *buf, int n)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
#define NCBI_XSERIAL_EXPORT
static string Pack(const string &s)
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
std::istream & in(std::istream &in_, double &x_)
CNcbiOstream & operator<<(CNcbiOstream &out, const CPackString &pack_string)
size_t GetCount(void) const
bool operator==(const SNode &n) const
SNode(const char *str, size_t len)
void AssignTo(string &s) const
const string & GetString(void) const
int x_Compare(const char *ptr) const
SNode & operator=(const SNode &)
bool operator<(const SNode &n) const
void SetString(void) const