summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.h
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-01-14 14:16:11 +0100
committerJose <jose@zeroc.com>2016-01-14 14:16:11 +0100
commit807949c33d791a9c53a036754d1016fb22e5eb0f (patch)
tree55ef5ef9229a3ce26b6f8159ca6073ed8895ca6b /cpp/src/slice2cpp/Gen.h
parentMerge remote-tracking branch 'origin/3.6' (diff)
downloadice-807949c33d791a9c53a036754d1016fb22e5eb0f.tar.bz2
ice-807949c33d791a9c53a036754d1016fb22e5eb0f.tar.xz
ice-807949c33d791a9c53a036754d1016fb22e5eb0f.zip
Add slice2cpp --impl-c++98/--impl-c++11 options
Diffstat (limited to 'cpp/src/slice2cpp/Gen.h')
-rw-r--r--cpp/src/slice2cpp/Gen.h39
1 files changed, 35 insertions, 4 deletions
diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h
index 1507f43fd77..6b90d3ed391 100644
--- a/cpp/src/slice2cpp/Gen.h
+++ b/cpp/src/slice2cpp/Gen.h
@@ -31,6 +31,7 @@ public:
bool,
bool,
bool,
+ bool,
bool);
~Gen();
@@ -67,7 +68,8 @@ private:
std::vector<std::string> _includePaths;
std::string _dllExport;
std::string _dir;
- bool _impl;
+ bool _implCpp98;
+ bool _implCpp11;
bool _checksum;
bool _stream;
bool _ice;
@@ -267,10 +269,9 @@ private:
std::list<int> _useWstringHist;
//
- // Generate code to emit a local variable declaration and initialize it
- // if necessary.
+ // Get the default value returned for a type
//
- void writeDecl(::IceUtilInternal::Output&, const std::string&, const TypePtr&, const StringList&);
+ std::string defaultValue(const TypePtr&, const StringList&) const;
//
// Generate code to return a dummy value
@@ -587,6 +588,36 @@ private:
::IceUtilInternal::Output& H;
std::string _dllExport;
};
+
+ class Cpp11ImplVisitor : private ::IceUtil::noncopyable, public ParserVisitor
+ {
+ public:
+
+ Cpp11ImplVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+
+ virtual bool visitModuleStart(const ModulePtr&);
+ virtual void visitModuleEnd(const ModulePtr&);
+ virtual bool visitClassDefStart(const ClassDefPtr&);
+
+ private:
+
+ ::IceUtilInternal::Output& H;
+ ::IceUtilInternal::Output& C;
+
+ std::string _dllExport;
+ int _useWstring;
+ std::list<int> _useWstringHist;
+
+ //
+ // Generate code to return a dummy value
+ //
+ void writeReturn(::IceUtilInternal::Output&, const TypePtr&, const StringList&);
+
+ //
+ // Get the default value returned for a type
+ //
+ std::string defaultValue(const TypePtr&, const StringList&) const;
+ };
private: