summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CPlusPlusUtil.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2007-05-02 19:10:37 +0000
committerDwayne Boone <dwayne@zeroc.com>2007-05-02 19:10:37 +0000
commit86839148a2cfe69ad748cc89bb9911b7ac1762b7 (patch)
tree43b5bf2e51260241ae6860764ca97e9bf6c16c6d /cpp/src/Slice/CPlusPlusUtil.cpp
parentRemoving JDK 1.1.8 code from the makedist.py script. (diff)
downloadice-86839148a2cfe69ad748cc89bb9911b7ac1762b7.tar.bz2
ice-86839148a2cfe69ad748cc89bb9911b7ac1762b7.tar.xz
ice-86839148a2cfe69ad748cc89bb9911b7ac1762b7.zip
MAke wstring optional for IceE
Diffstat (limited to 'cpp/src/Slice/CPlusPlusUtil.cpp')
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 39deb8bfe80..8c82abfb095 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -13,6 +13,8 @@ using namespace std;
using namespace Slice;
using namespace IceUtil;
+bool Slice::wstringDisabled = false;
+
char
Slice::ToIfdef::operator()(char c)
{
@@ -168,7 +170,7 @@ Slice::typeToString(const TypePtr& type, bool useWstring, const StringList& meta
if(builtin->kind() == Builtin::KindString)
{
string strType = findMetaData(metaData, true);
- if(strType != "string" && (useWstring || strType == "wstring"))
+ if(!wstringDisabled && strType != "string" && (useWstring || strType == "wstring"))
{
return "::std::wstring";
}
@@ -302,7 +304,7 @@ Slice::inputTypeToString(const TypePtr& type, bool useWstring, const StringList&
if(builtin->kind() == Builtin::KindString)
{
string strType = findMetaData(metaData, true);
- if(strType != "string" && (useWstring || strType == "wstring"))
+ if(!wstringDisabled && strType != "string" && (useWstring || strType == "wstring"))
{
return "const ::std::wstring&";
}
@@ -411,7 +413,7 @@ Slice::outputTypeToString(const TypePtr& type, bool useWstring, const StringList
if(builtin->kind() == Builtin::KindString)
{
string strType = findMetaData(metaData, true);
- if(strType != "string" && (useWstring || strType == "wstring"))
+ if(!wstringDisabled && strType != "string" && (useWstring || strType == "wstring"))
{
return "::std::wstring&";
}
@@ -1193,7 +1195,7 @@ Slice::writeStreamMarshalUnmarshalCode(Output& out, const TypePtr& type, const s
case Builtin::KindString:
{
string strType = findMetaData(metaData, true);
- if(strType != "string" && (useWstring || strType == "wstring"))
+ if(!wstringDisabled && strType != "string" && (useWstring || strType == "wstring"))
{
if(marshal)
{
@@ -1424,7 +1426,7 @@ Slice::writeStreamMarshalUnmarshalCode(Output& out, const TypePtr& type, const s
case Builtin::KindString:
{
string strType = findMetaData(seq->typeMetaData(), true);
- if(strType != "string" && (useWstring || strType == "wstring"))
+ if(!wstringDisabled && strType != "string" && (useWstring || strType == "wstring"))
{
if(marshal)
{
@@ -1573,6 +1575,11 @@ Slice::findMetaData(const StringList& metaData, bool inParam)
bool
Slice::inWstringModule(const SequencePtr& seq)
{
+ if(wstringDisabled)
+ {
+ return false;
+ }
+
ContainerPtr cont = seq->container();
while(cont)
{