Skip to content

Commit

Permalink
Add support cs:namespace metadata
Browse files Browse the repository at this point in the history
Add support to map Slice modules to different namespaces
using cs:namespace metadata

Fixes zeroc-ice#122 slice2cs generates invalid namespace qualification
  • Loading branch information
pepone committed Jun 28, 2018
1 parent 0a0d063 commit a7d0df7
Show file tree
Hide file tree
Showing 34 changed files with 2,639 additions and 486 deletions.
220 changes: 165 additions & 55 deletions cpp/src/slice2cs/CsUtil.cpp

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion cpp/src/slice2cs/CsUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,24 @@ class CsGenerator : private ::IceUtil::noncopyable
//
static void validateMetaData(const UnitPtr&);

//
// Returns the namespace of a Contained entity.
//
static std::string getPackage(const ContainedPtr&);

static std::string getUnqualified(const std::string&, const std::string&, bool builtin = false);
static std::string getUnqualified(const ContainedPtr&,
const std::string& package = "",
const std::string& prefix = "",
const std::string& suffix = "");

protected:

static std::string getUnqualified(const std::string&, const std::string&);
//
// Returns the namespace prefix of a Contained entity.
//
static std::string getPackagePrefix(const ContainedPtr&);

static std::string resultStructName(const std::string&, const std::string&, bool = false);
static std::string resultType(const OperationPtr&, const std::string&, bool = false);
static std::string taskResultType(const OperationPtr&, const std::string&, bool = false);
Expand Down
820 changes: 448 additions & 372 deletions cpp/src/slice2cs/Gen.cpp

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions cpp/src/slice2cs/Gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ class CsVisitor : public CsGenerator, public ParserVisitor
void writeDocCommentAMD(const OperationPtr&, const std::string&);
void writeDocCommentParam(const OperationPtr&, ParamDir, bool);

virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);


::IceUtilInternal::Output& _out;
};

Expand Down
Loading

0 comments on commit a7d0df7

Please sign in to comment.