satisfy all compilers

This commit is contained in:
Steve Hanson 2021-03-11 16:53:05 +00:00
parent 8768b5b1d6
commit 32722fa31d
2 changed files with 16 additions and 16 deletions

View File

@ -1831,7 +1831,7 @@ private:
const PointerType relPointer(s, len, allocator_);
if (relPointer.IsValid()) {
// Get the subschema
if (const ValueType *v = relPointer.Get(*base)) {
if (const ValueType *pv = relPointer.Get(*base)) {
// Now get the absolute JSON pointer by adding relative to base
PointerType pointer(basePointer);
for (SizeType i = 0; i < relPointer.GetTokenCount(); i++)
@ -1842,7 +1842,7 @@ private:
// Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there
// TODO: cache pointer <-> id mapping
scopeId = pointer.GetUri(document, docId_);
CreateSchema(schema, pointer, *v, document, scopeId);
CreateSchema(schema, pointer, *pv, document, scopeId);
return true;
}
}
@ -1852,14 +1852,14 @@ private:
// See if the fragment matches an id in this document.
// Search from the base we just established. Returns the subschema in the document and its absolute JSON pointer.
PointerType pointer = PointerType();
if (const ValueType *v = FindId(*base, ref, pointer, UriType(ref.GetBase()), true, basePointer)) {
if (v && !IsCyclicRef(pointer)) {
if (const ValueType *pv = FindId(*base, ref, pointer, UriType(ref.GetBase()), true, basePointer)) {
if (!IsCyclicRef(pointer)) {
//GenericStringBuffer<EncodingType> sb;
//pointer.StringifyUriFragment(sb);
// Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there
// TODO: cache pointer <-> id mapping
scopeId = pointer.GetUri(document, docId_);
CreateSchema(schema, pointer, *v, document, scopeId);
CreateSchema(schema, pointer, *pv, document, scopeId);
return true;
}
}

View File

@ -34,18 +34,18 @@ public:
typedef std::basic_string<Ch> String;
// Constructors
GenericUri() {}
GenericUri() : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() {}
GenericUri(const String& uri) {
GenericUri(const String& uri) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() {
Parse(uri);
}
GenericUri(const Ch* uri, SizeType len) {
GenericUri(const Ch* uri, SizeType len) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() {
Parse(String(uri, len));
}
// Use with specializations of GenericValue
template<typename T> GenericUri(const T& uri) {
template<typename T> GenericUri(const T& uri) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_() {
Parse(uri.template Get<String>());
}
@ -236,13 +236,13 @@ private:
//std::cout << "Final Temp: '" << temp.c_str() << "' Final Path: '" << path.c_str() << "'" << std::endl;
}
String uri_ = String(); // Full uri
String base_ = String(); // Everything except fragment
String scheme_ = String(); // Includes the :
String auth_ = String(); // Includes the //
String path_ = String(); // Absolute if starts with /
String query_ = String(); // Includes the ?
String frag_ = String(); // Includes the #
String uri_; // Full uri
String base_; // Everything except fragment
String scheme_; // Includes the :
String auth_; // Includes the //
String path_; // Absolute if starts with /
String query_; // Includes the ?
String frag_; // Includes the #
};
//! GenericUri for Value (UTF-8, default allocator).