summaryrefslogtreecommitdiff
path: root/cpp/src/Slice
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2018-10-18 12:01:54 -0400
committerJose <pepone@users.noreply.github.com>2018-10-18 18:01:53 +0200
commit456001e3e4dbb3f15396c0598b6ddb5436ac3a2a (patch)
treefacb9db494f91b066a1c0b5e29c371ec523a82e7 /cpp/src/Slice
parentUpdate Xamarin test instructions (diff)
downloadice-456001e3e4dbb3f15396c0598b6ddb5436ac3a2a.tar.bz2
ice-456001e3e4dbb3f15396c0598b6ddb5436ac3a2a.tar.xz
ice-456001e3e4dbb3f15396c0598b6ddb5436ac3a2a.zip
Rework cs:namespace implementation (fix issue #239) (#249)
* Rework the cs:namespace implementation No longer rely on Ice.Packages. Fixes #239. * Renamed Ice/packagemd to Ice/namespacemd (C#) * Removed Ice.Package property from C# tests * Switched to get-only attribute, fixed Xamarin test
Diffstat (limited to 'cpp/src/Slice')
-rw-r--r--cpp/src/Slice/Parser.cpp8
-rw-r--r--cpp/src/Slice/Parser.h3
2 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index e1be83afdc4..ada7e2070f1 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -6679,7 +6679,7 @@ Slice::Unit::addTypeId(int compactId, const std::string& typeId)
}
std::string
-Slice::Unit::getTypeId(int compactId)
+Slice::Unit::getTypeId(int compactId) const
{
map<int, string>::const_iterator p = _typeIds.find(compactId);
if(p != _typeIds.end())
@@ -6690,6 +6690,12 @@ Slice::Unit::getTypeId(int compactId)
}
bool
+Slice::Unit::hasCompactTypeId() const
+{
+ return _typeIds.size() > 0;
+}
+
+bool
Slice::Unit::usesNonLocals() const
{
for(map<string, ContainedList>::const_iterator p = _contentMap.begin(); p != _contentMap.end(); ++p)
diff --git a/cpp/src/Slice/Parser.h b/cpp/src/Slice/Parser.h
index 219c14ae151..81c01077a31 100644
--- a/cpp/src/Slice/Parser.h
+++ b/cpp/src/Slice/Parser.h
@@ -1092,7 +1092,8 @@ public:
ContainedList findUsedBy(const ContainedPtr&) const;
void addTypeId(int, const std::string&);
- std::string getTypeId(int);
+ std::string getTypeId(int) const;
+ bool hasCompactTypeId() const;
bool usesNonLocals() const;
bool usesConsts() const;