diff --git a/cpp/AUTHORS b/AUTHORS similarity index 100% rename from cpp/AUTHORS rename to AUTHORS diff --git a/cpp/COPYING b/COPYING similarity index 100% rename from cpp/COPYING rename to COPYING diff --git a/cpp/ChangeLog b/ChangeLog similarity index 100% rename from cpp/ChangeLog rename to ChangeLog diff --git a/cpp/Doxyfile b/Doxyfile similarity index 100% rename from cpp/Doxyfile rename to Doxyfile diff --git a/cpp/LICENSE b/LICENSE similarity index 100% rename from cpp/LICENSE rename to LICENSE diff --git a/cpp/Makefile.am b/Makefile.am similarity index 100% rename from cpp/Makefile.am rename to Makefile.am diff --git a/cpp/NOTICE b/NOTICE similarity index 100% rename from cpp/NOTICE rename to NOTICE diff --git a/README.md b/README.md index 3c7e7679..eac77935 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,73 @@ -MessagePack -=========== +MessagePack for C/C++ +===================== +Binary-based efficient object serialization library. -MessagePack is an efficient binary serialization format. It's like JSON. but fast and small. -This repository is divided to multiple implementation probjects on https://github.com/msgpack organization. +## Installation - * Node.JS: https://github.com/msgpack/msgpack-node - * D: https://github.com/msgpack/msgpack-d - * Go: https://github.com/msgpack/msgpack-go - * Python: https://github.com/msgpack/msgpack-python - * Ruby: https://github.com/msgpack/msgpack-ruby - * Java: https://github.com/msgpack/msgpack-java - * Scala: https://github.com/msgpack/msgpack-scala - * CLI/C#: https://github.com/msgpack/msgpack-cli - * Objective-C: https://github.com/msgpack/msgpack-objectivec - * Perl: https://github.com/msgpack/msgpack-perl - * Haskell: https://github.com/msgpack/msgpack-haskell - * PHP: https://github.com/msgpack/msgpack-php - * OCaml: https://github.com/msgpack/msgpack-ocaml - * C/C++: https://github.com/msgpack/msgpack-c - * Erlang: https://github.com/msgpack/msgpack-erlang - * Smalltalk: https://github.com/msgpack/msgpack-smalltalk - * JavaScript: https://github.com/msgpack/msgpack-javascript +Download latest package from [releases of MessagePack](http://sourceforge.net/projects/msgpack/files/) and extract it. + +On UNIX-like platform, run ./configure && make && sudo make install: + + $ ./configure + $ make + $ sudo make install + +On Windows, open msgpack_vc8.vcproj or msgpack_vc2008 file and build it using batch build. DLLs are built on lib folder, +and the headers are built on include folder. + +To use the library in your program, include msgpack.hpp header and link "msgpack" library. + + +## Example + + #include + #include + + int main(void) { + // This is target object. + std::vector target; + target.push_back("Hello,"); + target.push_back("World!"); + + // Serialize it. + msgpack::sbuffer buffer; // simple buffer + msgpack::pack(&buffer, target); + + // Deserialize the serialized data. + msgpack::unpacked msg; // includes memory pool and deserialized object + msgpack::unpack(&msg, sbuf.data(), sbuf.size()); + msgpack::object obj = msg.get(); + + // Print the deserialized object to stdout. + std::cout << obj << std::endl; // ["Hello," "World!"] + + // Convert the deserialized object to staticaly typed object. + std::vector result; + obj.convert(&result); + + // If the type is mismatched, it throws msgpack::type_error. + obj.as(); // type is mismatched, msgpack::type_error is thrown + } + +API documents and other example codes are available at the [wiki.](http://redmine.msgpack.org/projects/msgpack/wiki) + + +## License + + Copyright (C) 2008-2010 FURUHASHI Sadayuki + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +See also NOTICE file. diff --git a/test/README.md b/README_crosslang.md similarity index 100% rename from test/README.md rename to README_crosslang.md diff --git a/cpp/bootstrap b/bootstrap similarity index 100% rename from cpp/bootstrap rename to bootstrap diff --git a/test/cases.json b/cases.json similarity index 100% rename from test/cases.json rename to cases.json diff --git a/test/cases.mpac b/cases.mpac similarity index 100% rename from test/cases.mpac rename to cases.mpac diff --git a/test/cases_compact.mpac b/cases_compact.mpac similarity index 100% rename from test/cases_compact.mpac rename to cases_compact.mpac diff --git a/test/cases_gen.rb b/cases_gen.rb similarity index 100% rename from test/cases_gen.rb rename to cases_gen.rb diff --git a/cpp/configure.in b/configure.in similarity index 100% rename from cpp/configure.in rename to configure.in diff --git a/cpp/README.md b/cpp/README.md deleted file mode 100644 index eac77935..00000000 --- a/cpp/README.md +++ /dev/null @@ -1,73 +0,0 @@ -MessagePack for C/C++ -===================== -Binary-based efficient object serialization library. - - -## Installation - -Download latest package from [releases of MessagePack](http://sourceforge.net/projects/msgpack/files/) and extract it. - -On UNIX-like platform, run ./configure && make && sudo make install: - - $ ./configure - $ make - $ sudo make install - -On Windows, open msgpack_vc8.vcproj or msgpack_vc2008 file and build it using batch build. DLLs are built on lib folder, -and the headers are built on include folder. - -To use the library in your program, include msgpack.hpp header and link "msgpack" library. - - -## Example - - #include - #include - - int main(void) { - // This is target object. - std::vector target; - target.push_back("Hello,"); - target.push_back("World!"); - - // Serialize it. - msgpack::sbuffer buffer; // simple buffer - msgpack::pack(&buffer, target); - - // Deserialize the serialized data. - msgpack::unpacked msg; // includes memory pool and deserialized object - msgpack::unpack(&msg, sbuf.data(), sbuf.size()); - msgpack::object obj = msg.get(); - - // Print the deserialized object to stdout. - std::cout << obj << std::endl; // ["Hello," "World!"] - - // Convert the deserialized object to staticaly typed object. - std::vector result; - obj.convert(&result); - - // If the type is mismatched, it throws msgpack::type_error. - obj.as(); // type is mismatched, msgpack::type_error is thrown - } - -API documents and other example codes are available at the [wiki.](http://redmine.msgpack.org/projects/msgpack/wiki) - - -## License - - Copyright (C) 2008-2010 FURUHASHI Sadayuki - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -See also NOTICE file. - diff --git a/test/crosslang.cc b/crosslang.cc similarity index 100% rename from test/crosslang.cc rename to crosslang.cc diff --git a/test/crosslang.rb b/crosslang.rb similarity index 100% rename from test/crosslang.rb rename to crosslang.rb diff --git a/cpp/msgpack.pc.in b/msgpack.pc.in similarity index 100% rename from cpp/msgpack.pc.in rename to msgpack.pc.in diff --git a/cpp/msgpack_vc.postbuild.bat b/msgpack_vc.postbuild.bat similarity index 100% rename from cpp/msgpack_vc.postbuild.bat rename to msgpack_vc.postbuild.bat diff --git a/cpp/msgpack_vc8.sln b/msgpack_vc8.sln similarity index 100% rename from cpp/msgpack_vc8.sln rename to msgpack_vc8.sln diff --git a/cpp/msgpack_vc8.vcproj b/msgpack_vc8.vcproj similarity index 100% rename from cpp/msgpack_vc8.vcproj rename to msgpack_vc8.vcproj diff --git a/msgpack/pack_define.h b/pack_define.h similarity index 100% rename from msgpack/pack_define.h rename to pack_define.h diff --git a/msgpack/pack_template.h b/pack_template.h similarity index 100% rename from msgpack/pack_template.h rename to pack_template.h diff --git a/cpp/preprocess b/preprocess similarity index 65% rename from cpp/preprocess rename to preprocess index 17e8a05c..839eb137 100755 --- a/cpp/preprocess +++ b/preprocess @@ -21,13 +21,13 @@ else preprocess src/msgpack/type/define.hpp preprocess src/msgpack/zone.hpp fi -cp -f ../msgpack/sysdep.h src/msgpack/ -cp -f ../msgpack/pack_define.h src/msgpack/ -cp -f ../msgpack/pack_template.h src/msgpack/ -cp -f ../msgpack/unpack_define.h src/msgpack/ -cp -f ../msgpack/unpack_template.h src/msgpack/ -cp -f ../test/cases.mpac test/ -cp -f ../test/cases_compact.mpac test/ +cp -f sysdep.h src/msgpack/ +cp -f pack_define.h src/msgpack/ +cp -f pack_template.h src/msgpack/ +cp -f unpack_define.h src/msgpack/ +cp -f unpack_template.h src/msgpack/ +cp -f cases.mpac test/ +cp -f cases_compact.mpac test/ sed -e 's/8\.00/9.00/' < msgpack_vc8.vcproj > msgpack_vc2008.vcproj sed -e 's/9\.00/10.00/' -e 's/msgpack_vc8/msgpack_vc2008/' < msgpack_vc8.sln > msgpack_vc2008.sln diff --git a/cpp/src/Makefile.am b/src/Makefile.am similarity index 100% rename from cpp/src/Makefile.am rename to src/Makefile.am diff --git a/cpp/src/gcc_atomic.cpp b/src/gcc_atomic.cpp similarity index 100% rename from cpp/src/gcc_atomic.cpp rename to src/gcc_atomic.cpp diff --git a/cpp/src/gcc_atomic.h b/src/gcc_atomic.h similarity index 100% rename from cpp/src/gcc_atomic.h rename to src/gcc_atomic.h diff --git a/cpp/src/msgpack.h b/src/msgpack.h similarity index 100% rename from cpp/src/msgpack.h rename to src/msgpack.h diff --git a/cpp/src/msgpack.hpp b/src/msgpack.hpp similarity index 100% rename from cpp/src/msgpack.hpp rename to src/msgpack.hpp diff --git a/cpp/src/msgpack/object.h b/src/msgpack/object.h similarity index 100% rename from cpp/src/msgpack/object.h rename to src/msgpack/object.h diff --git a/cpp/src/msgpack/object.hpp b/src/msgpack/object.hpp similarity index 100% rename from cpp/src/msgpack/object.hpp rename to src/msgpack/object.hpp diff --git a/cpp/src/msgpack/pack.h b/src/msgpack/pack.h similarity index 100% rename from cpp/src/msgpack/pack.h rename to src/msgpack/pack.h diff --git a/cpp/src/msgpack/pack.hpp b/src/msgpack/pack.hpp similarity index 100% rename from cpp/src/msgpack/pack.hpp rename to src/msgpack/pack.hpp diff --git a/cpp/src/msgpack/sbuffer.h b/src/msgpack/sbuffer.h similarity index 100% rename from cpp/src/msgpack/sbuffer.h rename to src/msgpack/sbuffer.h diff --git a/cpp/src/msgpack/sbuffer.hpp b/src/msgpack/sbuffer.hpp similarity index 100% rename from cpp/src/msgpack/sbuffer.hpp rename to src/msgpack/sbuffer.hpp diff --git a/cpp/src/msgpack/type.hpp b/src/msgpack/type.hpp similarity index 100% rename from cpp/src/msgpack/type.hpp rename to src/msgpack/type.hpp diff --git a/cpp/src/msgpack/type/bool.hpp b/src/msgpack/type/bool.hpp similarity index 100% rename from cpp/src/msgpack/type/bool.hpp rename to src/msgpack/type/bool.hpp diff --git a/cpp/src/msgpack/type/define.hpp.erb b/src/msgpack/type/define.hpp.erb similarity index 100% rename from cpp/src/msgpack/type/define.hpp.erb rename to src/msgpack/type/define.hpp.erb diff --git a/cpp/src/msgpack/type/deque.hpp b/src/msgpack/type/deque.hpp similarity index 100% rename from cpp/src/msgpack/type/deque.hpp rename to src/msgpack/type/deque.hpp diff --git a/cpp/src/msgpack/type/fixint.hpp b/src/msgpack/type/fixint.hpp similarity index 100% rename from cpp/src/msgpack/type/fixint.hpp rename to src/msgpack/type/fixint.hpp diff --git a/cpp/src/msgpack/type/float.hpp b/src/msgpack/type/float.hpp similarity index 100% rename from cpp/src/msgpack/type/float.hpp rename to src/msgpack/type/float.hpp diff --git a/cpp/src/msgpack/type/int.hpp b/src/msgpack/type/int.hpp similarity index 100% rename from cpp/src/msgpack/type/int.hpp rename to src/msgpack/type/int.hpp diff --git a/cpp/src/msgpack/type/list.hpp b/src/msgpack/type/list.hpp similarity index 100% rename from cpp/src/msgpack/type/list.hpp rename to src/msgpack/type/list.hpp diff --git a/cpp/src/msgpack/type/map.hpp b/src/msgpack/type/map.hpp similarity index 100% rename from cpp/src/msgpack/type/map.hpp rename to src/msgpack/type/map.hpp diff --git a/cpp/src/msgpack/type/nil.hpp b/src/msgpack/type/nil.hpp similarity index 100% rename from cpp/src/msgpack/type/nil.hpp rename to src/msgpack/type/nil.hpp diff --git a/cpp/src/msgpack/type/pair.hpp b/src/msgpack/type/pair.hpp similarity index 100% rename from cpp/src/msgpack/type/pair.hpp rename to src/msgpack/type/pair.hpp diff --git a/cpp/src/msgpack/type/raw.hpp b/src/msgpack/type/raw.hpp similarity index 100% rename from cpp/src/msgpack/type/raw.hpp rename to src/msgpack/type/raw.hpp diff --git a/cpp/src/msgpack/type/set.hpp b/src/msgpack/type/set.hpp similarity index 100% rename from cpp/src/msgpack/type/set.hpp rename to src/msgpack/type/set.hpp diff --git a/cpp/src/msgpack/type/string.hpp b/src/msgpack/type/string.hpp similarity index 100% rename from cpp/src/msgpack/type/string.hpp rename to src/msgpack/type/string.hpp diff --git a/cpp/src/msgpack/type/tr1/unordered_map.hpp b/src/msgpack/type/tr1/unordered_map.hpp similarity index 100% rename from cpp/src/msgpack/type/tr1/unordered_map.hpp rename to src/msgpack/type/tr1/unordered_map.hpp diff --git a/cpp/src/msgpack/type/tr1/unordered_set.hpp b/src/msgpack/type/tr1/unordered_set.hpp similarity index 100% rename from cpp/src/msgpack/type/tr1/unordered_set.hpp rename to src/msgpack/type/tr1/unordered_set.hpp diff --git a/cpp/src/msgpack/type/tuple.hpp.erb b/src/msgpack/type/tuple.hpp.erb similarity index 100% rename from cpp/src/msgpack/type/tuple.hpp.erb rename to src/msgpack/type/tuple.hpp.erb diff --git a/cpp/src/msgpack/type/vector.hpp b/src/msgpack/type/vector.hpp similarity index 100% rename from cpp/src/msgpack/type/vector.hpp rename to src/msgpack/type/vector.hpp diff --git a/cpp/src/msgpack/unpack.h b/src/msgpack/unpack.h similarity index 100% rename from cpp/src/msgpack/unpack.h rename to src/msgpack/unpack.h diff --git a/cpp/src/msgpack/unpack.hpp b/src/msgpack/unpack.hpp similarity index 100% rename from cpp/src/msgpack/unpack.hpp rename to src/msgpack/unpack.hpp diff --git a/cpp/src/msgpack/version.h.in b/src/msgpack/version.h.in similarity index 100% rename from cpp/src/msgpack/version.h.in rename to src/msgpack/version.h.in diff --git a/cpp/src/msgpack/vrefbuffer.h b/src/msgpack/vrefbuffer.h similarity index 100% rename from cpp/src/msgpack/vrefbuffer.h rename to src/msgpack/vrefbuffer.h diff --git a/cpp/src/msgpack/vrefbuffer.hpp b/src/msgpack/vrefbuffer.hpp similarity index 100% rename from cpp/src/msgpack/vrefbuffer.hpp rename to src/msgpack/vrefbuffer.hpp diff --git a/cpp/src/msgpack/zbuffer.h b/src/msgpack/zbuffer.h similarity index 100% rename from cpp/src/msgpack/zbuffer.h rename to src/msgpack/zbuffer.h diff --git a/cpp/src/msgpack/zbuffer.hpp b/src/msgpack/zbuffer.hpp similarity index 100% rename from cpp/src/msgpack/zbuffer.hpp rename to src/msgpack/zbuffer.hpp diff --git a/cpp/src/msgpack/zone.h b/src/msgpack/zone.h similarity index 100% rename from cpp/src/msgpack/zone.h rename to src/msgpack/zone.h diff --git a/cpp/src/msgpack/zone.hpp.erb b/src/msgpack/zone.hpp.erb similarity index 100% rename from cpp/src/msgpack/zone.hpp.erb rename to src/msgpack/zone.hpp.erb diff --git a/cpp/src/object.cpp b/src/object.cpp similarity index 100% rename from cpp/src/object.cpp rename to src/object.cpp diff --git a/cpp/src/objectc.c b/src/objectc.c similarity index 100% rename from cpp/src/objectc.c rename to src/objectc.c diff --git a/cpp/src/unpack.c b/src/unpack.c similarity index 100% rename from cpp/src/unpack.c rename to src/unpack.c diff --git a/cpp/src/version.c b/src/version.c similarity index 100% rename from cpp/src/version.c rename to src/version.c diff --git a/cpp/src/vrefbuffer.c b/src/vrefbuffer.c similarity index 100% rename from cpp/src/vrefbuffer.c rename to src/vrefbuffer.c diff --git a/cpp/src/zone.c b/src/zone.c similarity index 100% rename from cpp/src/zone.c rename to src/zone.c diff --git a/msgpack/sysdep.h b/sysdep.h similarity index 100% rename from msgpack/sysdep.h rename to sysdep.h diff --git a/cpp/test/Makefile.am b/test/Makefile.am similarity index 100% rename from cpp/test/Makefile.am rename to test/Makefile.am diff --git a/cpp/test/buffer.cc b/test/buffer.cc similarity index 100% rename from cpp/test/buffer.cc rename to test/buffer.cc diff --git a/cpp/test/cases.cc b/test/cases.cc similarity index 100% rename from cpp/test/cases.cc rename to test/cases.cc diff --git a/cpp/test/convert.cc b/test/convert.cc similarity index 100% rename from cpp/test/convert.cc rename to test/convert.cc diff --git a/cpp/test/fixint.cc b/test/fixint.cc similarity index 100% rename from cpp/test/fixint.cc rename to test/fixint.cc diff --git a/cpp/test/fixint_c.cc b/test/fixint_c.cc similarity index 100% rename from cpp/test/fixint_c.cc rename to test/fixint_c.cc diff --git a/cpp/test/msgpack_test.cpp b/test/msgpack_test.cpp similarity index 100% rename from cpp/test/msgpack_test.cpp rename to test/msgpack_test.cpp diff --git a/cpp/test/msgpackc_test.cpp b/test/msgpackc_test.cpp similarity index 100% rename from cpp/test/msgpackc_test.cpp rename to test/msgpackc_test.cpp diff --git a/cpp/test/object.cc b/test/object.cc similarity index 100% rename from cpp/test/object.cc rename to test/object.cc diff --git a/cpp/test/pack_unpack.cc b/test/pack_unpack.cc similarity index 100% rename from cpp/test/pack_unpack.cc rename to test/pack_unpack.cc diff --git a/cpp/test/pack_unpack_c.cc b/test/pack_unpack_c.cc similarity index 100% rename from cpp/test/pack_unpack_c.cc rename to test/pack_unpack_c.cc diff --git a/cpp/test/streaming.cc b/test/streaming.cc similarity index 100% rename from cpp/test/streaming.cc rename to test/streaming.cc diff --git a/cpp/test/streaming_c.cc b/test/streaming_c.cc similarity index 100% rename from cpp/test/streaming_c.cc rename to test/streaming_c.cc diff --git a/cpp/test/version.cc b/test/version.cc similarity index 100% rename from cpp/test/version.cc rename to test/version.cc diff --git a/cpp/test/zone.cc b/test/zone.cc similarity index 100% rename from cpp/test/zone.cc rename to test/zone.cc diff --git a/msgpack/unpack_define.h b/unpack_define.h similarity index 100% rename from msgpack/unpack_define.h rename to unpack_define.h diff --git a/msgpack/unpack_template.h b/unpack_template.h similarity index 100% rename from msgpack/unpack_template.h rename to unpack_template.h