summaryrefslogtreecommitdiff
path: root/cpp/src/slice2freeze/Main.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2002-01-30 16:29:24 +0000
committerMatthew Newhook <matthew@zeroc.com>2002-01-30 16:29:24 +0000
commit401ad2642076f9896852eaa5de8bfa0d3a07803f (patch)
tree526620de98b9807eea7876afa9d173a1aa9ce849 /cpp/src/slice2freeze/Main.cpp
parentStart migrating Freeze to use the XML stream. (diff)
downloadice-401ad2642076f9896852eaa5de8bfa0d3a07803f.tar.bz2
ice-401ad2642076f9896852eaa5de8bfa0d3a07803f.tar.xz
ice-401ad2642076f9896852eaa5de8bfa0d3a07803f.zip
Freeze updates.
Diffstat (limited to 'cpp/src/slice2freeze/Main.cpp')
-rw-r--r--cpp/src/slice2freeze/Main.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp
index 32e6ccb34fc..47313378f25 100644
--- a/cpp/src/slice2freeze/Main.cpp
+++ b/cpp/src/slice2freeze/Main.cpp
@@ -86,8 +86,8 @@ writeCodecH(const TypePtr& type, const string& name, const string& freezeType, O
H << sp << nl << "public:";
H << sp;
H.inc();
- H << nl << "static Freeze::" << freezeType << " write(" << inputTypeToString(type)
- << ", const ::Ice::CommunicatorPtr&);";
+ H << nl << "static void write(" << inputTypeToString(type) << ", Freeze::" << freezeType
+ << "&, const ::Ice::CommunicatorPtr&);";
H << nl << "static void read(" << typeToString(type) << "&, const Freeze::" << freezeType << "&, "
<< "const ::Ice::CommunicatorPtr&);";
H << eb << ';';
@@ -100,14 +100,14 @@ writeCodecC(const TypePtr& type, const string& name, const string& freezeType, O
tagName += freezeType;
tagName += "\"";
- C << sp << nl << "Freeze::" << freezeType << nl << name << "::write(" << inputTypeToString(type) << " v, "
- << "const ::Ice::CommunicatorPtr& communicator)";
+ C << sp << nl << "void" << nl << name << "::write(" << inputTypeToString(type) << " v, "
+ << "Freeze::" << freezeType << "& bytes, const ::Ice::CommunicatorPtr& communicator)";
C << sb;
C << nl << "::std::ostringstream os;";
C << nl << "::Ice::StreamPtr stream = new ::IceXML::StreamI(communicator, os);";
writeGenericMarshalUnmarshalCode(C, type, "v", true, tagName, "stream", true);
-
- C << nl << "return Freeze::" << freezeType << "(os.str().begin(), os.str().end());";
+ C << nl << "bytes.resize(os.str().size());";
+ C << nl << "memcpy(&bytes[0], os.str().data(), os.str().size());";
C << eb;
C << sp << nl << "void" << nl << name << "::read(" << typeToString(type) << "& v, "