xapian-core  1.4.21
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 >
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 288 of file pretty.h.

Function Documentation

◆ operator<<() [1/22]

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/22]

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/22]

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/22]

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/22]

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/22]

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<<() [7/22]

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<<() [8/22]

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<<() [9/22]

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<<() [10/22]

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<<() [11/22]

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<<() [12/22]

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<<() [13/22]

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

Definition at line 325 of file pretty.h.

◆ operator<<() [14/22]

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<<() [15/22]

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<<() [16/22]

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<<() [17/22]

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

Definition at line 341 of file pretty.h.

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

◆ operator<<() [18/22]

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<<() [19/22]

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<<() [20/22]

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

Definition at line 334 of file pretty.h.

◆ operator<<() [21/22]

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<<() [22/22]

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

Definition at line 316 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<<().