mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-24 15:54:13 +01:00
b0581433a7
fix: remove executable flag and change back to 100644 (was 100755) Signed-off-by: Roger Meier <r.meier@siemens.com>
95 lines
1.7 KiB
C++
95 lines
1.7 KiB
C++
//
|
|
// Variable.h
|
|
//
|
|
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Variable.h#1 $
|
|
//
|
|
// Library: CppParser
|
|
// Package: SymbolTable
|
|
// Module: Variable
|
|
//
|
|
// Definition of the Variable class.
|
|
//
|
|
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#ifndef CppParser_Variable_INCLUDED
|
|
#define CppParser_Variable_INCLUDED
|
|
|
|
|
|
#include "Poco/CppParser/CppParser.h"
|
|
#include "Poco/CppParser/Decl.h"
|
|
|
|
|
|
namespace Poco {
|
|
namespace CppParser {
|
|
|
|
|
|
class CppParser_API Variable: public Decl
|
|
/// This class represents (member) variable declaration.
|
|
{
|
|
public:
|
|
enum Flags
|
|
{
|
|
VAR_STATIC = 1, /// The variable is static.
|
|
VAR_MUTABLE = 2, /// The variable is mutable.
|
|
VAR_VOLATILE = 4, /// The variable is volatile.
|
|
VAR_CONST = 8 /// The variable is const.
|
|
};
|
|
|
|
Variable(const std::string& decl, NameSpace* pNameSpace);
|
|
/// Creates the Variable.
|
|
|
|
~Variable();
|
|
/// Destroys the Variable.
|
|
|
|
int flags() const;
|
|
/// Returns the variable's flags.
|
|
|
|
bool isPointer() const;
|
|
/// Returns true iff the variable holds a pointer.
|
|
|
|
Symbol::Kind kind() const;
|
|
|
|
const std::string& declType() const;
|
|
/// Returns the type of the parameter without const and & if present.
|
|
///
|
|
/// Example: a type const std::string& -> std::string, a type const std::string* returns std::string
|
|
|
|
|
|
private:
|
|
int _flags;
|
|
bool _isPointer;
|
|
std::string _type;
|
|
};
|
|
|
|
|
|
//
|
|
// inlines
|
|
//
|
|
inline int Variable::flags() const
|
|
{
|
|
return _flags;
|
|
}
|
|
|
|
|
|
inline bool Variable::isPointer() const
|
|
{
|
|
return _isPointer;
|
|
}
|
|
|
|
|
|
inline const std::string& Variable::declType() const
|
|
{
|
|
return _type;
|
|
}
|
|
|
|
|
|
} } // namespace Poco::CppParser
|
|
|
|
|
|
#endif // CppParser_Variable_INCLUDED
|