summaryrefslogtreecommitdiff
path: root/cpp/src/slice2php/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2php/Main.cpp')
-rw-r--r--cpp/src/slice2php/Main.cpp42
1 files changed, 30 insertions, 12 deletions
diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp
index a59c75e6751..67f1e093936 100644
--- a/cpp/src/slice2php/Main.cpp
+++ b/cpp/src/slice2php/Main.cpp
@@ -1502,22 +1502,40 @@ generate(const UnitPtr& un, bool all, bool checksum, bool ns, const vector<strin
{
out << "namespace"; // Global namespace.
out << sb;
- }
- for(ChecksumMap::const_iterator p = checksums.begin(); p != checksums.end(); ++p)
- {
- out << nl << "$Ice_sliceChecksums[\"" << p->first << "\"] = \"";
- ostringstream str;
- str.flags(ios_base::hex);
- str.fill('0');
- for(vector<unsigned char>::const_iterator q = p->second.begin(); q != p->second.end(); ++q)
+ out << "new Ice\\SliceChecksumInit(array(";
+ for(ChecksumMap::const_iterator p = checksums.begin(); p != checksums.end();)
{
- str << static_cast<int>(*q);
+ out << nl << "\"" << p->first << "\" => \"";
+ ostringstream str;
+ str.flags(ios_base::hex);
+ str.fill('0');
+ for(vector<unsigned char>::const_iterator q = p->second.begin(); q != p->second.end(); ++q)
+ {
+ str << static_cast<int>(*q);
+ }
+ out << str.str() << "\"";
+ if(++p != checksums.end())
+ {
+ out << ",";
+ }
}
- out << str.str() << "\";";
+ out << "));";
+ out << eb;
}
- if(ns)
+ else
{
- out << eb;
+ for(ChecksumMap::const_iterator p = checksums.begin(); p != checksums.end(); ++p)
+ {
+ out << nl << "$Ice_sliceChecksums[\"" << p->first << "\"] = \"";
+ ostringstream str;
+ str.flags(ios_base::hex);
+ str.fill('0');
+ for(vector<unsigned char>::const_iterator q = p->second.begin(); q != p->second.end(); ++q)
+ {
+ str << static_cast<int>(*q);
+ }
+ out << str.str() << "\";";
+ }
}
}
}