clang API Documentation

Classes | Public Member Functions
clang::ast_matchers::dynamic::VariantValue Class Reference

Variant value class. More...

#include <VariantValue.h>

List of all members.

Classes

union  AllValues
 All supported value types.

Public Member Functions

 VariantValue ()
 VariantValue (const VariantValue &Other)
 ~VariantValue ()
VariantValueoperator= (const VariantValue &Other)
 VariantValue (unsigned Unsigned)
 Specific constructors for each supported type.
 VariantValue (const std::string &String)
 VariantValue (const VariantMatcher &Matchers)
LLVM_EXPLICIT operator bool () const
 Returns true iff this is not an empty value.
bool hasValue () const
bool isUnsigned () const
 Unsigned value functions.
unsigned getUnsigned () const
void setUnsigned (unsigned Unsigned)
bool isString () const
 String value functions.
const std::string & getString () const
void setString (const std::string &String)
bool isMatcher () const
 Matcher value functions.
const VariantMatchergetMatcher () const
void setMatcher (const VariantMatcher &Matcher)
bool isConvertibleTo (ArgKind Kind, unsigned *Specificity) const
 Determines if the contained value can be converted to Kind.
bool isConvertibleTo (ArrayRef< ArgKind > Kinds, unsigned *Specificity) const
 Determines if the contained value can be converted to any kind in Kinds.
std::string getTypeAsString () const
 String representation of the type of the value.

Detailed Description

Variant value class.

Basically, a tagged union with value type semantics. It is used by the registry as the return value and argument type for the matcher factory methods. It can be constructed from any of the supported types. It supports copy/assignment.

Supported types:

Definition at line 247 of file VariantValue.h.


Constructor & Destructor Documentation

Definition at line 249 of file VariantValue.h.

Definition at line 244 of file VariantValue.cpp.

Definition at line 260 of file VariantValue.cpp.

Specific constructors for each supported type.

Definition at line 248 of file VariantValue.cpp.

References setUnsigned().

Definition at line 252 of file VariantValue.cpp.

References setString().

Definition at line 256 of file VariantValue.cpp.

References setMatcher().


Member Function Documentation

Definition at line 302 of file VariantValue.cpp.

References isUnsigned().

Referenced by operator=().

Definition at line 262 of file VariantValue.h.

Referenced by operator bool().

bool clang::ast_matchers::dynamic::VariantValue::isConvertibleTo ( ArrayRef< ArgKind Kinds,
unsigned Specificity 
) const

Determines if the contained value can be converted to any kind in Kinds.

Parameters:
Kindsthe requested destination types.
Specificityvalue corresponding to the "specificity" of the convertion. It is the maximum specificity of all the possible conversions.

Definition at line 365 of file VariantValue.cpp.

References isConvertibleTo().

Unsigned value functions.

Definition at line 298 of file VariantValue.cpp.

Referenced by getUnsigned(), clang::ast_matchers::dynamic::internal::ArgTypeTraits< unsigned >::is(), and isConvertibleTo().

LLVM_EXPLICIT clang::ast_matchers::dynamic::VariantValue::operator bool ( ) const [inline]

Returns true iff this is not an empty value.

Definition at line 261 of file VariantValue.h.

References hasValue().

VariantValue & clang::ast_matchers::dynamic::VariantValue::operator= ( const VariantValue Other)

Definition at line 337 of file VariantValue.cpp.

Referenced by operator=(), and VariantValue().

void clang::ast_matchers::dynamic::VariantValue::setString ( const std::string &  String)

Definition at line 322 of file VariantValue.cpp.

Referenced by operator=(), and VariantValue().

Definition at line 307 of file VariantValue.cpp.

Referenced by operator=(), and VariantValue().


The documentation for this class was generated from the following files: