LLVM  4.0.0
Public Member Functions | Static Public Member Functions | List of all members
llvm::yaml::KeyValueNode Class Referencefinal

A key and value pair. More...

#include <YAMLParser.h>

Inheritance diagram for llvm::yaml::KeyValueNode:
[legend]
Collaboration diagram for llvm::yaml::KeyValueNode:
[legend]

Public Member Functions

 KeyValueNode (std::unique_ptr< Document > &D)
 
NodegetKey ()
 Parse and return the key. More...
 
NodegetValue ()
 Parse and return the value. More...
 
void skip () override
 
- Public Member Functions inherited from llvm::yaml::Node
 Node (unsigned int Type, std::unique_ptr< Document > &, StringRef Anchor, StringRef Tag)
 
StringRef getAnchor () const
 Get the value of the anchor attached to this node. More...
 
StringRef getRawTag () const
 Get the tag as it was written in the document. More...
 
std::string getVerbatimTag () const
 Get the verbatium tag for a given Node. More...
 
SMRange getSourceRange () const
 
void setSourceRange (SMRange SR)
 
TokenpeekNext ()
 
Token getNext ()
 
NodeparseBlockNode ()
 
BumpPtrAllocatorgetAllocator ()
 
void setError (const Twine &Message, Token &Location) const
 
bool failed () const
 
unsigned int getType () const
 
void * operator new (size_t Size, BumpPtrAllocator &Alloc, size_t Alignment=16) noexcept
 
void operator delete (void *Ptr, BumpPtrAllocator &Alloc, size_t Size) noexcept
 

Static Public Member Functions

static bool classof (const Node *N)
 

Additional Inherited Members

- Public Types inherited from llvm::yaml::Node
enum  NodeKind {
  NK_Null, NK_Scalar, NK_BlockScalar, NK_KeyValue,
  NK_Mapping, NK_Sequence, NK_Alias
}
 
- Protected Member Functions inherited from llvm::yaml::Node
void operator delete (void *) noexcept=delete
 
 ~Node ()=default
 
- Protected Attributes inherited from llvm::yaml::Node
std::unique_ptr< Document > & Doc
 
SMRange SourceRange
 

Detailed Description

A key and value pair.

While not technically a Node under the YAML representation graph, it is easier to treat them this way.

TODO: Consider making this not a child of Node.

Example: Section: .text

Definition at line 266 of file YAMLParser.h.

Constructor & Destructor Documentation

llvm::yaml::KeyValueNode::KeyValueNode ( std::unique_ptr< Document > &  D)
inline

Definition at line 270 of file YAMLParser.h.

Member Function Documentation

static bool llvm::yaml::KeyValueNode::classof ( const Node N)
inlinestatic

Definition at line 294 of file YAMLParser.h.

References llvm::yaml::Node::getType(), and llvm::yaml::Node::NK_KeyValue.

Node * KeyValueNode::getKey ( )

Parse and return the key.

This may be called multiple times.

Returns
The key, or nullptr if failed() == true.

Definition at line 2032 of file YAMLParser.cpp.

References llvm::yaml::Token::Kind, and t.

Referenced by skip().

Node * KeyValueNode::getValue ( )

Parse and return the value.

This may be called multiple times.

Returns
The value, or nullptr if failed() == true.

Definition at line 2057 of file YAMLParser.cpp.

References llvm::yaml::Token::Kind, and t.

Referenced by skip().

void llvm::yaml::KeyValueNode::skip ( )
inlineoverridevirtual

Reimplemented from llvm::yaml::Node.

Definition at line 288 of file YAMLParser.h.

References getKey(), getValue(), and llvm::yaml::Node::skip().


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