Mercurial > hg > orthanc-wsi
diff Resources/Orthanc/Stone/IOrthancConnection.cpp @ 212:f1ea48f92d66
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 22 Dec 2020 09:19:43 +0100 |
parents | b0bd22077cd8 |
children | 1e864138f0da |
line wrap: on
line diff
--- a/Resources/Orthanc/Stone/IOrthancConnection.cpp Mon Nov 09 15:09:05 2020 +0100 +++ b/Resources/Orthanc/Stone/IOrthancConnection.cpp Tue Dec 22 09:19:43 2020 +0100 @@ -5,34 +5,32 @@ * Copyright (C) 2017-2020 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/>. **/ #include "IOrthancConnection.h" #include <OrthancException.h> - -#include <json/reader.h> +#include <Toolbox.h> namespace OrthancStone { void IOrthancConnection::ParseJson(Json::Value& result, const std::string& content) { - Json::Reader reader; - - if (!reader.parse(content, result)) + if (!Orthanc::Toolbox::ReadJson(result, content)) { throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); } @@ -43,10 +41,7 @@ const void* content, size_t size) { - Json::Reader reader; - - if (!reader.parse(reinterpret_cast<const char*>(content), - reinterpret_cast<const char*>(content) + size, result)) + if (!Orthanc::Toolbox::ReadJson(result, content, size)) { throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); }