684a480fb2631f26f0ae454becce433e39c89b95
1 /********************* */
4 ** Original author: Tianyi Liang
5 ** Major contributors: none
6 ** Minor contributors (to current version): Morgan Deters
7 ** This file is part of the CVC4 project.
8 ** Copyright (c) 2009-2013 New York University and The University of Iowa
9 ** See the file COPYING in the top-level source directory for licensing
10 ** information.\endverbatim
12 ** \brief [[ Add one-line brief description here ]]
14 ** [[ Add lengthier description here ]]
15 ** \todo document this file
18 #include "util/regexp.h"
26 std::string
String::toString() const {
28 for(unsigned int i
=0; i
<d_str
.size(); ++i
) {
29 char c
= convertUnsignedIntToChar( d_str
[i
] );
33 } else if(c
== '\"') {
41 case '\a': s
= "\\a"; break;
42 case '\b': s
= "\\b"; break;
43 case '\t': s
= "\\t"; break;
44 case '\r': s
= "\\r"; break;
45 case '\v': s
= "\\v"; break;
46 case '\f': s
= "\\f"; break;
47 case '\n': s
= "\\n"; break;
48 case '\e': s
= "\\e"; break;
51 ss
<< std::setfill ('0') << std::setw(2) << std::hex
<< ((int)c
);
53 //std::string s2 = static_cast<std::ostringstream*>( &(std::ostringstream() << (int)c) )->str();
62 std::ostream
& operator <<(std::ostream
& os
, const String
& s
) {
63 return os
<< "\"" << s
.toString() << "\"";
66 std::ostream
& operator<<(std::ostream
& out
, const RegExp
& s
) {
67 return out
<< "regexp(" << s
.getType() << ')';