mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 02:18:04 +01:00
add support for typed enums and deleted functions
This commit is contained in:
@@ -52,6 +52,13 @@ public:
|
||||
/// in the form #AnonEnum<n> (where <n> is a unique integer)
|
||||
/// will be assigned.
|
||||
|
||||
Enum(const std::string& name, NameSpace* pNameSpace, const std::string& baseType, int flags = 0);
|
||||
/// Creates the Enum.
|
||||
///
|
||||
/// If name is the empty string, an internal name
|
||||
/// in the form #AnonEnum<n> (where <n> is a unique integer)
|
||||
/// will be assigned.
|
||||
|
||||
~Enum();
|
||||
/// Destroys the Enum.
|
||||
|
||||
@@ -64,7 +71,11 @@ public:
|
||||
Iterator end() const;
|
||||
/// Returns an iterator for iterating over the Enum's EnumValue's.
|
||||
|
||||
const std::string& baseType() const;
|
||||
/// Returns the base type or an empty string if no base type has been specified.
|
||||
|
||||
int flags() const;
|
||||
/// Returns the flags.
|
||||
|
||||
Symbol::Kind kind() const;
|
||||
std::string toString() const;
|
||||
@@ -74,6 +85,7 @@ protected:
|
||||
|
||||
private:
|
||||
Values _values;
|
||||
std::string _baseType;
|
||||
int _flags;
|
||||
static int _count;
|
||||
};
|
||||
@@ -82,6 +94,12 @@ private:
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline const std::string& Enum::baseType() const
|
||||
{
|
||||
return _baseType;
|
||||
}
|
||||
|
||||
|
||||
inline int Enum::flags() const
|
||||
{
|
||||
return _flags;
|
||||
|
||||
@@ -113,6 +113,12 @@ public:
|
||||
bool isConst() const;
|
||||
/// Returns true iff the method is const.
|
||||
|
||||
bool isDefault() const;
|
||||
/// Returns true iff the method has a default implementation.
|
||||
|
||||
bool isDeleted() const;
|
||||
/// Returns true iff the method has been deleted.
|
||||
|
||||
int countParameters() const;
|
||||
/// Returns the number of parameters.
|
||||
|
||||
@@ -160,6 +166,18 @@ inline bool Function::isConst() const
|
||||
}
|
||||
|
||||
|
||||
inline bool Function::isDefault() const
|
||||
{
|
||||
return (flags() & FN_DEFAULT) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool Function::isDeleted() const
|
||||
{
|
||||
return (flags() & FN_DELETE) != 0;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::CppParser
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user