diff options
Diffstat (limited to 'cpp/include')
-rw-r--r-- | cpp/include/Ice/BasicStream.h | 2 | ||||
-rw-r--r-- | cpp/include/Ice/Handle.h | 41 | ||||
-rw-r--r-- | cpp/include/Ice/Incoming.h | 2 | ||||
-rw-r--r-- | cpp/include/Ice/IncomingAsync.h | 2 | ||||
-rw-r--r-- | cpp/include/Ice/ProxyHandle.h | 19 | ||||
-rw-r--r-- | cpp/include/IceUtil/Config.h | 20 | ||||
-rw-r--r-- | cpp/include/IceUtil/Handle.h | 11 | ||||
-rw-r--r-- | cpp/include/Slice/CPlusPlusUtil.h | 1 | ||||
-rw-r--r-- | cpp/include/Slice/CsUtil.h | 4 | ||||
-rw-r--r-- | cpp/include/Slice/FileTracker.h | 9 | ||||
-rw-r--r-- | cpp/include/Slice/JavaUtil.h | 11 | ||||
-rw-r--r-- | cpp/include/Slice/Parser.h | 18 | ||||
-rw-r--r-- | cpp/include/Slice/Preprocessor.h | 7 | ||||
-rw-r--r-- | cpp/include/Slice/Util.h | 9 |
14 files changed, 125 insertions, 31 deletions
diff --git a/cpp/include/Ice/BasicStream.h b/cpp/include/Ice/BasicStream.h index 36b39ce62ce..0af2a36fffc 100644 --- a/cpp/include/Ice/BasicStream.h +++ b/cpp/include/Ice/BasicStream.h @@ -200,6 +200,7 @@ public: delete oldEncaps; } } + void endWriteEncapsChecked(); // Used by public stream API. void startReadEncaps() { @@ -298,6 +299,7 @@ public: } i += 2; } + void endReadEncapsChecked(); // Used by public stream API. Ice::Int getReadEncapsSize(); void skipEncaps(); diff --git a/cpp/include/Ice/Handle.h b/cpp/include/Ice/Handle.h index 15731e774b3..5c415612642 100644 --- a/cpp/include/Ice/Handle.h +++ b/cpp/include/Ice/Handle.h @@ -14,24 +14,28 @@ #include <Ice/Config.h> // -// We include ProxyHandle.h here to make sure that the -// Ice::ProxyHandle template is defined before any definition of -// incRef() or decRef() (see -// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25495 for information -// on why this is necessary.) +// We include ProxyHandle.h here to make sure that the Ice::ProxyHandle +// template is defined before any definition of upCast(). +// +// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25495 for information +// on why this is necessary. // #include <Ice/ProxyHandle.h> // -// "Handle" or "smart pointer" class for classes derived from -// IceUtil::GCShared, IceUtil::Shared, or IceUtil::SimpleShared. +// "Handle" or "smart pointer" template for classes derived from +// IceInternal::GCShared, IceUtil::Shared, or IceUtil::SimpleShared. +// +// In constrast to IceUtil::Handle, IceInternal::Handle<T> can be used +// for a type T that has been declared but not defined. The only +// requirement is a declaration of the following function: // -// In constrast to IceUtil::Handle, IceInternal::Handle requires the -// declaration of the two global operations IceInternal::incRef(T*) -// and IceInternal::decRef(T*). The use of global operations allows -// this template to be used for types which are declared but not -// defined, provided that the two above mentioned operations are -// declared. +// namespace IceInternal +// { +// X* upCast(T*); +// } +// +// Where X is (or derives from) IceUtil::Shared or IceUtil::SimpleShared. // namespace IceInternal @@ -42,6 +46,17 @@ class Handle : public ::IceUtil::HandleBase<T> { public: +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + // + // C++Builder 2009 does not allow setting Ptr to 0. + // + Handle(int p) + { + assert(p == 0); + this->_ptr = 0; + } +#endif + Handle(T* p = 0) { this->_ptr = p; diff --git a/cpp/include/Ice/Incoming.h b/cpp/include/Ice/Incoming.h index 2289917b4d3..3aa4bb8551e 100644 --- a/cpp/include/Ice/Incoming.h +++ b/cpp/include/Ice/Incoming.h @@ -37,6 +37,8 @@ protected: void __warning(const Ice::Exception&) const; void __warning(const std::string&) const; + bool __servantLocatorFinished(); + void __handleException(const std::exception&); void __handleException(); diff --git a/cpp/include/Ice/IncomingAsync.h b/cpp/include/Ice/IncomingAsync.h index 5ce4a22b640..1675350886f 100644 --- a/cpp/include/Ice/IncomingAsync.h +++ b/cpp/include/Ice/IncomingAsync.h @@ -44,8 +44,6 @@ protected: private: - bool __servantLocatorFinished(); - // // We need a separate InstancePtr, because _is and _os only hold a // Instance* for optimization. diff --git a/cpp/include/Ice/ProxyHandle.h b/cpp/include/Ice/ProxyHandle.h index f73222b703f..cad5a557459 100644 --- a/cpp/include/Ice/ProxyHandle.h +++ b/cpp/include/Ice/ProxyHandle.h @@ -15,9 +15,10 @@ // // We include Handle.h here to make sure that the Ice::Handle template -// is defined before any definition of incRef() or decRef() (see -// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25495 for information -// on why this is necessary.) +// is defined before any definition of upCast(). +// +// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25495 for information +// on why this is necessary. // #include <Ice/Handle.h> @@ -106,6 +107,17 @@ template<typename T> class ProxyHandle : public ::IceUtil::HandleBase<T> { public: + +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + // + // C++Builder 2009 does not allow setting Prx to 0. + // + ProxyHandle(int p) + { + assert(p == 0); + this->_ptr = 0; + } +#endif ProxyHandle(T* p = 0) { @@ -282,7 +294,6 @@ public: } }; - } template<class Y> diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h index 8b2e99ca0a8..3e8ddd03ff0 100644 --- a/cpp/include/IceUtil/Config.h +++ b/cpp/include/IceUtil/Config.h @@ -221,4 +221,24 @@ typedef long long Int64; #define ICE_STRING_VERSION "3.3.1" // "A.B.C", with A=major, B=minor, C=patch #define ICE_INT_VERSION 30301 // AABBCC, with AA=major, BB=minor, CC=patch +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) +// +// Dummy class used in work around for bug in C++Builder 2009 +// http://qc.embarcadero/wc/qcmain.aspx?d=71611 +// +namespace IceUtil +{ + +class DummyBCC +{ +public: + + ~DummyBCC() + { + } +}; + +} +#endif + #endif diff --git a/cpp/include/IceUtil/Handle.h b/cpp/include/IceUtil/Handle.h index d466b4304ed..138a875f989 100644 --- a/cpp/include/IceUtil/Handle.h +++ b/cpp/include/IceUtil/Handle.h @@ -147,6 +147,17 @@ template<typename T> class Handle : public HandleBase<T> { public: + +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + // + // C++Builder 2009 does not allow setting Ptr to 0. + // + Handle(int p) + { + assert(p == 0); + this->_ptr = 0; + } +#endif Handle(T* p = 0) { diff --git a/cpp/include/Slice/CPlusPlusUtil.h b/cpp/include/Slice/CPlusPlusUtil.h index 4fc6ea5e822..0f121bcda98 100644 --- a/cpp/include/Slice/CPlusPlusUtil.h +++ b/cpp/include/Slice/CPlusPlusUtil.h @@ -48,6 +48,7 @@ SLICE_API void writeAllocateCode(::IceUtilInternal::Output&, const ParamDeclList const StringList&, bool = false, bool = false); SLICE_API void writeStreamMarshalUnmarshalCode(::IceUtilInternal::Output&, const TypePtr&, const std::string&, bool, const std::string& = "", bool = false, const StringList& = StringList()); +SLICE_API std::string findMetaData(const SequencePtr&, const StringList&, bool, bool&); SLICE_API std::string findMetaData(const StringList&, bool); SLICE_API bool inWstringModule(const SequencePtr&); diff --git a/cpp/include/Slice/CsUtil.h b/cpp/include/Slice/CsUtil.h index e9acdfc8138..1f046d19e33 100644 --- a/cpp/include/Slice/CsUtil.h +++ b/cpp/include/Slice/CsUtil.h @@ -51,8 +51,8 @@ private: class MetaDataVisitor : public ParserVisitor { public: - MetaDataVisitor(); + virtual bool visitUnitStart(const UnitPtr&); virtual bool visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); virtual void visitClassDecl(const ClassDeclPtr&); @@ -74,8 +74,8 @@ private: void validate(const ContainedPtr&); + std::string _fileName; StringSet _history; - bool _globalMetaDataDone; }; }; diff --git a/cpp/include/Slice/FileTracker.h b/cpp/include/Slice/FileTracker.h index 944774d809b..81261f361d3 100644 --- a/cpp/include/Slice/FileTracker.h +++ b/cpp/include/Slice/FileTracker.h @@ -47,14 +47,23 @@ public: static FileTrackerPtr instance(); + void setSource(const std::string&); + void setOutput(const std::string&, bool); void addFile(const std::string&); void addDirectory(const std::string&); void cleanup(); + void dumpxml(); private: + std::string escape(const std::string&) const; + std::list<std::pair< std::string, bool> > _files; + std::string _source; + std::map<std::string, std::string> _errors; + std::map<std::string, std::list<std::string> > _generated; + std::map<std::string, std::list<std::string> >::iterator _curr; }; } diff --git a/cpp/include/Slice/JavaUtil.h b/cpp/include/Slice/JavaUtil.h index d85ae3cf2bb..3ede63869e8 100644 --- a/cpp/include/Slice/JavaUtil.h +++ b/cpp/include/Slice/JavaUtil.h @@ -81,6 +81,12 @@ protected: const std::string& = std::string(), const std::string& = std::string()) const; + + // + // Returns the package prefix for a give Slice file. + // + std::string getPackagePrefix(const ContainedPtr&) const; + // // Returns the Java package of a Contained entity. // @@ -181,8 +187,7 @@ protected: // bool getDictionaryTypes(const DictionaryPtr&, const std::string&, const StringList&, std::string&, std::string&) const; - bool getSequenceTypes(const SequencePtr&, const std::string&, const StringList&, - std::string&, std::string&) const; + bool getSequenceTypes(const SequencePtr&, const std::string&, const StringList&, std::string&, std::string&) const; virtual JavaOutput* createOutput(); @@ -198,6 +203,7 @@ private: { public: + virtual bool visitUnitStart(const UnitPtr&); virtual bool visitModuleStart(const ModulePtr&); virtual void visitClassDecl(const ClassDeclPtr&); virtual bool visitClassDefStart(const ClassDefPtr&); @@ -223,6 +229,7 @@ private: std::string _dir; ::IceUtilInternal::Output* _out; + mutable std::map<std::string, std::string> _filePackagePrefix; }; } diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h index 4d0aac70b79..a3db93ab5e4 100644 --- a/cpp/include/Slice/Parser.h +++ b/cpp/include/Slice/Parser.h @@ -418,6 +418,7 @@ public: TypeList lookupTypeNoBuiltin(const std::string&, bool = true); ContainedList lookupContained(const std::string&, bool = true); ExceptionPtr lookupException(const std::string&, bool = true); + UnitPtr unit() const; ModuleList modules() const; ClassList classes() const; ExceptionList exceptions() const; @@ -938,6 +939,7 @@ public: void setComment(const std::string&); std::string currentComment(); // Not const, as this function removes the current comment. std::string currentFile() const; + std::string topLevelFile() const; int currentLine() const; void nextLine(); @@ -945,6 +947,7 @@ public: int currentIncludeLevel() const; void addGlobalMetaData(const StringList&); + void setSeenDefinition(); void error(const char*); // Not const, because error count is increased. @@ -960,6 +963,7 @@ public: DefinitionContextPtr currentDefinitionContext() const; void pushDefinitionContext(); void popDefinitionContext(); + DefinitionContextPtr findDefinitionContext(const std::string&) const; void addContent(const ContainedPtr&); void removeContent(const ContainedPtr&); @@ -974,8 +978,16 @@ public: FeatureProfile profile() const; + // + // Returns the path names of the files included directly by the top-level file. + // StringList includeFiles() const; - + + // + // Returns the path names of all files parsed by this unit. + // + StringList allFiles() const; + int parse(const std::string&, FILE*, bool, FeatureProfile profile = Ice); virtual void destroy(); @@ -992,20 +1004,20 @@ private: bool _all; bool _allowIcePrefix; bool _caseSensitive; - StringList _defaultGlobalMetadata; + StringList _defaultGlobalMetaData; int _errors; std::string _currentComment; int _currentLine; int _currentIncludeLevel; std::string _currentFile; std::string _topLevelFile; - std::map<std::string, std::string> _fullPaths; std::stack<DefinitionContextPtr> _definitionContextStack; StringList _includeFiles; std::stack<ContainerPtr> _containerStack; std::map<Builtin::Kind, BuiltinPtr> _builtins; std::map<std::string, ContainedList> _contentMap; FeatureProfile _featureProfile; + std::map<std::string, DefinitionContextPtr> _definitionContextMap; }; extern SLICE_API Unit* unit; // The current parser for bison/flex diff --git a/cpp/include/Slice/Preprocessor.h b/cpp/include/Slice/Preprocessor.h index 54535e28812..23458bccfbb 100644 --- a/cpp/include/Slice/Preprocessor.h +++ b/cpp/include/Slice/Preprocessor.h @@ -32,15 +32,15 @@ class SLICE_API Preprocessor { public: - Preprocessor(const std::string&, const std::string&, const std::vector<std::string>&, const std::string& = "cpp"); + Preprocessor(const std::string&, const std::string&, const std::vector<std::string>&); ~Preprocessor(); FILE* preprocess(bool); bool close(); - enum Language { CPlusPlus, Java, CSharp, VisualBasic }; + enum Language { CPlusPlus, Java, JavaXML, CSharp, VisualBasic }; - bool printMakefileDependencies(Language, const std::vector<std::string>&); + bool printMakefileDependencies(Language, const std::vector<std::string>&, const std::string& = "cpp"); std::string getBaseName(); @@ -54,7 +54,6 @@ private: const std::string _path; const std::string _fileName; const std::vector<std::string> _args; - const std::string _cppSourceExt; #ifdef _WIN32 std::wstring _cppFile; #else diff --git a/cpp/include/Slice/Util.h b/cpp/include/Slice/Util.h index 1e645595ea4..76c5a27d6f3 100644 --- a/cpp/include/Slice/Util.h +++ b/cpp/include/Slice/Util.h @@ -17,7 +17,14 @@ namespace Slice SLICE_API std::string fullPath(const std::string&); SLICE_API std::string changeInclude(const std::string&, const std::vector<std::string>&); - +SLICE_API void setErrorStream(std::ostream&); +SLICE_API std::ostream& getErrorStream(); +SLICE_API void emitError(const std::string&, int, const std::string&); +SLICE_API void emitWarning(const std::string&, int, const std::string&); +SLICE_API void emitError(const std::string&, const std::string&, const std::string&); +SLICE_API void emitWarning(const std::string&, const std::string&, const std::string&); +SLICE_API void emitRaw(const char*); +SLICE_API std::vector<std::string> filterMcppWarnings(const std::string&); } #endif |