Class CIdlCompilerEnvironment#
Defined in File environment.h
Inheritance Relationships#
Base Types#
public sdv::idl::ICompilerOption
(Struct ICompilerOption)public sdv::IInterfaceAccess
(Struct IInterfaceAccess)
Class Documentation#
-
class CIdlCompilerEnvironment : public sdv::idl::ICompilerOption, public sdv::IInterfaceAccess#
Parser environment management class.
Unnamed Group
-
inline bool InterfaceTypeExtension() const#
Extensions.
- Returns:
Returns true when the extension is enabled; false when not.
-
inline bool ExceptionTypeExtension() const#
Extensions.
- Returns:
Returns true when the extension is enabled; false when not.
-
inline bool PointerTypeExtension() const#
Extensions.
- Returns:
Returns true when the extension is enabled; false when not.
-
inline bool UnicodeExtension() const#
Extensions.
- Returns:
Returns true when the extension is enabled; false when not.
-
inline bool CaseSensitiveTypeExtension() const#
Extensions.
- Returns:
Returns true when the extension is enabled; false when not.
-
inline bool ContextDependentNamesExtension() const#
Extensions.
- Returns:
Returns true when the extension is enabled; false when not.
-
inline bool MultiDimArrayExtension() const#
Extensions.
- Returns:
Returns true when the extension is enabled; false when not.
Public Functions
-
CIdlCompilerEnvironment()#
Default constructor.
-
CIdlCompilerEnvironment(const std::vector<std::string> &rvecArgs)#
Constructor with program arguments.
- Parameters:
rvecArgs – [in] Reference to the vector with program arguments
-
template<typename TCharType>
CIdlCompilerEnvironment(size_t nArgs, const TCharType **rgszArgs)# Constructor with program arguments.
- Template Parameters:
TCharType – Character type.
- Parameters:
nArgs – [in] The amount of arguments.
rgszArgs – [in] Array of arguments.
-
virtual sdv::interface_t GetInterface(sdv::interface_id idInterface) override#
Get access to another interface. Overload of IInterfaceAccess::GetInterface.
- Parameters:
idInterface – [in] The interface id to get access to.
- Returns:
Returns a pointer to the interface or NULL when the interface is not supported.
-
std::filesystem::path GetNextFile()#
Get the path of the next file.
- Returns:
Returns the path to the next file or an empty path.
-
inline bool Help() const#
Help was requested on the command line.
- Returns:
Returns ‘true’ when help was requested. Otherwise returns ‘false’.
-
inline void ShowHelp() const#
Show command line help.
-
inline bool Version() const#
Version information was requested on the command line.
- Returns:
Returns ‘true’ when version info was requested. Otherwise returns ‘false’.
-
inline const std::vector<std::filesystem::path> &GetIncludeDirs() const#
Get the vector of include directories.
- Returns:
Reference to the vector of include directories.
-
inline std::filesystem::path GetOutputDir() const#
Get the output directory.
- Returns:
The output directory.
-
void AddDefinition(const char *szDefinition)#
Add macro definition in the form of name, name=value or name(arg1, arg2, arg3)=value.
- Parameters:
szDefinition – [in] The definition string
-
void AddDefinition(const CToken &rtoken, const CMacro &rMacro)#
Add macro definition.
- Parameters:
rtoken – [in] Token in the source file of the provided macro.
rMacro – [in] Reference to the macro to add.
-
void RemoveDefinition(const char *szMacro)#
Remove macro definition.
Remark
If the macro doesn::t exists, doesn’t do anything.
- Parameters:
szMacro – [in] The name of the macro.
-
bool Defined(const char *szMacro) const#
Check whether a macro definition exists.
- Parameters:
szMacro – [in] The name of the macro.
- Returns:
Returns ‘true’ when the definition exists; ‘false’ otherwise.
-
bool TestAndExpand(const std::string &rssIdentifier, CCodePos &rcode, bool bInMacroExpansion, CUsedMacroSet &rsetPreviousExpanded) const#
Test for a macro and replace the code.
This function will check for the existence of the macro with the supplied name. If it does, it will read any parameter from the code (depends on whether the macro needs parameters) and create a string with the filled in parameters. This string, then, is prepended to the code replacing the identifiert and its optional parameters. Reparsing of the code needs to take place - the return value is ‘true’. If there is no macro with the supplied name, the return value is ‘false’ and the supplied identifier is to be treated as an identifier. Macro parameters can have commas if they are parenthesized before. The value can have the ‘#’ unary operator to stringificate the following parameter and the ‘##’ operator to join the preceding or succeeding operator to the adjacent identifier.
- Parameters:
rssIdentifier – [in] Reference to the string object containing the name of the identifier to test for macro definition.
rcode – [inout] The code holding the potential parameters and to be replaced and prepended with the resolved macro.
bInMacroExpansion – [in] Set ‘true’ when the identifier was the (part) result of a macro expansion. If this is the case, previously used macros cannot be reused - to prevent circular expansion.
rsetPreviousExpanded – [inout] Reference to the set of previously expanded macros, preventing circular expansion. If the used macro set is empty, use the default set of the environment. This set will b eextended with macros used within the macro expansion.
- Returns:
Returns ‘true’ if macro replacement was successful, or ‘false’ when the identifier is not a macro.
-
inline bool TestAndExpand(const std::string &rssIdentifier, CCodePos &rcode, bool bInMacroExpansion = false) const#
Test for a macro and replace the code.
This function will check for the existence of the macro with the supplied name. If it does, it will read any parameter from the code (depends on whether the macro needs parameters) and create a string with the filled in parameters. This string, then, is prepended to the code replacing the identifiert and its optional parameters. Reparsing of the code needs to take place - the return value is ‘true’. If there is no macro with the supplied name, the return value is ‘false’ and the supplied identifier is to be treated as an identifier. Macro parameters can have commas if they are parenthesized before. The value can have the ‘#’ unary operator to stringificate the following parameter and the ‘##’ operator to join the preceding or succeeding operator to the adjacent identifier.
- Parameters:
rssIdentifier – [in] Reference to the string object containing the name of the identifier to test for macro definition.
rcode – [inout] The code holding the potential parameters and to be replaced and prepended with the resolved macro.
bInMacroExpansion – [in] Set ‘true’ when the identifier was the (part) result of a macro expansion. If this is the case, previously used macros cannot be reused - to prevent circular expansion.
- Returns:
Returns ‘true’ if macro replacement was successful, or ‘false’ when the identifier is not a macro.
-
bool ResolveConst() const#
Resolve const expressions.
- Returns:
Returns ‘true’ when const expressions should be resolved. Otherwise the expression should be exported during code generation.
-
bool NoProxyStub() const#
Suppress the generation of proxy and stub code.
- Returns:
Returns ‘true’ when proxy stub code should not be generated. Otherwise the proxy and stub code should be generated.
-
const std::string &GetProxStubCMakeTarget() const#
Get library target name for the proxy stub cmake file.
- Returns:
Returns a reference to the target name if set in the command line or an empty string otherwise.
-
virtual sdv::u8string GetOption(const sdv::u8string &rssOption) const override#
Get the compiler option. Overload of sdv::idl::ICompilerOption::GetOption.
- Parameters:
rssOption – [in] Reference to the string containing the name of the option to retrieve.
- Returns:
The requested compiler option (if available).
-
virtual uint32_t GetOptionCnt(const sdv::u8string &rssOption) const override#
Get the amount of option values. Overload of sdv::idl::ICompilerOption::GetOptionCnt.
- Parameters:
rssOption – [in] Reference to the string containing the name of the option to retrieve.
- Returns:
The amount of option values.
-
virtual sdv::u8string GetOptionN(const sdv::u8string &rssOption, uint32_t uiIndex) const override#
Get the compiler option. Overload of sdv::idl::ICompilerOption::GetOptionN.
- Parameters:
rssOption – [in] Reference to the string containing the name of the option to retrieve.
uiIndex – [in] The index of the option value.
- Returns:
The requested compiler option value.
-
inline bool InterfaceTypeExtension() const#