21 #ifndef XAPIAN_INCLUDED_PRETTY_H
22 #define XAPIAN_INCLUDED_PRETTY_H
28 #include <string_view>
55 template<
class S,
class T>
78 template<
class S,
class T>
90 template<
class S,
class T>
102 ps.
os <<
"(void*)" << t;
108 inline void write_ch(std::ostream & os,
unsigned char ch)
110 if (ch < 32 || ch >= 127) {
112 if (ch >= 7 && ch <= 13) {
113 os <<
"abtnvfr"[ch - 7];
115 os << char(
'0' | (ch >> 6));
116 os << char(
'0' | ((ch >> 3) & 7));
117 os << char(
'0' | (ch & 7));
119 }
else if (ch ==
'\\') {
121 }
else if (ch ==
'"') {
145 for (
char ch :
str) {
156 ps.
os <<
"std::string&";
164 ps.
os <<
"std::string*";
173 for (
char ch :
str) {
196 if (ch < 32 || ch >= 127) {
198 if (ch >= 7 && ch <= 13) {
199 ps.
os <<
"abtnvfr"[ch - 7];
200 }
else if (ch ==
'\0') {
203 ps.
os <<
"0123456789abcdef"[ch >> 4];
204 ps.
os <<
"0123456789abcdef"[ch & 0x0f];
206 }
else if (ch ==
'\\') {
208 }
else if (ch ==
'\'') {
221 ps.
os << (b ?
"true" :
"false");
239 ps.
os <<
"(Xapian::termcount*)" << (
void*)
p;
243 template<
class S,
typename T>
246 ps.
os <<
"std::list&";
250 template<
class S,
typename T>
253 ps.
os <<
"std::list";
258 template<
class S,
typename K,
typename V>
261 ps.
os <<
"std::map*";
265 template<
class S,
typename K,
typename V>
268 ps.
os <<
"std::map&";
272 template<
class S,
typename K,
typename V>
275 ps.
os <<
"std::map(" << m.size() <<
')';
280 template<
class S,
typename T>
283 ps.
os <<
"std::vector(" << v.size() <<
')';
288 template<
class S,
typename T>
291 ps.
os <<
"Vec(" << v.
size() <<
')';
296 template<
class S,
typename T>
299 ps.
os <<
"VecCOW(" << v.
size() <<
')';
304 template<
class S,
typename T,
typename U>
307 ps.
os <<
"std::pair(" << v.first <<
", " << v.second <<
')';
330 struct PostListAndEstimate;
345 #define XAPIAN_PRETTY_AS_CLASSNAME(C)\
347 inline PrettyOStream<S> &\
348 operator<<(PrettyOStream<S> &ps, const C &) {\
381 ps.
os <<
"(Xapian:Weight*)" << (
const void*)
p;
390 ps.
os <<
"RemoteConnection";
399 ps.
os <<
"(Database::Internal*)" << (
const void*)
p;
403 template<
class S,
class T>
406 ps.
os <<
"intrusive_ptr->";
407 return ps << t.
get();
A cursor pointing to a position in a Btree table, for reading several entries in order,...
A backend designed for efficient indexing and retrieval, using compressed posting lists and a btree s...
Class managing a Btree table in a Glass database.
A RemoteConnection object provides a bidirectional connection to another RemoteConnection object on a...
Class to represent cluster centroids in the vector space.
Class for storing the results returned by the Clusterer.
Class to represents a Cluster which contains Points and Centroid of the Cluster.
Virtual base class for Database internals.
Virtual base class for expand decider functor.
Base class for TermListGroup Stores and provides terms that are contained in a document and their res...
Collates statistics while calculating term weight in an ESet.
Class for calculating ESet term weights.
A smart pointer that uses intrusive reference counting.
Virtual base class for key making functors.
Base class for calculating distances between two lat/long coordinates.
Abstract base class for match deciders.
Abstract class representing a point in the VSM.
Class to represent a document as a point in the Vector Space Model.
Registry for user subclasses.
A class for construction of termlists which store the terms for a document along with the number of d...
Suitable for "simple" type T.
Abstract base class for weighting schemes.
Virtual base class for Database internals.
string str(int value)
Convert int to std::string.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
#define XAPIAN_PRETTY_AS_CLASSNAME(C)
PrettyOStream< S > & operator<<(PrettyOStream< S > &ps, const T &t)
Default is to output as std::ostream would.
void write_ch(std::ostream &os, unsigned char ch)
Custom vector implementations using small vector optimisation.
Literal(const std::string &s)
PrettyOStream & operator|(const T &t)
S & os
The std::ostream object we're outputting to.