JsonData.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @author Simon Ottenhaus (simon dot ottenhaus at kit dot edu)
17* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
18* GNU General Public License
19*/
20
21#pragma once
22
23#include <memory>
24
25#include "JsonWriter.h"
26#include "LexerInfo.h"
27
28namespace armarx
29{
30 class JsonData;
31 using JsonDataPtr = std::shared_ptr<JsonData>;
32
34 {
35 public:
36 JsonData();
37 virtual void writeJson(const JsonWriterPtr& writer) = 0;
38 std::string toJsonString(int indenting = 0,
39 const std::string indentChars = " ",
40 bool jsStyleKeys = false);
41
42 void setLexerStartOffset(LexerInfo lexerStartOffset);
43 void setLexerEndOffset(LexerInfo lexerEndOffset);
46 virtual JsonDataPtr clone() = 0;
47
48 virtual ~JsonData() = default;
49
50 private:
51 LexerInfo lexerStartOffset;
52 LexerInfo lexerEndOffset;
53 };
54} // namespace armarx
virtual ~JsonData()=default
LexerInfo getLexerStartOffset()
Definition JsonData.cpp:50
std::string toJsonString(int indenting=0, const std::string indentChars=" ", bool jsStyleKeys=false)
Definition JsonData.cpp:30
virtual void writeJson(const JsonWriterPtr &writer)=0
LexerInfo getLexerEndOffset()
Definition JsonData.cpp:56
void setLexerStartOffset(LexerInfo lexerStartOffset)
Definition JsonData.cpp:38
virtual JsonDataPtr clone()=0
void setLexerEndOffset(LexerInfo lexerEndOffset)
Definition JsonData.cpp:44
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< JsonData > JsonDataPtr
Definition JsonData.h:31
std::shared_ptr< JsonWriter > JsonWriterPtr
Definition JsonWriter.h:30