summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2012-09-25 23:41:46 +0000
committerBernard Normier <bernard@zeroc.com>2012-09-25 23:41:46 +0000
commitd11c7d5751b049d4aba39d7c9d979014b2802622 (patch)
treee0c48c2b98a1abf7bd4e2eb57edda924e83f915c /cpp/src
parentRenamings (ICE-4868): (diff)
downloadice-d11c7d5751b049d4aba39d7c9d979014b2802622.tar.bz2
ice-d11c7d5751b049d4aba39d7c9d979014b2802622.tar.xz
ice-d11c7d5751b049d4aba39d7c9d979014b2802622.zip
Renamed OptionalType to OptionalFormat in Java (ICE-4868)
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Slice/JavaUtil.cpp60
-rw-r--r--cpp/src/slice2java/Gen.cpp8
2 files changed, 34 insertions, 34 deletions
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp
index 45f10b1a004..4799dd1313d 100644
--- a/cpp/src/Slice/JavaUtil.cpp
+++ b/cpp/src/Slice/JavaUtil.cpp
@@ -568,7 +568,7 @@ Slice::JavaGenerator::useOptionalMapping(const OperationPtr& p)
}
string
-Slice::JavaGenerator::getOptionalType(const TypePtr& type)
+Slice::JavaGenerator::getOptionalFormat(const TypePtr& type)
{
BuiltinPtr bp = BuiltinPtr::dynamicCast(type);
if(bp)
@@ -578,33 +578,33 @@ Slice::JavaGenerator::getOptionalType(const TypePtr& type)
case Builtin::KindByte:
case Builtin::KindBool:
{
- return "Ice.OptionalType.F1";
+ return "Ice.OptionalFormat.F1";
}
case Builtin::KindShort:
{
- return "Ice.OptionalType.F2";
+ return "Ice.OptionalFormat.F2";
}
case Builtin::KindInt:
case Builtin::KindFloat:
{
- return "Ice.OptionalType.F4";
+ return "Ice.OptionalFormat.F4";
}
case Builtin::KindLong:
case Builtin::KindDouble:
{
- return "Ice.OptionalType.F8";
+ return "Ice.OptionalFormat.F8";
}
case Builtin::KindString:
{
- return "Ice.OptionalType.VSize";
+ return "Ice.OptionalFormat.VSize";
}
case Builtin::KindObject:
{
- return "Ice.OptionalType.Size";
+ return "Ice.OptionalFormat.Size";
}
case Builtin::KindObjectProxy:
{
- return "Ice.OptionalType.FSize";
+ return "Ice.OptionalFormat.FSize";
}
case Builtin::KindLocalObject:
{
@@ -616,36 +616,36 @@ Slice::JavaGenerator::getOptionalType(const TypePtr& type)
if(EnumPtr::dynamicCast(type))
{
- return "Ice.OptionalType.Size";
+ return "Ice.OptionalFormat.Size";
}
SequencePtr seq = SequencePtr::dynamicCast(type);
if(seq)
{
- return seq->type()->isVariableLength() ? "Ice.OptionalType.FSize" : "Ice.OptionalType.VSize";
+ return seq->type()->isVariableLength() ? "Ice.OptionalFormat.FSize" : "Ice.OptionalFormat.VSize";
}
DictionaryPtr d = DictionaryPtr::dynamicCast(type);
if(d)
{
return (d->keyType()->isVariableLength() || d->valueType()->isVariableLength()) ?
- "Ice.OptionalType.FSize" : "Ice.OptionalType.VSize";
+ "Ice.OptionalFormat.FSize" : "Ice.OptionalFormat.VSize";
}
StructPtr st = StructPtr::dynamicCast(type);
if(st)
{
- return st->isVariableLength() ? "Ice.OptionalType.FSize" : "Ice.OptionalType.VSize";
+ return st->isVariableLength() ? "Ice.OptionalFormat.FSize" : "Ice.OptionalFormat.VSize";
}
if(ProxyPtr::dynamicCast(type))
{
- return "Ice.OptionalType.FSize";
+ return "Ice.OptionalFormat.FSize";
}
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
assert(cl);
- return "Ice.OptionalType.Size";
+ return "Ice.OptionalFormat.Size";
}
string
@@ -1240,7 +1240,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalMapping)
{
out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt(" << tag
- << ", " << getOptionalType(type) << "))";
+ << ", " << getOptionalFormat(type) << "))";
out << sb;
out << nl << stream << ".startSize();";
out << nl << typeS << "Helper.__write(" << stream << ", " << v << ".get());";
@@ -1249,7 +1249,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
}
else
{
- out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
out << nl << stream << ".startSize();";
out << nl << typeS << "Helper.__write(" << stream << ", " << v << ");";
@@ -1272,7 +1272,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
{
if(optionalParam)
{
- out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
out << nl << stream << ".skip(4);";
out << nl << v << ".set(" << typeS << "Helper.__read(" << stream << "));";
@@ -1317,7 +1317,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalParam)
{
string typeS = typeToString(type, TypeModeIn, package);
- out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
out << nl << stream << ".readObject(new Ice.OptionalObject(" << v << ", " << typeS << ".class, "
<< getStaticId(type, package) << "));";
@@ -1366,12 +1366,12 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalMapping)
{
out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt("
- << tag << ", " << getOptionalType(type) << "))";
+ << tag << ", " << getOptionalFormat(type) << "))";
val = v + ".get()";
}
else
{
- out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))";
val = v;
}
@@ -1410,7 +1410,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalParam)
{
- out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
if(st->isVariableLength())
@@ -1468,14 +1468,14 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalMapping)
{
out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt(" << tag
- << ", " << getOptionalType(type) << "))";
+ << ", " << getOptionalFormat(type) << "))";
out << sb;
out << nl << v << ".get().__write(" << stream << ");";
out << eb;
}
else
{
- out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
out << nl << v << ".__write(" << stream << ");";
out << eb;
@@ -1492,7 +1492,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalParam)
{
- out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
out << nl << v << ".set(" << typeS << ".__read(" << stream << "));";
out << eb;
@@ -1528,12 +1528,12 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalMapping)
{
out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt("
- << tag << ", " << getOptionalType(type) << "))";
+ << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
}
else
{
- out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
}
}
@@ -1576,7 +1576,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalParam)
{
tmpName = "__optDict";
- out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
out << nl << typeS << ' ' << tmpName << ';';
}
@@ -1686,11 +1686,11 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalMapping)
{
out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt("
- << tag << ", " << getOptionalType(type) << "))";
+ << tag << ", " << getOptionalFormat(type) << "))";
}
else
{
- out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))";
}
out << sb;
@@ -1803,7 +1803,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out,
if(optionalParam)
{
tmpName = "__optSeq";
- out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalType(type) << "))";
+ out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))";
out << sb;
out << nl << typeS << ' ' << tmpName << ';';
}
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 1b049475ffd..6c59d6b218f 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -475,7 +475,7 @@ Slice::JavaVisitor::writeMarshalDataMember(Output& out, const string& package, c
else
{
out << nl << "if(__has_" << member->name() << " && __os.writeOpt(" << member->tag() << ", "
- << getOptionalType(member->type()) << "))";
+ << getOptionalFormat(member->type()) << "))";
out << sb;
writeMarshalUnmarshalCode(out, package, member->type(), OptionalMember, false, 0, fixKwd(member->name()), true,
iter, false, member->getMetaData());
@@ -507,7 +507,7 @@ Slice::JavaVisitor::writeUnmarshalDataMember(Output& out, const string& package,
else
{
out << nl << "if(__has_" << member->name() << " = __is.readOpt(" << member->tag() << ", "
- << getOptionalType(member->type()) << "))";
+ << getOptionalFormat(member->type()) << "))";
out << sb;
writeMarshalUnmarshalCode(out, package, member->type(), OptionalMember, false, 0, fixKwd(member->name()), false,
iter, false, member->getMetaData(), patchParams);
@@ -527,7 +527,7 @@ Slice::JavaVisitor::writeStreamMarshalDataMember(Output& out, const string& pack
else
{
out << nl << "if(__has_" << member->name() << " && __outS.writeOptional(" << member->tag() << ", "
- << getOptionalType(member->type()) << "))";
+ << getOptionalFormat(member->type()) << "))";
out << sb;
writeStreamMarshalUnmarshalCode(out, package, member->type(), true, member->tag(), fixKwd(member->name()),
true, iter, false, member->getMetaData());
@@ -559,7 +559,7 @@ Slice::JavaVisitor::writeStreamUnmarshalDataMember(Output& out, const string& pa
else
{
out << nl << "if(__has_" << member->name() << " = __inS.readOptional(" << member->tag() << ", "
- << getOptionalType(member->type()) << "))";
+ << getOptionalFormat(member->type()) << "))";
out << sb;
writeStreamMarshalUnmarshalCode(out, package, member->type(), true, member->tag(), fixKwd(member->name()),
false, iter, false, member->getMetaData(), patchParams);