PhoenixMock  1.8.7
Tools to split/merge/print mock used in Phoenix
print_string_impl.h
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #ifndef __PRINT_STRING_IMPL_H__
8 #define __PRINT_STRING_IMPL_H__
9 
10 #include "print_string.h"
11 
13 
17 template<typename T>
18 void phoenix_print(const T & data, const std::string& suffix, const std::string & prefix){
19  std::cout << prefix << data << suffix << std::endl;
20 }
21 
23 
27 template<typename T>
28 void phoenix_print(const std::list<T> & data, const std::string& suffix, const std::string & prefix){
29  for(typename std::list<T>::const_iterator it(data.begin()); it != data.end(); ++it){
30  std::cout << prefix << *it << suffix << std::endl;
31  }
32 }
33 
35 
39 template<typename T>
40 void phoenix_print(const std::vector<T> & data, const std::string& suffix, const std::string & prefix){
41  for(typename std::vector<T>::const_iterator it(data.begin()); it != data.end(); ++it){
42  std::cout << prefix << *it << suffix << std::endl;
43  }
44 }
45 
47 
51 template<typename T>
52 void phoenix_print(const std::vector<std::vector<T> > & data, const std::string& suffix, const std::string & prefix){
53  for(typename std::vector<std::vector<T> >::const_iterator it(data.begin()); it != data.end(); ++it){
54  phoenix_print(*it, suffix, prefix);
55  std::cout << std::endl;
56  }
57 }
58 
60 
64 template<typename T, typename U>
65 void phoenix_print(const std::map<T, U> & data, const std::string& suffix, const std::string & prefix){
66  for(typename std::map<T, U>::const_iterator it(data.begin()); it != data.end(); ++it){
67  std::cout << prefix << it->first << suffix << " => " << it->second << std::endl;
68  }
69 }
70 
72 
76 template<typename T, typename U>
77 void phoenix_print(const std::map<T, std::vector<U> > & data, const std::string& suffix, const std::string & prefix){
78  for(typename std::map<T, std::vector<U> >::const_iterator itEntry(data.begin()); itEntry != data.end(); ++itEntry){
79  std::cout << prefix << itEntry->first << " => ";
80 
81  for(typename std::vector<U>::const_iterator it(itEntry->second.begin()); it != itEntry->second.end(); ++it){
82  std::cout << *it << ", ";
83  }
84 
85  std::cout << suffix << std::endl;
86  }
87 }
88 
89 #endif
90 
print_string.h
phoenix_print
void phoenix_print(const T &data, const std::string &suffix, const std::string &prefix)
Print data.
Definition: print_string_impl.h:18