mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Merge topic 'jsonstate-plist'
44d8022322 cmPListParser: Use cmJSONState to read plist
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12365
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <cm3p/json/reader.h>
|
||||
#include <cm3p/json/value.h>
|
||||
|
||||
#include "cmJSONState.h"
|
||||
#include "cmUVProcessChain.h"
|
||||
#include "cmUVStream.h"
|
||||
|
||||
@@ -25,10 +25,11 @@ cm::optional<Json::Value> cmParsePlist(std::string const& filename)
|
||||
return cm::nullopt;
|
||||
}
|
||||
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
cmUVIStream outputStream(chain.OutputStream());
|
||||
if (!reader.parse(outputStream, value)) {
|
||||
cmJSONState parseState(outputStream, &value,
|
||||
cmJSONState::StrictMode::Relaxed);
|
||||
if (!parseState.errors.empty()) {
|
||||
return cm::nullopt;
|
||||
}
|
||||
return cm::optional<Json::Value>(value);
|
||||
|
||||
Reference in New Issue
Block a user