template <typename U>
static double test(...);
-public:
static bool const value =
(sizeof(test<ScalarEnumerationTraits<T>>(nullptr)) == 1);
};
template <typename U>
static double test(...);
-public:
static bool const value = (sizeof(test<ScalarBitSetTraits<T>>(nullptr)) == 1);
};
template <typename U>
static double test(...);
-public:
static bool const value =
(sizeof(test<ScalarTraits<T>>(nullptr, nullptr, nullptr)) == 1);
};
template <typename U>
static double test(...);
-public:
static bool const value =
(sizeof(test<BlockScalarTraits<T>>(nullptr, nullptr)) == 1);
};
template <typename U>
static double test(...);
-public:
static bool const value =
(sizeof(test<MappingContextTraits<T, Context>>(nullptr)) == 1);
};
template <typename U> static double test(...);
-public:
static bool const value = (sizeof(test<MappingTraits<T>>(nullptr)) == 1);
};
template <typename U>
static double test(...);
-public:
static bool const value =
(sizeof(test<MappingContextTraits<T, Context>>(nullptr)) == 1);
};
template <typename U> static double test(...);
-public:
static bool const value = (sizeof(test<MappingTraits<T>>(nullptr)) == 1);
};
template <typename U>
static double test(...);
-public:
static bool const value = (sizeof(test<SequenceTraits<T>>(nullptr)) == 1);
};
template <typename U>
static double test(...);
-public:
static bool const value =
(sizeof(test<CustomMappingTraits<T>>(nullptr)) == 1);
};
template<typename C>
static char (&f(...))[2];
-public:
static bool const value = sizeof(f<Derived>(nullptr)) == 2;
};
template <typename U>
static double test(...);
-public:
static bool const value = (sizeof(test<DocumentListTraits<T>>(nullptr))==1);
};
++DocIterator;
return setCurrentDocument();
}
- TopNode = this->createHNodes(N);
+ TopNode = createHNodes(N);
CurrentNode = TopNode.get();
return true;
}
void Input::setError(HNode *hnode, const Twine &message) {
assert(hnode && "HNode must not be NULL");
- this->setError(hnode->_node, message);
+ setError(hnode->_node, message);
}
void Input::setError(Node *node, const Twine &message) {
} else if (SequenceNode *SQ = dyn_cast<SequenceNode>(N)) {
auto SQHNode = llvm::make_unique<SequenceHNode>(N);
for (Node &SN : *SQ) {
- auto Entry = this->createHNodes(&SN);
+ auto Entry = createHNodes(&SN);
if (EC)
break;
SQHNode->Entries.push_back(std::move(Entry));
// Copy string to permanent storage
KeyStr = StringStorage.str().copy(StringAllocator);
}
- auto ValueHNode = this->createHNodes(Value);
+ auto ValueHNode = createHNodes(Value);
if (EC)
break;
mapHNode->Mapping[KeyStr] = std::move(ValueHNode);
}
void Input::setError(const Twine &Message) {
- this->setError(CurrentNode, Message);
+ setError(CurrentNode, Message);
}
bool Input::canElideEmptySequence() {
StateStack.size() > 1 && (StateStack[StateStack.size() - 2] == inSeq ||
StateStack[StateStack.size() - 2] == inFlowSeq);
if (SequenceElement && StateStack.back() == inMapFirstKey) {
- this->newLineCheck();
+ newLineCheck();
} else {
- this->output(" ");
+ output(" ");
}
- this->output(Tag);
+ output(Tag);
if (SequenceElement) {
// If we're writing the tag during the first element of a map, the tag
// takes the place of the first element in the sequence.
if (State == inFlowMapFirstKey || State == inFlowMapOtherKey) {
flowKey(Key);
} else {
- this->newLineCheck();
- this->paddedKey(Key);
+ newLineCheck();
+ paddedKey(Key);
}
return true;
}
void Output::beginFlowMapping() {
StateStack.push_back(inFlowMapFirstKey);
- this->newLineCheck();
+ newLineCheck();
ColumnAtMapFlowStart = Column;
output("{ ");
}
void Output::endFlowMapping() {
StateStack.pop_back();
- this->outputUpToEndOfLine(" }");
+ outputUpToEndOfLine(" }");
}
void Output::beginDocuments() {
- this->outputUpToEndOfLine("---");
+ outputUpToEndOfLine("---");
}
bool Output::preflightDocument(unsigned index) {
if (index > 0)
- this->outputUpToEndOfLine("\n---");
+ outputUpToEndOfLine("\n---");
return true;
}
unsigned Output::beginFlowSequence() {
StateStack.push_back(inFlowSeq);
- this->newLineCheck();
+ newLineCheck();
ColumnAtFlowStart = Column;
output("[ ");
NeedFlowSequenceComma = false;
void Output::endFlowSequence() {
StateStack.pop_back();
- this->outputUpToEndOfLine(" ]");
+ outputUpToEndOfLine(" ]");
}
bool Output::preflightFlowElement(unsigned, void *&) {
bool Output::matchEnumScalar(const char *Str, bool Match) {
if (Match && !EnumerationMatchFound) {
- this->newLineCheck();
- this->outputUpToEndOfLine(Str);
+ newLineCheck();
+ outputUpToEndOfLine(Str);
EnumerationMatchFound = true;
}
return false;
}
bool Output::beginBitSetScalar(bool &DoClear) {
- this->newLineCheck();
+ newLineCheck();
output("[ ");
NeedBitValueComma = false;
DoClear = false;
if (Matches) {
if (NeedBitValueComma)
output(", ");
- this->output(Str);
+ output(Str);
NeedBitValueComma = true;
}
return false;
}
void Output::endBitSetScalar() {
- this->outputUpToEndOfLine(" ]");
+ outputUpToEndOfLine(" ]");
}
void Output::scalarString(StringRef &S, QuotingType MustQuote) {
- this->newLineCheck();
+ newLineCheck();
if (S.empty()) {
// Print '' for the empty string because leaving the field empty is not
// allowed.
- this->outputUpToEndOfLine("''");
+ outputUpToEndOfLine("''");
return;
}
if (MustQuote == QuotingType::None) {
// Only quote if we must.
- this->outputUpToEndOfLine(S);
+ outputUpToEndOfLine(S);
return;
}
// escapes. This is handled in yaml::escape.
if (MustQuote == QuotingType::Double) {
output(yaml::escape(Base, /* EscapePrintable= */ false));
- this->outputUpToEndOfLine(Quote);
+ outputUpToEndOfLine(Quote);
return;
}
++j;
}
output(StringRef(&Base[i], j - i));
- this->outputUpToEndOfLine(Quote); // Ending quote.
+ outputUpToEndOfLine(Quote); // Ending quote.
}
void Output::blockScalarString(StringRef &S) {
}
void Output::outputUpToEndOfLine(StringRef s) {
- this->output(s);
+ output(s);
if (StateStack.empty() || (StateStack.back() != inFlowSeq &&
StateStack.back() != inFlowMapFirstKey &&
StateStack.back() != inFlowMapOtherKey))
return;
NeedsNewLine = false;
- this->outputNewLine();
+ outputNewLine();
assert(StateStack.size() > 0);
unsigned Indent = StateStack.size() - 1;