LLVM
8.0.1
|
Classes | |
class | Array |
An Array is a JSON array, which contains heterogeneous JSON values. More... | |
class | Object |
An Object is a JSON object, which maps strings to heterogenous JSON values. More... | |
class | ObjectKey |
ObjectKey is a used to capture keys in Object. More... | |
class | ObjectMapper |
Helper for mapping JSON objects onto protocol structs. More... | |
class | ParseError |
class | Value |
A Value is an JSON value of unknown type. More... | |
std::string llvm::json::fixUTF8 | ( | llvm::StringRef | S | ) |
Replaces invalid UTF-8 sequences in S
with the replacement character (U+FFFD).
The returned string is valid UTF-8. This is much slower than isUTF8, so test that first.
Definition at line 547 of file JSON.cpp.
References llvm::ConvertUTF32toUTF8(), llvm::ConvertUTF8toUTF32(), llvm::StringRef::data(), llvm::lenientConversion, llvm::StringRef::size(), and llvm::strictConversion.
Referenced by llvm::json::ObjectKey::ObjectKey(), and llvm::json::Value::Value().
Definition at line 566 of file JSON.h.
References llvm::json::Value::getAsString().
Referenced by fromJSON(), and llvm::json::ObjectMapper::map().
Definition at line 573 of file JSON.h.
References llvm::json::Value::getAsInteger().
Definition at line 580 of file JSON.h.
References llvm::json::Value::getAsInteger().
Definition at line 587 of file JSON.h.
References llvm::json::Value::getAsNumber().
Definition at line 594 of file JSON.h.
References llvm::json::Value::getAsBoolean().
bool llvm::json::fromJSON | ( | const Value & | E, |
llvm::Optional< T > & | Out | ||
) |
Definition at line 601 of file JSON.h.
References fromJSON(), llvm::json::Value::getAsNull(), and llvm::None.
Definition at line 612 of file JSON.h.
References fromJSON(), llvm::json::Value::getAsArray(), and I.
bool llvm::json::fromJSON | ( | const Value & | E, |
std::map< std::string, T > & | Out | ||
) |
Definition at line 624 of file JSON.h.
References fromJSON(), llvm::json::Value::getAsObject(), and llvm::RISCVFenceField::O.
bool llvm::json::isUTF8 | ( | llvm::StringRef | S, |
size_t * | ErrOffset = nullptr |
||
) |
Returns true if S
is valid UTF-8, which is required for use as JSON.
If it returns false, Offset
is set to a byte offset near the first error.
Definition at line 533 of file JSON.cpp.
References llvm::Data, llvm::StringRef::data(), llvm::isASCII(), llvm::isLegalUTF8String(), LLVM_LIKELY, and llvm::StringRef::size().
Referenced by llvm::json::ObjectKey::ObjectKey(), and llvm::json::Value::Value().
Definition at line 488 of file JSON.h.
References operator<<().
llvm::raw_ostream & llvm::json::operator<< | ( | llvm::raw_ostream & | OS, |
const Value & | E | ||
) |
The formatting is compact (no extra whitespace) and deterministic. For pretty-printing, use the formatv() format_provider below.
Definition at line 696 of file JSON.cpp.
Referenced by llvm::json::Value::getAsArray(), and operator!=().
Definition at line 81 of file JSON.cpp.
References llvm::json::Object::end(), llvm::json::Object::find(), and llvm::json::Object::size().
Referenced by llvm::json::Object::find().
Definition at line 176 of file JSON.cpp.
References llvm::json::Value::Array, llvm::json::Value::Boolean, llvm::json::Value::getAsArray(), llvm::json::Value::getAsBoolean(), llvm::json::Value::getAsInteger(), llvm::json::Value::getAsNull(), llvm::json::Value::getAsNumber(), llvm::json::Value::getAsObject(), llvm::json::Value::getAsString(), llvm::json::Value::kind(), llvm_unreachable, llvm::json::Value::Null, llvm::json::Value::Number, llvm::json::Value::Object, and llvm::json::Value::String.
Expected< Value > llvm::json::parse | ( | llvm::StringRef | JSON | ) |
Parses the provided JSON source, or returns a ParseError.
The returned Value is self-contained and owns its strings (they do not refer to the original source).
Definition at line 511 of file JSON.cpp.
Referenced by llvm::DWARFDebugLine::LineTable::appendSequence(), llvm::DWARFDebugAbbrev::begin(), llvm::DWARFDebugAbbrev::dump(), llvm::AMDGPULibFunc::getFunctionType(), llvm::DWARFDebugLine::Prologue::getMaxLineIncrementForSpecialOpcode(), llvm::json::ObjectMapper::map(), nodeListToNodeArray(), llvm::SymbolRewriter::RewriteMapParser::parse(), llvm::object::parseCOFFModuleDefinition(), llvm::cl::parser< bool >::parser(), llvm::cl::parser< boolOrDefault >::parser(), llvm::cl::parser< int >::parser(), llvm::cl::parser< unsigned >::parser(), llvm::cl::parser< unsigned long long >::parser(), llvm::cl::parser< double >::parser(), llvm::cl::parser< float >::parser(), llvm::itanium_demangle::AbstractManglingParser< ManglingParser< Alloc >, Alloc >::resolveForwardTemplateRefs(), and toString().
|
static |
Definition at line 522 of file JSON.cpp.
References E, and llvm::sort().
Value llvm::json::toJSON | ( | const llvm::Optional< T > & | Opt | ) |
Definition at line 636 of file JSON.h.
Referenced by llvm::json::Value::Value().