xapian-core  1.4.26
Classes | Namespaces | Macros | Functions
pretty.h File Reference

Convert types to pretty representations. More...

#include <list>
#include <map>
#include <ostream>
#include <string>
#include <vector>
#include "xapian/intrusive_ptr.h"
#include "xapian/types.h"
#include "backends/database.h"
+ Include dependency graph for pretty.h:

Go to the source code of this file.

Classes

struct  PrettyOStream< S >
 
struct  Literal
 

Namespaces

 Xapian
 The Xapian namespace contains public interfaces for the Xapian library.
 
 Xapian::Internal
 
 Glass
 

Macros

#define XAPIAN_PRETTY_AS_CLASSNAME(C)
 

Functions

template<class S , class T >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const T &t)
 Default is to output as std::ostream would. More...
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const Literal &t)
 Allow writing literal strings. More...
 
template<class S , class T >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const T *t)
 
template<class S , class T >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const T **t)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const void *t)
 
void write_ch (std::ostream &os, unsigned char ch)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const char *str)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const std::string &str)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, std::string &)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, std::string *)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, unsigned char ch)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, bool b)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, Xapian::termcount *p)
 
template<class S , typename T >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, std::list< T > &)
 
template<class S , typename T >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const std::list< T > &)
 
template<class S , typename K , typename V >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, std::map< K, V > *)
 
template<class S , typename K , typename V >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, std::map< K, V > &)
 
template<class S , typename K , typename V >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const std::map< K, V > &m)
 
template<class S , typename T >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const std::vector< T > &v)
 
template<class S , typename T , typename U >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const std::pair< T, U > &v)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const Xapian::Weight *p)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const RemoteConnection &)
 
template<class S >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, const Xapian::Database::Internal *p)
 
template<class S , class T >
PrettyOStream< S > & operator<< (PrettyOStream< S > &ps, Xapian::Internal::intrusive_ptr< const T > t)
 

Detailed Description

Convert types to pretty representations.

Definition in file pretty.h.

Macro Definition Documentation

◆ XAPIAN_PRETTY_AS_CLASSNAME

#define XAPIAN_PRETTY_AS_CLASSNAME (   C)
Value:
template<class S>\
operator<<(PrettyOStream<S> &ps, const C &) {\
ps.os << #C;\
return ps;\
}
#define C(X)

Definition at line 295 of file pretty.h.

Function Documentation

◆ operator<<() [1/23]

template<class S , class T >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const T &  t 
)
inline

Default is to output as std::ostream would.

Definition at line 54 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [2/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const Literal t 
)
inline

Allow writing literal strings.

For example:

PrettyOStream<std::ostream> ps(std::cout); ps << Literal("x = ") << x << Literal(", y = ") << y << endl;

Definition at line 69 of file pretty.h.

References Literal::_lit.

◆ operator<<() [3/23]

template<class S , class T >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const T **  t 
)
inline

Definition at line 89 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [4/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const void *  t 
)
inline

Definition at line 97 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [5/23]

template<class S , class T >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const T *  t 
)
inline

Definition at line 77 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [6/23]

template<class S , typename T , typename U >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const std::pair< T, U > &  v 
)
inline

Definition at line 264 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [7/23]

template<class S , typename T >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const std::vector< T > &  v 
)
inline

Definition at line 256 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [8/23]

template<class S , typename K , typename V >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const std::map< K, V > &  m 
)
inline

Definition at line 248 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [9/23]

template<class S , typename K , typename V >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
std::map< K, V > &   
)
inline

Definition at line 241 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [10/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const RemoteConnection  
)
inline

Definition at line 332 of file pretty.h.

◆ operator<<() [11/23]

template<class S , typename T >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const std::list< T > &   
)
inline

Definition at line 226 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [12/23]

template<class S , typename T >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
std::list< T > &   
)
inline

Definition at line 219 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [13/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
Xapian::termcount p 
)
inline

Definition at line 211 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [14/23]

template<class S , class T >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
Xapian::Internal::intrusive_ptr< const T >  t 
)
inline

Definition at line 348 of file pretty.h.

References Xapian::Internal::intrusive_ptr< T >::get().

◆ operator<<() [15/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
unsigned char  ch 
)
inline

Definition at line 167 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [16/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
std::string *   
)
inline

Definition at line 159 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [17/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
std::string &   
)
inline

Definition at line 151 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [18/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const std::string &  str 
)
inline

Definition at line 139 of file pretty.h.

References Xapian::Internal::str(), and write_ch().

◆ operator<<() [19/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const char *  str 
)
inline

Definition at line 127 of file pretty.h.

References Xapian::Internal::str(), and write_ch().

◆ operator<<() [20/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
bool  b 
)
inline

Definition at line 193 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [21/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const Xapian::Database::Internal p 
)
inline

Definition at line 341 of file pretty.h.

◆ operator<<() [22/23]

template<class S , typename K , typename V >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
std::map< K, V > *   
)
inline

Definition at line 234 of file pretty.h.

References PrettyOStream< S >::os.

◆ operator<<() [23/23]

template<class S >
PrettyOStream<S>& operator<< ( PrettyOStream< S > &  ps,
const Xapian::Weight p 
)
inline

Definition at line 323 of file pretty.h.

◆ write_ch()

void write_ch ( std::ostream &  os,
unsigned char  ch 
)
inline

Definition at line 105 of file pretty.h.

Referenced by operator<<().