MCPcopy Create free account
hub / github.com/davisking/dlib / print

Method print

dlib/cpp_pretty_printer/cpp_pretty_printer_kernel_2.h:127–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 typename tok
126 >
127 void cpp_pretty_printer_kernel_2<stack,tok>::
128 print (
129 std::istream& in,
130 std::ostream& out,
131 const std::string& title
132 ) const
133 {
134 if (!out)
135 throw std::ios::failure("error occurred in cpp_pretty_printer_kernel_2::print");
136
137 t.set_stream(in);
138
139 out << "<html><!-- "
140 << "Created using the cpp_pretty_printer from the dlib C++ library. See http://dlib.net for updates."
141 << " --><head>"
142 << "<title>" << title << "</title></head><body bgcolor='white'>"
143 << "<h1><center>" << title << "</center></h1><pre>\n"
144 << "<font style='font-size:9pt' face='Lucida Console'>\n";
145 if (!out)
146 throw std::ios::failure("error occurred in cpp_pretty_printer_kernel_2::print");
147
148 unsigned long scope = 0; // counts the number of new scopes we have entered
149 // since we were at a scope where functions can be declared
150
151 bool recently_seen_class_keyword = false;
152 // true if we have seen the keywords class or struct and
153 // we have not seen any identifiers or { characters
154
155 bool recently_seen_include = false;
156 // true if we have seen the #include keyword and have not seen double
157 // quoted text or >
158
159 bool recently_seen_new_scope = false;
160 // true if we have seen the keywords class, namespace, or struct and
161 // we have not seen the characters {, ), or ; since then
162
163 bool recently_seen_paren = false;
164 // true if we have seen a ) and we have only seen white_space or comments since
165
166 bool in_initialization_list = false;
167 // true if we have seen a ) followed by any white space or comments and then
168 // followed by a : (in scope==0 with recently_seen_preprocessor==false) and we
169 // have not yet seen the character { or ;
170
171 bool recently_seen_preprocessor = false;
172 // true if we have seen the #pragma or #if or #define or #elif keyword and
173 // have not seen an identifier.
174
175
176 bool recently_seen_extern = false;
177 // true if we have seen the extern keyword and haven't yet seen a
178 // { or ; character.
179
180 unsigned long paren_count = 0;
181 // this is the number of ( we have seen minus the number of ) we have
182 // seen.
183
184

Callers

nothing calls this directly

Calls 5

htmlifyFunction · 0.85
clearMethod · 0.45
pushMethod · 0.45
sizeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected