aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx/parser
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-02-22 15:35:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-02-22 15:35:57 +0200
commit214e61b8334751a34f7522c609b939f4bc667881 (patch)
treef87fa89875cc4b0fd71fd2e2621e8f93ea9a3a73 /xsd/cxx/parser
parentc3044ef3bffa360b9cfe41689499888847a02e9d (diff)
Reopen wide strings with width specifier (L)
Some compilers, notably VC++, don't like strings like L"foo""bar".
Diffstat (limited to 'xsd/cxx/parser')
-rw-r--r--xsd/cxx/parser/attribute-validation-source.cxx14
-rw-r--r--xsd/cxx/parser/driver-source.cxx6
-rw-r--r--xsd/cxx/parser/element-validation-source.cxx24
-rw-r--r--xsd/cxx/parser/impl-source.cxx2
-rw-r--r--xsd/cxx/parser/parser-source.cxx42
-rw-r--r--xsd/cxx/parser/print-impl-common.hxx60
6 files changed, 74 insertions, 74 deletions
diff --git a/xsd/cxx/parser/attribute-validation-source.cxx b/xsd/cxx/parser/attribute-validation-source.cxx
index 0503d78..2c57f2a 100644
--- a/xsd/cxx/parser/attribute-validation-source.cxx
+++ b/xsd/cxx/parser/attribute-validation-source.cxx
@@ -32,11 +32,11 @@ namespace CXX
{
String const& ns (a.namespace_ ().name ());
- os << "n == " << L << strlit (name) << " &&" << endl
- << "ns == " << L << strlit (ns);
+ os << "n == " << strlit (name) << " &&" << endl
+ << "ns == " << strlit (ns);
}
else
- os << "n == " << L << strlit (name) << " && ns.empty ()";
+ os << "n == " << strlit (name) << " && ns.empty ()";
}
virtual Void
@@ -60,7 +60,7 @@ namespace CXX
// This is not what the spec says but that seems to be
// the consensus.
//
- os << "(!ns.empty () && ns != " << L << strlit (ns) << ")";
+ os << "(!ns.empty () && ns != " << strlit (ns) << ")";
}
else
os << "!ns.empty ()";
@@ -71,11 +71,11 @@ namespace CXX
}
else if (*i == L"##targetNamespace")
{
- os << "ns == " << L << strlit (ns);
+ os << "ns == " << strlit (ns);
}
else
{
- os << "ns == " << L << strlit (*i);
+ os << "ns == " << strlit (*i);
}
if (++i != e)
@@ -204,7 +204,7 @@ namespace CXX
os << "if (!as." << ename (a) << ")" << endl
<< "this->_expected_attribute (" << endl
- << L << strlit (ns) << ", " << L << strlit (a.name ()) << ");";
+ << strlit (ns) << ", " << strlit (a.name ()) << ");";
}
}
};
diff --git a/xsd/cxx/parser/driver-source.cxx b/xsd/cxx/parser/driver-source.cxx
index c410ccc..b48b0e0 100644
--- a/xsd/cxx/parser/driver-source.cxx
+++ b/xsd/cxx/parser/driver-source.cxx
@@ -718,12 +718,12 @@ namespace CXX
if (root->namespace_().name ())
os << ctx.xs_ns_name () << "::document doc_p (" << endl
<< root_p << "," << endl
- << L << ctx.strlit (root->namespace_().name ()) << "," << endl
- << L << ctx.strlit (root->name ()) << ");"
+ << ctx.strlit (root->namespace_().name ()) << "," << endl
+ << ctx.strlit (root->name ()) << ");"
<< endl;
else
os << ctx.xs_ns_name () << "::document doc_p (" << root_p << ", " <<
- L << ctx.strlit (root->name ()) << ");"
+ ctx.strlit (root->name ()) << ");"
<< endl;
os << root_p << ".pre ();"
diff --git a/xsd/cxx/parser/element-validation-source.cxx b/xsd/cxx/parser/element-validation-source.cxx
index bc4f3c4..df701e9 100644
--- a/xsd/cxx/parser/element-validation-source.cxx
+++ b/xsd/cxx/parser/element-validation-source.cxx
@@ -43,11 +43,11 @@ namespace CXX
{
String const& ns (e.namespace_ ().name ());
- os << "n == " << L << strlit (name) << " &&" << endl
- << "ns == " << L << strlit (ns);
+ os << "n == " << strlit (name) << " &&" << endl
+ << "ns == " << strlit (ns);
}
else
- os << "n == " << L << strlit (name) << " && ns.empty ()";
+ os << "n == " << strlit (name) << " && ns.empty ()";
// Only a globally-defined element can be a subst-group root.
@@ -57,8 +57,8 @@ namespace CXX
os << ") ||" << endl
<< "::xsd::cxx::parser::substitution_map_instance< " <<
char_type << " > ().check (" << endl
- << "ns, n, " << L << strlit (e.namespace_ ().name ()) <<
- ", " << L << strlit (name) << ", t)";
+ << "ns, n, " << strlit (e.namespace_ ().name ()) <<
+ ", " << strlit (name) << ", t)";
}
}
@@ -86,7 +86,7 @@ namespace CXX
// This is not what the spec says but that seems to be
// the consensus.
//
- os << "(!ns.empty () && ns != " << L << strlit (ns) << ")";
+ os << "(!ns.empty () && ns != " << strlit (ns) << ")";
}
else
os << "!ns.empty ()";
@@ -97,11 +97,11 @@ namespace CXX
}
else if (*i == L"##targetNamespace")
{
- os << "ns == " << L << strlit (ns);
+ os << "ns == " << strlit (ns);
}
else
{
- os << "ns == " << L << strlit (*i);
+ os << "ns == " << strlit (*i);
}
if (++i != e)
@@ -154,14 +154,14 @@ namespace CXX
traverse (SemanticGraph::Element& e)
{
String ns (e.qualified () ? e.namespace_ ().name () : String ());
- os << L << strlit (ns) << ", " << L << strlit (e.name ());
+ os << strlit (ns) << ", " << strlit (e.name ());
}
virtual Void
traverse (SemanticGraph::Any& a)
{
String const& ns (*a.namespace_begin ());
- os << L << strlit (ns) << ", " << L << "\"*\"";
+ os << strlit (ns) << ", " << L << "\"*\"";
}
virtual Void
@@ -882,8 +882,8 @@ namespace CXX
os << "if (count[" << state << "UL] == 0)" << endl
<< "this->_expected_element (" << endl
- << L << strlit (ns) << ", " <<
- L << strlit (e.name ()) << ");"
+ << strlit (ns) << ", " <<
+ strlit (e.name ()) << ");"
<< endl;
}
diff --git a/xsd/cxx/parser/impl-source.cxx b/xsd/cxx/parser/impl-source.cxx
index 7548942..b951f6a 100644
--- a/xsd/cxx/parser/impl-source.cxx
+++ b/xsd/cxx/parser/impl-source.cxx
@@ -187,7 +187,7 @@ namespace CXX
<< "{";
if (options.value<CLI::generate_print_impl> ())
- os << cout_inst << " << " << L << strlit (u.name () + L": ") <<
+ os << cout_inst << " << " << strlit (u.name () + L": ") <<
" << s << std::endl;";
else
os << "// TODO" << endl
diff --git a/xsd/cxx/parser/parser-source.cxx b/xsd/cxx/parser/parser-source.cxx
index 68623be..339bb6f 100644
--- a/xsd/cxx/parser/parser-source.cxx
+++ b/xsd/cxx/parser/parser-source.cxx
@@ -68,7 +68,7 @@ namespace CXX
os << "const " << char_type << "* " << name << "::" << endl
<< "_static_type ()"
<< "{"
- << "return " << L << strlit (id) << ";"
+ << "return " << strlit (id) << ";"
<< "}";
os << "const " << char_type << "* " << name << "::" << endl
@@ -201,7 +201,7 @@ namespace CXX
os << "const " << char_type << "* " << name << "::" << endl
<< "_static_type ()"
<< "{"
- << "return " << L << strlit (id) << ";"
+ << "return " << strlit (id) << ";"
<< "}";
os << "const " << char_type << "* " << name << "::" << endl
@@ -256,7 +256,7 @@ namespace CXX
os << "const " << char_type << "* " << name << "::" << endl
<< "_static_type ()"
<< "{"
- << "return " << L << strlit (id) << ";"
+ << "return " << strlit (id) << ";"
<< "}";
os << "const " << char_type << "* " << name << "::" << endl
@@ -294,12 +294,12 @@ namespace CXX
if (e.qualified () && e.namespace_ ().name ())
{
- os << "n == " << L << strlit (e.name ()) << " && " <<
- "ns == " << L << strlit (e.namespace_ ().name ());
+ os << "n == " << strlit (e.name ()) << " && " <<
+ "ns == " << strlit (e.namespace_ ().name ());
}
else
{
- os << "n == " << L << strlit (e.name ()) << " && ns.empty ()";
+ os << "n == " << strlit (e.name ()) << " && ns.empty ()";
}
// Only a globally-defined element can be a subst-group root.
@@ -309,8 +309,8 @@ namespace CXX
os << ") ||" << endl
<< "::xsd::cxx::parser::substitution_map_instance< " <<
char_type << " > ().check (" << endl
- << "ns, n, " << L << strlit (e.namespace_ ().name ()) <<
- ", " << L << strlit (e.name ()) << ", t)";
+ << "ns, n, " << strlit (e.namespace_ ().name ()) <<
+ ", " << strlit (e.name ()) << ", t)";
}
os << ")"
@@ -394,12 +394,12 @@ namespace CXX
if (e.qualified () && e.namespace_ ().name ())
{
- os << "n == " << L << strlit (e.name ()) << " && " <<
- "ns == " << L << strlit (e.namespace_ ().name ());
+ os << "n == " << strlit (e.name ()) << " && " <<
+ "ns == " << strlit (e.namespace_ ().name ());
}
else
{
- os << "n == " << L << strlit (e.name ()) << " && ns.empty ()";
+ os << "n == " << strlit (e.name ()) << " && ns.empty ()";
}
// Only a globally-defined element can be a subst-group root.
@@ -409,8 +409,8 @@ namespace CXX
os << ") ||" << endl
<< "::xsd::cxx::parser::substitution_map_instance< " <<
char_type << " > ().check (" << endl
- << "ns, n, " << L << strlit (e.namespace_ ().name ()) <<
- ", " << L << strlit (e.name ()) << ")";
+ << "ns, n, " << strlit (e.namespace_ ().name ()) <<
+ ", " << strlit (e.name ()) << ")";
}
os << ")"
@@ -457,13 +457,13 @@ namespace CXX
if (a.qualified () && a.namespace_ ().name ())
{
- os << "if (n == " << L << strlit (a.name ()) << " && " <<
- "ns == " << L << strlit (a.namespace_ ().name ()) << ")"
+ os << "if (n == " << strlit (a.name ()) << " && " <<
+ "ns == " << strlit (a.namespace_ ().name ()) << ")"
<< "{";
}
else
{
- os << "if (n == " << L << strlit (a.name ()) << " && ns.empty ())"
+ os << "if (n == " << strlit (a.name ()) << " && ns.empty ())"
<< "{";
}
@@ -570,7 +570,7 @@ namespace CXX
os << "const " << char_type << "* " << name << "::" << endl
<< "_static_type ()"
<< "{"
- << "return " << L << strlit (id) << ";"
+ << "return " << strlit (id) << ";"
<< "}";
os << "const " << char_type << "* " << name << "::" << endl
@@ -798,10 +798,10 @@ namespace CXX
<< "const ::xsd::cxx::parser::substitution_map_entry< " <<
char_type << " >" << endl
<< "_xsd_" << name << "_substitution_map_entry_ (" << endl
- << L << strlit (e.namespace_ ().name ()) << "," << endl
- << L << strlit (e.name ()) << "," << endl
- << L << strlit (r.namespace_ ().name ()) << "," << endl
- << L << strlit (r.name ()) << "," << endl
+ << strlit (e.namespace_ ().name ()) << "," << endl
+ << strlit (e.name ()) << "," << endl
+ << strlit (r.namespace_ ().name ()) << "," << endl
+ << strlit (r.name ()) << "," << endl
<< fq_name (type) << "::_static_type ());"
<< endl;
}
diff --git a/xsd/cxx/parser/print-impl-common.hxx b/xsd/cxx/parser/print-impl-common.hxx
index f7bea51..5a91931 100644
--- a/xsd/cxx/parser/print-impl-common.hxx
+++ b/xsd/cxx/parser/print-impl-common.hxx
@@ -87,7 +87,7 @@ namespace CXX
{
if (default_type (t, "bool"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -101,7 +101,7 @@ namespace CXX
{
if (default_type (t, "signed char"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") <<
" << static_cast<short> (" << arg_ << ") << std::endl;";
}
else
@@ -113,7 +113,7 @@ namespace CXX
{
if (default_type (t, "unsigned char"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") <<
" << static_cast<unsigned short> (" << arg_ << ") << std::endl;";
}
else
@@ -125,7 +125,7 @@ namespace CXX
{
if (default_type (t, "short"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -137,7 +137,7 @@ namespace CXX
{
if (default_type (t, "unsigned short"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -149,7 +149,7 @@ namespace CXX
{
if (default_type (t, "int"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -161,7 +161,7 @@ namespace CXX
{
if (default_type (t, "unsigned int"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -173,7 +173,7 @@ namespace CXX
{
if (default_type (t, "long long"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -185,7 +185,7 @@ namespace CXX
{
if (default_type (t, "unsigned long long"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -197,7 +197,7 @@ namespace CXX
{
if (default_type (t, "long long"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -209,7 +209,7 @@ namespace CXX
{
if (default_type (t, "long long"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -221,7 +221,7 @@ namespace CXX
{
if (default_type (t, "long long"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -233,7 +233,7 @@ namespace CXX
{
if (default_type (t, "unsigned long long"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -245,7 +245,7 @@ namespace CXX
{
if (default_type (t, "unsigned long long"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -259,7 +259,7 @@ namespace CXX
{
if (default_type (t, "float"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -271,7 +271,7 @@ namespace CXX
{
if (default_type (t, "double"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -283,7 +283,7 @@ namespace CXX
{
if (default_type (t, "double"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -375,7 +375,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::qname"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << ";"
+ os << cout_inst << " << " << strlit (tag_ + L": ") << ";"
<< endl
<< "if (" << arg_ << ".prefix ().empty ())" << endl
<< cout_inst << " << " << arg_ << ".name ();"
@@ -410,7 +410,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::date"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << endl
+ os << cout_inst << " << " << strlit (tag_ + L": ") << endl
<< " << " << arg_ << ".year () << '-'" << endl
<< " << " << arg_ << ".month () << '-'" << endl
<< " << " << arg_ << ".day ();";
@@ -426,7 +426,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::date_time"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << endl
+ os << cout_inst << " << " << strlit (tag_ + L": ") << endl
<< " << " << arg_ << ".year () << '-'" << endl
<< " << " << arg_ << ".month () << '-'" << endl
<< " << " << arg_ << ".day () << 'T'" << endl
@@ -445,7 +445,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::duration"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << ";"
+ os << cout_inst << " << " << strlit (tag_ + L": ") << ";"
<< endl
<< "if (" << arg_ << ".negative ())" << endl
<< cout_inst << " << '-';"
@@ -468,7 +468,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::gday"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ---") <<
+ os << cout_inst << " << " << strlit (tag_ + L": ---") <<
" << " << arg_ << ".day ();";
gen_time_zone ();
@@ -482,7 +482,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::gmonth"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": --") <<
+ os << cout_inst << " << " << strlit (tag_ + L": --") <<
" << " << arg_ << ".month ();";
gen_time_zone ();
@@ -496,7 +496,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::gmonth_day"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": --") << endl
+ os << cout_inst << " << " << strlit (tag_ + L": --") << endl
<< " << " << arg_ << ".month () << '-'" << endl
<< " << " << arg_ << ".day ();";
@@ -511,7 +511,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::gyear"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << ".year ();";
gen_time_zone ();
@@ -525,7 +525,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::gyear_month"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << endl
+ os << cout_inst << " << " << strlit (tag_ + L": ") << endl
<< " << " << arg_ << ".year () << '-'" << endl
<< " << " << arg_ << ".month ();";
@@ -540,7 +540,7 @@ namespace CXX
{
if (default_type (t, xs_ns_name () + L"::time"))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << endl
+ os << cout_inst << " << " << strlit (tag_ + L": ") << endl
<< " << " << arg_ << ".hours () << ':'" << endl
<< " << " << arg_ << ".minutes () << ':'" << endl
<< " << " << arg_ << ".seconds ();";
@@ -571,7 +571,7 @@ namespace CXX
if ((char_type == L"char" && default_type (t, "::std::string")) ||
(char_type == L"wchar_t" && default_type (t, "::std::wstring")))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << " <<
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << " <<
arg_ << " << std::endl;";
}
else
@@ -585,7 +585,7 @@ namespace CXX
if (default_type (t, type))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << ";"
+ os << cout_inst << " << " << strlit (tag_ + L": ") << ";"
<< endl;
os << "for (" << type << "::const_iterator i (" << arg_ <<
@@ -609,7 +609,7 @@ namespace CXX
if (default_type (t, type))
{
- os << cout_inst << " << " << L << strlit (tag_ + L": ") << " << "
+ os << cout_inst << " << " << strlit (tag_ + L": ") << " << "
<< arg_ << "->size () << " << L << "\" bytes\" << std::endl;";
}
else