summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-09-17 05:06:11 +0000
committerMichi Henning <michi@zeroc.com>2002-09-17 05:06:11 +0000
commitd81ab8b62645973c7dd3868267eac0bb3b10b579 (patch)
tree00a3dbb9dd39c4e7dcc482136643c82d071a3d0f /cpp/src
parentModified AddUserToAllowCategories usage. (diff)
downloadice-d81ab8b62645973c7dd3868267eac0bb3b10b579.tar.bz2
ice-d81ab8b62645973c7dd3868267eac0bb3b10b579.tar.xz
ice-d81ab8b62645973c7dd3868267eac0bb3b10b579.zip
Added --case-sensitive option.
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Slice/Parser.cpp293
-rw-r--r--cpp/src/slice2cpp/Main.cpp13
-rw-r--r--cpp/src/slice2docbook/Main.cpp13
-rw-r--r--cpp/src/slice2freeze/Main.cpp13
-rw-r--r--cpp/src/slice2freezej/Main.cpp13
-rw-r--r--cpp/src/slice2java/Main.cpp13
-rw-r--r--cpp/src/slice2wsdl/Main.cpp13
-rw-r--r--cpp/src/slice2xsd/Main.cpp13
8 files changed, 261 insertions, 123 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index 09994110aca..fc0f1218235 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -242,18 +242,18 @@ Slice::Container::createModule(const string& name)
ModulePtr module = ModulePtr::dynamicCast(*p);
if(module)
{
- if(!differsOnlyInCase)
+ if(_unit->caseSensitive())
{
- continue; // Reopening modules is permissible...
+ continue; // Reopening modules is permissible...
}
- else // ... but only if they are capitalized correctly
+ else if(differsOnlyInCase) // ... but only if they are capitalized correctly
{
msg += "module `" + name + "' is capitalized inconsistently with its previous name: `";
msg += module->name() + "'";
_unit->error(msg);
}
}
- else if(differsOnlyInCase)
+ else if(!_unit->caseSensitive() && differsOnlyInCase)
{
msg = "module `" + name + "' differs only in capitalization from ";
msg += matches.front()->kindOf() + " name `" + matches.front()->name() + "'";
@@ -309,7 +309,7 @@ Slice::Container::createClassDef(const string& name, bool intf, const ClassList&
_unit->error(msg);
return 0;
}
- else
+ else if(!_unit->caseSensitive())
{
msg = intf ? "interface" : "class";
msg += " definition `" + name + "' is capitalized inconsistently with its previous name: `";
@@ -318,7 +318,7 @@ Slice::Container::createClassDef(const string& name, bool intf, const ClassList&
}
}
- if(differsOnlyInCase)
+ if(!_unit->caseSensitive() && differsOnlyInCase)
{
msg = intf ? "interface" : "class";
msg = " definition `" + name + "' differs only in capitalization from ";
@@ -394,7 +394,7 @@ Slice::Container::createClassDecl(const string& name, bool intf, bool local)
string msg;
bool differsOnlyInCase = matches.front()->name() != name;
- if(differsOnlyInCase)
+ if(!_unit->caseSensitive() && differsOnlyInCase)
{
msg = "class declaration `" + name + "' differs only in capitalization from ";
msg += matches.front()->kindOf() + " name `" + matches.front()->name() + "'";
@@ -466,9 +466,12 @@ Slice::Container::createException(const string& name, const ExceptionPtr& base,
_unit->error(msg);
return 0;
}
- msg = "exception `" + name + "' differs only in capitalization from ";
- msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
- _unit->error(msg);
+ else if(!_unit->caseSensitive())
+ {
+ msg = "exception `" + name + "' differs only in capitalization from ";
+ msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
+ _unit->error(msg);
+ }
}
//
@@ -509,9 +512,12 @@ Slice::Container::createStruct(const string& name, bool local)
_unit->error(msg);
return 0;
}
- msg = "struct `" + name + "' differs only in capitalization from ";
- msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
- _unit->error(msg);
+ if(!_unit->caseSensitive())
+ {
+ msg = "struct `" + name + "' differs only in capitalization from ";
+ msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
+ _unit->error(msg);
+ }
}
StructPtr p = new Struct(this, name, local);
@@ -543,9 +549,12 @@ Slice::Container::createSequence(const string& name, const TypePtr& type, bool l
_unit->error(msg);
return 0;
}
- msg = "sequence `" + name + "' differs only in capitalization from ";
- msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
- _unit->error(msg);
+ if(!_unit->caseSensitive())
+ {
+ msg = "sequence `" + name + "' differs only in capitalization from ";
+ msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
+ _unit->error(msg);
+ }
}
//
@@ -586,9 +595,12 @@ Slice::Container::createDictionary(const string& name, const TypePtr& keyType, c
_unit->error(msg);
return 0;
}
- msg = "dictionary `" + name + "' differs only in capitalization from ";
- msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
- _unit->error(msg);
+ if(!_unit->caseSensitive())
+ {
+ msg = "dictionary `" + name + "' differs only in capitalization from ";
+ msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
+ _unit->error(msg);
+ }
}
if(!Dictionary::legalKeyType(keyType))
@@ -640,9 +652,12 @@ Slice::Container::createEnum(const string& name, bool local)
_unit->error(msg);
return 0;
}
- msg = "enumeration `" + name + "' differs only in capitalization from ";
- msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
- _unit->error(msg);
+ if(!_unit->caseSensitive())
+ {
+ msg = "enumeration `" + name + "' differs only in capitalization from ";
+ msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
+ _unit->error(msg);
+ }
}
EnumPtr p = new Enum(this, name, local);
@@ -674,9 +689,12 @@ Slice::Container::createEnumerator(const string& name)
_unit->error(msg);
return 0;
}
- msg = "enumerator `" + name + "' differs only in capitalization from ";
- msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
- _unit->error(msg);
+ if(!_unit->caseSensitive())
+ {
+ msg = "enumerator `" + name + "' differs only in capitalization from ";
+ msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
+ _unit->error(msg);
+ }
}
EnumeratorPtr p = new Enumerator(this, name);
@@ -709,9 +727,12 @@ Slice::Container::createConstDef(const string name, const TypePtr& constType,
_unit->error(msg);
return 0;
}
- msg = "constant `" + name + "' differs only in capitalization from ";
- msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
- _unit->error(msg);
+ if(!_unit->caseSensitive())
+ {
+ msg = "constant `" + name + "' differs only in capitalization from ";
+ msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
+ _unit->error(msg);
+ }
}
//
@@ -811,7 +832,7 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError)
continue; // Ignore class definitions
}
- if(printError && matches.front()->scoped() != (thisScope() + sc))
+ if(printError && !_unit->caseSensitive() && matches.front()->scoped() != (thisScope() + sc))
{
string msg = (*p)->kindOf() + " name `" + scoped;
msg += "' is capitalized inconsistently with its previous name: `";
@@ -848,7 +869,7 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError)
continue; // Ignore class definitions
}
- if(printError && matches.front()->scoped() != (thisScope() + sc))
+ if(printError && !_unit->caseSensitive() && matches.front()->scoped() != (thisScope() + sc))
{
string msg = (*p)->kindOf() + " name `" + scoped;
msg += "' is capitalized inconsistently with its previous name: `";
@@ -937,7 +958,7 @@ Slice::Container::lookupContained(const string& scoped, bool printError)
{
results.push_back(*p);
- if(printError && (*p)->scoped() != (thisScope() + sc))
+ if(printError && !_unit->caseSensitive() && (*p)->scoped() != (thisScope() + sc))
{
string msg = (*p)->kindOf() + " name `" + scoped;
msg += "' is capitalized inconsistently with its previous name: `" + (*p)->scoped() + "'";
@@ -1337,7 +1358,7 @@ Slice::Container::checkIntroduced(const string& scoped, ContainedPtr namedThing)
}
else
{
- if(it->second != namedThing)
+ if(!_unit->caseSensitive() && it->second != namedThing)
{
_unit->error("`" + scoped + "' has changed meaning");
return false;
@@ -1738,8 +1759,9 @@ Slice::ClassDecl::checkPairIntersections(const StringPartitionList& l, const str
unit->error(msg);
reported.insert(*s1);
}
- else if(!CICompare()(*s1, *s2) && !CICompare()(*s2, *s1) &&
- reported.find(*s1) == reported.end() && reported.find(*s2) == reported.end())
+ else if(!unit->caseSensitive() &&
+ !CICompare()(*s1, *s2) && !CICompare()(*s2, *s1) &&
+ reported.find(*s1) == reported.end() && reported.find(*s2) == reported.end())
{
string msg = "ambiguous multiple inheritance: `" + name;
msg += "' inherits operations `" + *s1 + "' and `" + *s2;
@@ -1786,7 +1808,7 @@ Slice::ClassDef::createOperation(const string& name,
}
}
string msg;
- if(matches.front()->name() != name)
+ if(!_unit->caseSensitive() && matches.front()->name() != name)
{
msg = "operation `" + name + "' differs only in capitalization from ";
msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
@@ -1809,16 +1831,19 @@ Slice::ClassDef::createOperation(const string& name,
_unit->error(msg);
return 0;
}
- string newName = name;
- toLower(newName);
- string thisName = this->name();
- toLower(thisName);
- if(newName == thisName)
+ if(!_unit->caseSensitive())
{
- string msg = "operation `" + name + "' differs only in capitalization from enclosing ";
- msg += isInterface() ? "interface" : "class";
- msg += " name `" + this->name() + "'";
- _unit->error(msg);
+ string newName = name;
+ toLower(newName);
+ string thisName = this->name();
+ toLower(thisName);
+ if(newName == thisName)
+ {
+ string msg = "operation `" + name + "' differs only in capitalization from enclosing ";
+ msg += isInterface() ? "interface" : "class";
+ msg += " name `" + this->name() + "'";
+ _unit->error(msg);
+ }
}
//
@@ -1847,15 +1872,18 @@ Slice::ClassDef::createOperation(const string& name,
_unit->error(msg);
return 0;
}
- string baseName = (*q)->name();
- toLower(baseName);
- string newName = name;
- toLower(newName);
- if(baseName == newName)
+ if(!_unit->caseSensitive())
{
- string msg = "operation `" + name + "' differs only in capitalization from " + (*q)->kindOf();
- msg += " `" + (*q)->name() + "', which is defined in a base interface or class";
- _unit->error(msg);
+ string baseName = (*q)->name();
+ toLower(baseName);
+ string newName = name;
+ toLower(newName);
+ if(baseName == newName)
+ {
+ string msg = "operation `" + name + "' differs only in capitalization from " + (*q)->kindOf();
+ msg += " `" + (*q)->name() + "', which is defined in a base interface or class";
+ _unit->error(msg);
+ }
}
}
}
@@ -1893,7 +1921,7 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type)
}
}
string msg;
- if(matches.front()->name() != name)
+ if(!_unit->caseSensitive() && matches.front()->name() != name)
{
msg = "data member `" + name + "' differs only in capitalization from ";
msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
@@ -1919,15 +1947,18 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type)
_unit->error(msg);
return 0;
}
- string newName = name;
- toLower(newName);
- string thisName = this->name();
- toLower(thisName);
- if(newName == thisName)
+ if(!_unit->caseSensitive())
{
- string msg = "data member `" + name + "' differs only in capitalization from enclosing class name `";
- msg += this->name() + "'";
- _unit->error(msg);
+ string newName = name;
+ toLower(newName);
+ string thisName = this->name();
+ toLower(thisName);
+ if(newName == thisName)
+ {
+ string msg = "data member `" + name + "' differs only in capitalization from enclosing class name `";
+ msg += this->name() + "'";
+ _unit->error(msg);
+ }
}
//
@@ -1956,15 +1987,18 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type)
_unit->error(msg);
return 0;
}
- string baseName = (*q)->name();
- toLower(baseName);
- string newName = name;
- toLower(newName);
- if(baseName == newName)
+ if(!_unit->caseSensitive())
{
- string msg = "data member `" + name + "' differs only in capitalization from " + (*q)->kindOf();
- msg += " `" + (*q)->name() + "', which is defined in a base interface or class";
- _unit->error(msg);
+ string baseName = (*q)->name();
+ toLower(baseName);
+ string newName = name;
+ toLower(newName);
+ if(baseName == newName)
+ {
+ string msg = "data member `" + name + "' differs only in capitalization from " + (*q)->kindOf();
+ msg += " `" + (*q)->name() + "', which is defined in a base interface or class";
+ _unit->error(msg);
+ }
}
}
}
@@ -2222,7 +2256,7 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type)
}
}
string msg;
- if(matches.front()->name() != name)
+ if(!_unit->caseSensitive() && matches.front()->name() != name)
{
msg = "exception member `" + name + "' differs only in capitalization from ";
msg += "exception member `" + matches.front()->name() + "'";
@@ -2247,15 +2281,18 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type)
_unit->error(msg);
return 0;
}
- string newName = name;
- toLower(newName);
- string thisName = this->name();
- toLower(thisName);
- if(newName == thisName)
+ if(!_unit->caseSensitive())
{
- string msg = "exception member `" + name + "' differs only in capitalization from enclosing exception name `";
- msg += this->name() + "'";
- _unit->error(msg);
+ string newName = name;
+ toLower(newName);
+ string thisName = this->name();
+ toLower(thisName);
+ if(newName == thisName)
+ {
+ string msg = "exception member `" + name + "' differs only in capitalization ";
+ msg += "from enclosing exception name `" + this->name() + "'";
+ _unit->error(msg);
+ }
}
//
@@ -2275,15 +2312,18 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type)
_unit->error(msg);
return 0;
}
- string baseName = (*r)->name();
- toLower(baseName);
- string newName = name;
- toLower(newName);
- if(baseName == newName)
+ if(!_unit->caseSensitive())
{
- string msg = "exception member `" + name + "' differs only in capitalization from exception member `";
- msg += (*r)->name() + "', which is defined in a base exception";
- _unit->error(msg);
+ string baseName = (*r)->name();
+ toLower(baseName);
+ string newName = name;
+ toLower(newName);
+ if(baseName == newName)
+ {
+ string msg = "exception member `" + name + "' differs only in capitalization from exception member `";
+ msg += (*r)->name() + "', which is defined in a base exception";
+ _unit->error(msg);
+ }
}
}
}
@@ -2400,7 +2440,7 @@ Slice::Struct::createDataMember(const string& name, const TypePtr& type)
}
}
string msg;
- if(matches.front()->name() != name)
+ if(!_unit->caseSensitive() && matches.front()->name() != name)
{
msg = "member `" + name + "' differs only in capitalization from ";
msg += "member `" + matches.front()->name() + "'";
@@ -2425,15 +2465,18 @@ Slice::Struct::createDataMember(const string& name, const TypePtr& type)
_unit->error(msg);
return 0;
}
- string newName = name;
- toLower(newName);
- string thisName = this->name();
- toLower(thisName);
- if(newName == thisName)
+ if(!_unit->caseSensitive())
{
- string msg = "struct member `" + name + "' differs only in capitalization from enclosing struct name `";
- msg += this->name() + "'";
- _unit->error(msg);
+ string newName = name;
+ toLower(newName);
+ string thisName = this->name();
+ toLower(thisName);
+ if(newName == thisName)
+ {
+ string msg = "struct member `" + name + "' differs only in capitalization from enclosing struct name `";
+ msg += this->name() + "'";
+ _unit->error(msg);
+ }
}
//
@@ -3070,7 +3113,7 @@ Slice::Operation::createParamDecl(const string& name, const TypePtr& type, bool
}
}
string msg;
- if(matches.front()->name() != name)
+ if(!_unit->caseSensitive() && matches.front()->name() != name)
{
msg = "parameter `" + name + "' differs only in capitalization from ";
msg += "parameter `" + matches.front()->name() + "'";
@@ -3095,15 +3138,18 @@ Slice::Operation::createParamDecl(const string& name, const TypePtr& type, bool
_unit->error(msg);
return 0;
}
- string newName = name;
- toLower(newName);
- string thisName = this->name();
- toLower(thisName);
- if(newName == thisName)
+ if(!_unit->caseSensitive())
{
- string msg = "parameter `" + name + "' differs only in capitalization from operation name `";
- msg += this->name() + "'";
- _unit->error(msg);
+ string newName = name;
+ toLower(newName);
+ string thisName = this->name();
+ toLower(thisName);
+ if(newName == thisName)
+ {
+ string msg = "parameter `" + name + "' differs only in capitalization from operation name `";
+ msg += this->name() + "'";
+ _unit->error(msg);
+ }
}
//
@@ -3380,9 +3426,9 @@ Slice::DataMember::DataMember(const ContainerPtr& container, const string& name,
// ----------------------------------------------------------------------
UnitPtr
-Slice::Unit::createUnit(bool ignRedefs, bool all, bool allowIcePrefix)
+Slice::Unit::createUnit(bool ignRedefs, bool all, bool allowIcePrefix, bool caseSensitive)
{
- return new Unit(ignRedefs, all, allowIcePrefix);
+ return new Unit(ignRedefs, all, allowIcePrefix, caseSensitive);
}
bool
@@ -3397,6 +3443,11 @@ Slice::Unit::allowIcePrefix() const
return _allowIcePrefix;
}
+bool
+Slice::Unit::caseSensitive() const
+{
+ return _caseSensitive;
+}
void
Slice::Unit::setComment(const string& comment)
{
@@ -3594,17 +3645,23 @@ Slice::Unit::popContainer()
void
Slice::Unit::addContent(const ContainedPtr& contained)
{
- string scopedLowerCase = contained->scoped();
- toLower(scopedLowerCase);
- _contentMap[scopedLowerCase].push_back(contained);
+ string scoped = contained->scoped();
+ if(!caseSensitive())
+ {
+ toLower(scoped);
+ }
+ _contentMap[scoped].push_back(contained);
}
void
Slice::Unit::removeContent(const ContainedPtr& contained)
{
- string scopedLowerCase = contained->scoped();
- toLower(scopedLowerCase);
- map<string, ContainedList>::iterator p = _contentMap.find(scopedLowerCase);
+ string scoped = contained->scoped();
+ if(!caseSensitive())
+ {
+ toLower(scoped);
+ }
+ map<string, ContainedList>::iterator p = _contentMap.find(scoped);
assert(p != _contentMap.end());
ContainedList::iterator q;
for(q = p->second.begin(); q != p->second.end(); ++q)
@@ -3624,10 +3681,13 @@ Slice::Unit::findContents(const string& scoped) const
assert(!scoped.empty());
assert(scoped[0] == ':');
- string scopedLowerCase = scoped;
- toLower(scopedLowerCase);
+ string name = scoped;
+ if(!_unit->caseSensitive())
+ {
+ toLower(name);
+ }
- map<string, ContainedList>::const_iterator p = _contentMap.find(scopedLowerCase);
+ map<string, ContainedList>::const_iterator p = _contentMap.find(name);
if(p != _contentMap.end())
{
return p->second;
@@ -3856,12 +3916,13 @@ Slice::Unit::builtin(Builtin::Kind kind)
return builtin;
}
-Slice::Unit::Unit(bool ignRedefs, bool all, bool allowIcePrefix) :
+Slice::Unit::Unit(bool ignRedefs, bool all, bool allowIcePrefix, bool caseSensitive) :
SyntaxTreeBase(0),
Container(0),
_ignRedefs(ignRedefs),
_all(all),
_allowIcePrefix(allowIcePrefix),
+ _caseSensitive(caseSensitive),
_errors(0)
{
_unit = this;
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index 17f6500b355..078b332c1b4 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -34,6 +34,7 @@ usage(const char* n)
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
;
+ // Note: --case-sensitive is intentionally not shown here!
}
int
@@ -47,6 +48,7 @@ main(int argc, char* argv[])
bool impl = false;
bool debug = false;
bool ice = false;
+ bool caseSensitive = false;
bool depend = false;
int idx = 1;
@@ -108,6 +110,15 @@ main(int argc, char* argv[])
}
--argc;
}
+ else if(strcmp(argv[idx], "--case-sensitive") == 0)
+ {
+ caseSensitive = true;
+ for(int i = idx ; i + 1 < argc ; ++i)
+ {
+ argv[i] = argv[i + 1];
+ }
+ --argc;
+ }
else if(strcmp(argv[idx], "--include-dir") == 0)
{
if(idx + 1 >= argc)
@@ -257,7 +268,7 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
- UnitPtr unit = Unit::createUnit(false, false, ice);
+ UnitPtr unit = Unit::createUnit(false, false, ice, caseSensitive);
int parseStatus = unit->parse(cppHandle, debug);
#ifdef _WIN32
diff --git a/cpp/src/slice2docbook/Main.cpp b/cpp/src/slice2docbook/Main.cpp
index 4d8e2cd6112..02a5b822f41 100644
--- a/cpp/src/slice2docbook/Main.cpp
+++ b/cpp/src/slice2docbook/Main.cpp
@@ -34,6 +34,7 @@ usage(const char* n)
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
;
+ // Note: --case-sensitive is intentionally not shown here!
}
int
@@ -42,6 +43,7 @@ main(int argc, char* argv[])
string cpp("cpp -C");
bool debug = false;
bool ice = false;
+ bool caseSensitive = false;
bool standAlone = false;
bool noGlobals = false;
bool chapter = false;
@@ -126,6 +128,15 @@ main(int argc, char* argv[])
}
--argc;
}
+ else if(strcmp(argv[idx], "--case-sensitive") == 0)
+ {
+ caseSensitive = true;
+ for(int i = idx ; i + 1 < argc ; ++i)
+ {
+ argv[i] = argv[i + 1];
+ }
+ --argc;
+ }
else if(argv[idx][0] == '-')
{
cerr << argv[0] << ": unknown option `" << argv[idx] << "'" << endl;
@@ -166,7 +177,7 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
- UnitPtr unit = Unit::createUnit(true, false, ice);
+ UnitPtr unit = Unit::createUnit(true, false, ice, caseSensitive);
int status = EXIT_SUCCESS;
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp
index f22fcc97265..631583536d0 100644
--- a/cpp/src/slice2freeze/Main.cpp
+++ b/cpp/src/slice2freeze/Main.cpp
@@ -46,6 +46,7 @@ usage(const char* n)
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
;
+ // Note: --case-sensitive is intentionally not shown here!
}
bool
@@ -236,6 +237,7 @@ main(int argc, char* argv[])
string output;
bool debug = false;
bool ice = false;
+ bool caseSensitive = false;
vector<Dict> dicts;
int idx = 1;
@@ -355,6 +357,15 @@ main(int argc, char* argv[])
}
--argc;
}
+ else if(strcmp(argv[idx], "--case-sensitive") == 0)
+ {
+ caseSensitive = true;
+ for(int i = idx ; i + 1 < argc ; ++i)
+ {
+ argv[i] = argv[i + 1];
+ }
+ --argc;
+ }
else if(strcmp(argv[idx], "--include-dir") == 0)
{
if(idx + 1 >= argc)
@@ -448,7 +459,7 @@ main(int argc, char* argv[])
fileC = output + '/' + fileC;
}
- UnitPtr unit = Unit::createUnit(true, false, ice);
+ UnitPtr unit = Unit::createUnit(true, false, ice, caseSensitive);
StringList includes;
diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp
index 58e391d0d9f..27745239763 100644
--- a/cpp/src/slice2freezej/Main.cpp
+++ b/cpp/src/slice2freezej/Main.cpp
@@ -424,6 +424,7 @@ usage(const char* n)
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
;
+ // Note: --case-sensitive is intentionally not shown here!
}
int
@@ -436,6 +437,7 @@ main(int argc, char* argv[])
string output;
bool debug = false;
bool ice = false;
+ bool caseSensitive = false;
vector<Dict> dicts;
int idx = 1;
@@ -555,6 +557,15 @@ main(int argc, char* argv[])
}
--argc;
}
+ else if(strcmp(argv[idx], "--case-sensitive") == 0)
+ {
+ caseSensitive = true;
+ for(int i = idx ; i + 1 < argc ; ++i)
+ {
+ argv[i] = argv[i + 1];
+ }
+ --argc;
+ }
else if(strcmp(argv[idx], "--include-dir") == 0)
{
if(idx + 1 >= argc)
@@ -615,7 +626,7 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
- UnitPtr unit = Unit::createUnit(true, false, ice);
+ UnitPtr unit = Unit::createUnit(true, false, ice, caseSensitive);
StringList includes;
diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp
index de54a37ec0c..fe45e1cc977 100644
--- a/cpp/src/slice2java/Main.cpp
+++ b/cpp/src/slice2java/Main.cpp
@@ -36,6 +36,7 @@ usage(const char* n)
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
;
+ // Note: --case-sensitive is intentionally not shown here!
}
int
@@ -51,6 +52,7 @@ main(int argc, char* argv[])
bool clone = false;
bool debug = false;
bool ice = false;
+ bool caseSensitive = false;
bool depend = false;
int idx = 1;
@@ -116,6 +118,15 @@ main(int argc, char* argv[])
}
--argc;
}
+ else if(strcmp(argv[idx], "--case-sensitive") == 0)
+ {
+ caseSensitive = true;
+ for(int i = idx ; i + 1 < argc ; ++i)
+ {
+ argv[i] = argv[i + 1];
+ }
+ --argc;
+ }
else if(strcmp(argv[idx], "--output-dir") == 0)
{
if(idx + 1 >= argc)
@@ -282,7 +293,7 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
- UnitPtr unit = Unit::createUnit(false, false, ice);
+ UnitPtr unit = Unit::createUnit(false, false, ice, caseSensitive);
int parseStatus = unit->parse(cppHandle, debug);
#ifdef _WIN32
diff --git a/cpp/src/slice2wsdl/Main.cpp b/cpp/src/slice2wsdl/Main.cpp
index 132c429cb45..52674f358bc 100644
--- a/cpp/src/slice2wsdl/Main.cpp
+++ b/cpp/src/slice2wsdl/Main.cpp
@@ -29,6 +29,7 @@ usage(const char* n)
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
;
+ // Note: --case-sensitive is intentionally not shown here!
}
int
@@ -37,6 +38,7 @@ main(int argc, char* argv[])
string cpp("cpp -C");
bool debug = false;
bool ice = false;
+ bool caseSensitive = false;
string include;
string output;
vector<string> includePaths;
@@ -100,6 +102,15 @@ main(int argc, char* argv[])
}
--argc;
}
+ else if(strcmp(argv[idx], "--case-sensitive") == 0)
+ {
+ caseSensitive = true;
+ for(int i = idx ; i + 1 < argc ; ++i)
+ {
+ argv[i] = argv[i + 1];
+ }
+ --argc;
+ }
else if(strcmp(argv[idx], "--include-dir") == 0)
{
if(idx + 1 >= argc)
@@ -191,7 +202,7 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
- UnitPtr unit = Unit::createUnit(false, false, ice);
+ UnitPtr unit = Unit::createUnit(false, false, ice, caseSensitive);
int parseStatus = unit->parse(cppHandle, debug);
#ifdef _WIN32
diff --git a/cpp/src/slice2xsd/Main.cpp b/cpp/src/slice2xsd/Main.cpp
index 82395018af4..faaadfb54ed 100644
--- a/cpp/src/slice2xsd/Main.cpp
+++ b/cpp/src/slice2xsd/Main.cpp
@@ -29,6 +29,7 @@ usage(const char* n)
"-d, --debug Print debug messages.\n"
"--ice Permit `Ice' prefix (for building Ice source code only)\n"
;
+ // Note: --case-sensitive is intentionally not shown here!
}
int
@@ -37,6 +38,7 @@ main(int argc, char* argv[])
string cpp("cpp -C");
bool debug = false;
bool ice = false;
+ bool caseSensitive = false;
string include;
string output;
vector<string> includePaths;
@@ -100,6 +102,15 @@ main(int argc, char* argv[])
}
--argc;
}
+ else if(strcmp(argv[idx], "--case-sensitive") == 0)
+ {
+ caseSensitive = true;
+ for(int i = idx ; i + 1 < argc ; ++i)
+ {
+ argv[i] = argv[i + 1];
+ }
+ --argc;
+ }
else if(strcmp(argv[idx], "--include-dir") == 0)
{
if(idx + 1 >= argc)
@@ -192,7 +203,7 @@ main(int argc, char* argv[])
return EXIT_FAILURE;
}
- UnitPtr unit = Unit::createUnit(false, false, ice);
+ UnitPtr unit = Unit::createUnit(false, false, ice, caseSensitive);
int parseStatus = unit->parse(cppHandle, debug);
#ifdef _WIN32