JSON 사용하기

1.     Json 관련 헤더 파일 포함

A.     autolink.h

B.      config.h

C.      features.h

D.     json.h

E.      json_batchallocator.h

F.      json_internalarray.inl

G.     json_internalmap.inl

H.     json_valuiterator.inl

I.       reder.h

J.       value.h

K.      writer.h

 

2.     소스 파일 포함

A.     json_reader.cpp

B.      json_value.cpp

C.      json_writer.cpp

 

3.     사용 방법

A.     데이터 저장

{       Json::Value root;

        Json::Value encoding;

 

        root["encoding"] = "UTF-8";

 

        Json::Value plugins;

        plugins.append("python");

        plugins.append("C++");

        plugins.append("ruby");

        plugins.append(test);

        root["plub-ins"] = plugins;

 

        Json::Value indent;

        indent["length"] = 3;

        indent["use_space"] = true;

        root["indent"] = indent;

 

        Json::StyledWriter writer;

        std::string outputConfig = writer.write( root );

}

 

 

 

 

'c/c++' 카테고리의 다른 글

스레드 생성  (0) 2013.03.26
MMF(Memory Mapping File) & Shared Memory  (0) 2013.03.26
ip/ mac 주소 얻기  (0) 2013.02.25
서비스  (0) 2013.02.25
const 과 #define  (0) 2013.01.30