├── .gitignore ├── AUTHORS ├── CMakeLists.txt ├── LICENCE ├── LICENSE ├── LICENSE.996ICU ├── LICENSE.MIT ├── README.md ├── conf ├── easylogging.conf └── logkafka.conf ├── docs ├── FAQ.md ├── Features.md ├── Users.md ├── imgs │ ├── add_cluster.png │ ├── create_logkafka.png │ ├── delete_logkafka.png │ ├── list_logkafka.png │ └── logkafka.png ├── install-libgdbm.md ├── install-libpcre2.md ├── install-librdkafka.md ├── install-libuv.md ├── install-libzookeeper_mt.md ├── install-php-zookeeper-extension.md └── ppt │ ├── log_collection_research_report.key │ └── logkafka.graffle ├── modules ├── Buildlibpcre2.cmake ├── Buildlibrdkafka.cmake ├── Buildlibuv.cmake ├── Buildlibzookeeper_mt.cmake ├── CodeCoverage.cmake ├── Findlibgcov.cmake ├── Findlibpcre2.cmake ├── Findlibpthread.cmake ├── Findlibrdkafka.cmake ├── Findlibrt.cmake ├── Findlibuv.cmake ├── Findlibz.cmake └── Findlibzookeeper_mt.cmake ├── patches └── ZOOKEEPER-2049.noprefix.trunk.patch ├── src ├── CMakeLists.txt ├── base │ ├── IndexedProperty.h │ ├── Property.h │ ├── ROProperty.h │ ├── RWProperty.h │ ├── WOProperty.h │ ├── common.h │ ├── json.cc │ ├── json.h │ ├── mutex.h │ ├── noncopyable.h │ ├── scoped_lock.h │ ├── singleton.h │ ├── stat_watcher.cc │ ├── stat_watcher.h │ ├── timer_watcher.cc │ ├── timer_watcher.h │ ├── tools.cc │ └── tools.h ├── logkafka │ ├── common.h │ ├── config.cc │ ├── config.h │ ├── file_position_entry.cc │ ├── file_position_entry.h │ ├── filter.h │ ├── filter_regex.cc │ ├── filter_regex.h │ ├── io_handler.cc │ ├── io_handler.h │ ├── logkafka.cc │ ├── logkafka.h │ ├── main.cc │ ├── manager.cc │ ├── manager.h │ ├── memory_position_entry.cc │ ├── memory_position_entry.h │ ├── option.cc │ ├── option.h │ ├── output.h │ ├── output_kafka.cc │ ├── output_kafka.h │ ├── position_entry.h │ ├── position_file.cc │ ├── position_file.h │ ├── producer.cc │ ├── producer.h │ ├── properties.h │ ├── rotate_handler.cc │ ├── rotate_handler.h │ ├── signal_handler.cc │ ├── signal_handler.h │ ├── tail_watcher.cc │ ├── tail_watcher.h │ ├── task_conf.h │ ├── zookeeper.cc │ └── zookeeper.h └── third_party │ ├── confuse │ ├── .cvsignore │ ├── AUTHORS │ ├── CMakeLists.txt │ ├── INSTALL │ ├── Makefile.am │ ├── NEWS │ ├── README │ ├── autogen.sh │ ├── configure.ac │ ├── doc │ │ ├── .cvsignore │ │ ├── Doxyfile.in │ │ ├── Makefile.am │ │ ├── css.xsl │ │ ├── doxygen-footer.html │ │ ├── doxygen-header.html │ │ ├── doxygen.css │ │ ├── listing1.c │ │ ├── listing2.c │ │ ├── listing3.c │ │ ├── listing4.c │ │ ├── listing5.c │ │ ├── listing6.c │ │ ├── listing7.c │ │ ├── listing8.c │ │ ├── tutorial.css │ │ └── tutorial.xml │ ├── examples │ │ ├── .cvsignore │ │ ├── Makefile.am │ │ ├── ftp.conf │ │ ├── ftpconf.c │ │ ├── reread.c │ │ ├── reread.conf │ │ ├── simple.c │ │ ├── simple.conf │ │ ├── wincfgtest.c │ │ ├── wincfgtest.conf │ │ └── wincfgtest.dev │ ├── libconfuse.pc.in │ ├── libconfuse.spec.in │ ├── m4 │ │ ├── .cvsignore │ │ └── Makefile.am │ ├── po │ │ ├── .cvsignore │ │ ├── LINGUAS │ │ ├── Makevars │ │ ├── POTFILES.in │ │ ├── fr.po │ │ └── sv.po │ ├── src │ │ ├── .cvsignore │ │ ├── Makefile.am │ │ ├── confuse.c │ │ ├── confuse.h │ │ └── lexer.l │ └── windows │ │ ├── borland │ │ ├── cfgtest.bpf │ │ ├── cfgtest.bpr │ │ ├── config.h │ │ ├── confuse.bpg │ │ ├── libConfuse.bpf │ │ └── libConfuse.bpr │ │ ├── devcpp │ │ ├── cfgtest.dev │ │ ├── config.h │ │ └── libConfuse.dev │ │ ├── mingw │ │ ├── README.TXT │ │ └── build.bat │ │ ├── msvc6 │ │ └── libConfuse │ │ │ ├── config.h │ │ │ ├── libConfuse.dsp │ │ │ ├── libConfuse.dsw │ │ │ └── unistd.h │ │ └── msvs.net │ │ ├── cfgtest │ │ └── cfgtest.vcproj │ │ ├── config.h │ │ ├── libConfuse │ │ └── libConfuse.vcproj │ │ ├── msvs.net.sln │ │ └── unistd.h │ ├── easylogging │ └── easylogging++.h │ ├── rapidjson │ ├── .gitignore │ ├── .gitmodules │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── CMakeLists.txt │ ├── RapidJSON.pc.in │ ├── RapidJSONConfig.cmake.in │ ├── RapidJSONConfigVersion.cmake.in │ ├── appveyor.yml │ ├── bin │ │ ├── data │ │ │ ├── glossary.json │ │ │ ├── menu.json │ │ │ ├── readme.txt │ │ │ ├── sample.json │ │ │ ├── webapp.json │ │ │ └── widget.json │ │ ├── encodings │ │ │ ├── utf16be.json │ │ │ ├── utf16bebom.json │ │ │ ├── utf16le.json │ │ │ ├── utf16lebom.json │ │ │ ├── utf32be.json │ │ │ ├── utf32bebom.json │ │ │ ├── utf32le.json │ │ │ ├── utf32lebom.json │ │ │ ├── utf8.json │ │ │ └── utf8bom.json │ │ └── jsonchecker │ │ │ ├── fail1.json │ │ │ ├── fail10.json │ │ │ ├── fail11.json │ │ │ ├── fail12.json │ │ │ ├── fail13.json │ │ │ ├── fail14.json │ │ │ ├── fail15.json │ │ │ ├── fail16.json │ │ │ ├── fail17.json │ │ │ ├── fail18.json │ │ │ ├── fail19.json │ │ │ ├── fail2.json │ │ │ ├── fail20.json │ │ │ ├── fail21.json │ │ │ ├── fail22.json │ │ │ ├── fail23.json │ │ │ ├── fail24.json │ │ │ ├── fail25.json │ │ │ ├── fail26.json │ │ │ ├── fail27.json │ │ │ ├── fail28.json │ │ │ ├── fail29.json │ │ │ ├── fail3.json │ │ │ ├── fail30.json │ │ │ ├── fail31.json │ │ │ ├── fail32.json │ │ │ ├── fail33.json │ │ │ ├── fail4.json │ │ │ ├── fail5.json │ │ │ ├── fail6.json │ │ │ ├── fail7.json │ │ │ ├── fail8.json │ │ │ ├── fail9.json │ │ │ ├── pass1.json │ │ │ ├── pass2.json │ │ │ ├── pass3.json │ │ │ └── readme.txt │ ├── doc │ │ ├── CMakeLists.txt │ │ ├── Doxyfile.in │ │ ├── Doxyfile.zh-cn.in │ │ ├── diagram │ │ │ ├── architecture.dot │ │ │ ├── architecture.png │ │ │ ├── insituparsing.dot │ │ │ ├── insituparsing.png │ │ │ ├── iterative-parser-states-diagram.dot │ │ │ ├── iterative-parser-states-diagram.png │ │ │ ├── makefile │ │ │ ├── move1.dot │ │ │ ├── move1.png │ │ │ ├── move2.dot │ │ │ ├── move2.png │ │ │ ├── move3.dot │ │ │ ├── move3.png │ │ │ ├── normalparsing.dot │ │ │ ├── normalparsing.png │ │ │ ├── simpledom.dot │ │ │ ├── simpledom.png │ │ │ ├── tutorial.dot │ │ │ ├── tutorial.png │ │ │ ├── utilityclass.dot │ │ │ └── utilityclass.png │ │ ├── dom.md │ │ ├── dom.zh-cn.md │ │ ├── encoding.md │ │ ├── encoding.zh-cn.md │ │ ├── faq.md │ │ ├── faq.zh-cn.md │ │ ├── features.md │ │ ├── features.zh-cn.md │ │ ├── internals.md │ │ ├── logo │ │ │ ├── rapidjson.png │ │ │ └── rapidjson.svg │ │ ├── misc │ │ │ ├── DoxygenLayout.xml │ │ │ ├── doxygenextra.css │ │ │ ├── footer.html │ │ │ └── header.html │ │ ├── performance.md │ │ ├── performance.zh-cn.md │ │ ├── pointer.md │ │ ├── sax.md │ │ ├── sax.zh-cn.md │ │ ├── stream.md │ │ ├── stream.zh-cn.md │ │ ├── tutorial.md │ │ └── tutorial.zh-cn.md │ ├── example │ │ ├── CMakeLists.txt │ │ ├── capitalize │ │ │ └── capitalize.cpp │ │ ├── condense │ │ │ └── condense.cpp │ │ ├── messagereader │ │ │ └── messagereader.cpp │ │ ├── pretty │ │ │ └── pretty.cpp │ │ ├── prettyauto │ │ │ └── prettyauto.cpp │ │ ├── serialize │ │ │ └── serialize.cpp │ │ ├── simpledom │ │ │ └── simpledom.cpp │ │ ├── simplereader │ │ │ └── simplereader.cpp │ │ ├── simplewriter │ │ │ └── simplewriter.cpp │ │ └── tutorial │ │ │ └── tutorial.cpp │ ├── include │ │ └── rapidjson │ │ │ ├── allocators.h │ │ │ ├── document.h │ │ │ ├── encodedstream.h │ │ │ ├── encodings.h │ │ │ ├── error │ │ │ ├── en.h │ │ │ └── error.h │ │ │ ├── filereadstream.h │ │ │ ├── filewritestream.h │ │ │ ├── internal │ │ │ ├── biginteger.h │ │ │ ├── diyfp.h │ │ │ ├── dtoa.h │ │ │ ├── ieee754.h │ │ │ ├── itoa.h │ │ │ ├── meta.h │ │ │ ├── pow10.h │ │ │ ├── stack.h │ │ │ ├── strfunc.h │ │ │ └── strtod.h │ │ │ ├── memorybuffer.h │ │ │ ├── memorystream.h │ │ │ ├── msinttypes │ │ │ ├── inttypes.h │ │ │ └── stdint.h │ │ │ ├── pointer.h │ │ │ ├── prettywriter.h │ │ │ ├── rapidjson.h │ │ │ ├── reader.h │ │ │ ├── stringbuffer.h │ │ │ └── writer.h │ ├── license.txt │ ├── readme.md │ ├── readme.zh-cn.md │ ├── test │ │ ├── CMakeLists.txt │ │ ├── perftest │ │ │ ├── CMakeLists.txt │ │ │ ├── misctest.cpp │ │ │ ├── perftest.cpp │ │ │ ├── perftest.h │ │ │ ├── platformtest.cpp │ │ │ └── rapidjsontest.cpp │ │ └── unittest │ │ │ ├── CMakeLists.txt │ │ │ ├── allocatorstest.cpp │ │ │ ├── bigintegertest.cpp │ │ │ ├── documenttest.cpp │ │ │ ├── encodedstreamtest.cpp │ │ │ ├── encodingstest.cpp │ │ │ ├── filestreamtest.cpp │ │ │ ├── itoatest.cpp │ │ │ ├── jsoncheckertest.cpp │ │ │ ├── namespacetest.cpp │ │ │ ├── pointertest.cpp │ │ │ ├── prettywritertest.cpp │ │ │ ├── readertest.cpp │ │ │ ├── simdtest.cpp │ │ │ ├── stringbuffertest.cpp │ │ │ ├── strtodtest.cpp │ │ │ ├── unittest.cpp │ │ │ ├── unittest.h │ │ │ ├── valuetest.cpp │ │ │ └── writertest.cpp │ └── travis-doxygen.sh │ └── tclap │ ├── AUTHORS │ ├── COPYING │ ├── ChangeLog │ ├── INSTALL │ ├── Makefile.am │ ├── Makefile.in │ ├── NEWS │ ├── README │ ├── aclocal.m4 │ ├── config │ ├── Makefile.am │ ├── Makefile.in │ ├── ac_cxx_have_long_long.m4 │ ├── ac_cxx_have_sstream.m4 │ ├── ac_cxx_have_strstream.m4 │ ├── ac_cxx_namespaces.m4 │ ├── ac_cxx_warn_effective_cxx.m4 │ ├── bb_enable_doxygen.m4 │ ├── config.h.in │ ├── depcomp │ ├── install-sh │ ├── missing │ └── mkinstalldirs │ ├── configure │ ├── configure.in │ ├── docs │ ├── Doxyfile.in │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ ├── html │ │ ├── ArgException_8h.html │ │ ├── ArgException_8h_source.html │ │ ├── ArgTraits_8h.html │ │ ├── ArgTraits_8h_source.html │ │ ├── Arg_8h.html │ │ ├── Arg_8h_source.html │ │ ├── CVS │ │ │ ├── Entries │ │ │ ├── Repository │ │ │ └── Root │ │ ├── CmdLineInterface_8h.html │ │ ├── CmdLineInterface_8h_source.html │ │ ├── CmdLineOutput_8h.html │ │ ├── CmdLineOutput_8h_source.html │ │ ├── CmdLine_8h.html │ │ ├── CmdLine_8h_source.html │ │ ├── Constraint_8h.html │ │ ├── Constraint_8h_source.html │ │ ├── DocBookOutput_8h.html │ │ ├── DocBookOutput_8h_source.html │ │ ├── HelpVisitor_8h.html │ │ ├── HelpVisitor_8h_source.html │ │ ├── IgnoreRestVisitor_8h.html │ │ ├── IgnoreRestVisitor_8h_source.html │ │ ├── MultiArg_8h.html │ │ ├── MultiArg_8h_source.html │ │ ├── MultiSwitchArg_8h.html │ │ ├── MultiSwitchArg_8h_source.html │ │ ├── OptionalUnlabeledTracker_8h.html │ │ ├── OptionalUnlabeledTracker_8h_source.html │ │ ├── StandardTraits_8h.html │ │ ├── StandardTraits_8h_source.html │ │ ├── StdOutput_8h.html │ │ ├── StdOutput_8h_source.html │ │ ├── SwitchArg_8h.html │ │ ├── SwitchArg_8h_source.html │ │ ├── UnlabeledMultiArg_8h.html │ │ ├── UnlabeledMultiArg_8h_source.html │ │ ├── UnlabeledValueArg_8h.html │ │ ├── UnlabeledValueArg_8h_source.html │ │ ├── ValueArg_8h.html │ │ ├── ValueArg_8h_source.html │ │ ├── ValuesConstraint_8h.html │ │ ├── ValuesConstraint_8h_source.html │ │ ├── VersionVisitor_8h.html │ │ ├── VersionVisitor_8h_source.html │ │ ├── Visitor_8h.html │ │ ├── Visitor_8h_source.html │ │ ├── XorHandler_8h.html │ │ ├── XorHandler_8h_source.html │ │ ├── ZshCompletionOutput_8h.html │ │ ├── ZshCompletionOutput_8h_source.html │ │ ├── annotated.html │ │ ├── classTCLAP_1_1Arg-members.html │ │ ├── classTCLAP_1_1Arg.gif │ │ ├── classTCLAP_1_1Arg.html │ │ ├── classTCLAP_1_1ArgException-members.html │ │ ├── classTCLAP_1_1ArgException.gif │ │ ├── classTCLAP_1_1ArgException.html │ │ ├── classTCLAP_1_1ArgParseException-members.html │ │ ├── classTCLAP_1_1ArgParseException.gif │ │ ├── classTCLAP_1_1ArgParseException.html │ │ ├── classTCLAP_1_1CmdLine-members.html │ │ ├── classTCLAP_1_1CmdLine.gif │ │ ├── classTCLAP_1_1CmdLine.html │ │ ├── classTCLAP_1_1CmdLineInterface-members.html │ │ ├── classTCLAP_1_1CmdLineInterface.gif │ │ ├── classTCLAP_1_1CmdLineInterface.html │ │ ├── classTCLAP_1_1CmdLineOutput-members.html │ │ ├── classTCLAP_1_1CmdLineOutput.gif │ │ ├── classTCLAP_1_1CmdLineOutput.html │ │ ├── classTCLAP_1_1CmdLineParseException-members.html │ │ ├── classTCLAP_1_1CmdLineParseException.gif │ │ ├── classTCLAP_1_1CmdLineParseException.html │ │ ├── classTCLAP_1_1Constraint-members.html │ │ ├── classTCLAP_1_1Constraint.gif │ │ ├── classTCLAP_1_1Constraint.html │ │ ├── classTCLAP_1_1DocBookOutput-members.html │ │ ├── classTCLAP_1_1DocBookOutput.gif │ │ ├── classTCLAP_1_1DocBookOutput.html │ │ ├── classTCLAP_1_1ExitException-members.html │ │ ├── classTCLAP_1_1ExitException.html │ │ ├── classTCLAP_1_1HelpVisitor-members.html │ │ ├── classTCLAP_1_1HelpVisitor.gif │ │ ├── classTCLAP_1_1HelpVisitor.html │ │ ├── classTCLAP_1_1IgnoreRestVisitor-members.html │ │ ├── classTCLAP_1_1IgnoreRestVisitor.gif │ │ ├── classTCLAP_1_1IgnoreRestVisitor.html │ │ ├── classTCLAP_1_1MultiArg-members.html │ │ ├── classTCLAP_1_1MultiArg.gif │ │ ├── classTCLAP_1_1MultiArg.html │ │ ├── classTCLAP_1_1MultiSwitchArg-members.html │ │ ├── classTCLAP_1_1MultiSwitchArg.gif │ │ ├── classTCLAP_1_1MultiSwitchArg.html │ │ ├── classTCLAP_1_1OptionalUnlabeledTracker-members.html │ │ ├── classTCLAP_1_1OptionalUnlabeledTracker.html │ │ ├── classTCLAP_1_1SpecificationException-members.html │ │ ├── classTCLAP_1_1SpecificationException.gif │ │ ├── classTCLAP_1_1SpecificationException.html │ │ ├── classTCLAP_1_1StdOutput-members.html │ │ ├── classTCLAP_1_1StdOutput.gif │ │ ├── classTCLAP_1_1StdOutput.html │ │ ├── classTCLAP_1_1SwitchArg-members.html │ │ ├── classTCLAP_1_1SwitchArg.gif │ │ ├── classTCLAP_1_1SwitchArg.html │ │ ├── classTCLAP_1_1UnlabeledMultiArg-members.html │ │ ├── classTCLAP_1_1UnlabeledMultiArg.gif │ │ ├── classTCLAP_1_1UnlabeledMultiArg.html │ │ ├── classTCLAP_1_1UnlabeledValueArg-members.html │ │ ├── classTCLAP_1_1UnlabeledValueArg.gif │ │ ├── classTCLAP_1_1UnlabeledValueArg.html │ │ ├── classTCLAP_1_1ValueArg-members.html │ │ ├── classTCLAP_1_1ValueArg.gif │ │ ├── classTCLAP_1_1ValueArg.html │ │ ├── classTCLAP_1_1ValuesConstraint-members.html │ │ ├── classTCLAP_1_1ValuesConstraint.gif │ │ ├── classTCLAP_1_1ValuesConstraint.html │ │ ├── classTCLAP_1_1VersionVisitor-members.html │ │ ├── classTCLAP_1_1VersionVisitor.gif │ │ ├── classTCLAP_1_1VersionVisitor.html │ │ ├── classTCLAP_1_1Visitor-members.html │ │ ├── classTCLAP_1_1Visitor.gif │ │ ├── classTCLAP_1_1Visitor.html │ │ ├── classTCLAP_1_1XorHandler-members.html │ │ ├── classTCLAP_1_1XorHandler.html │ │ ├── classTCLAP_1_1ZshCompletionOutput-members.html │ │ ├── classTCLAP_1_1ZshCompletionOutput.gif │ │ ├── classTCLAP_1_1ZshCompletionOutput.html │ │ ├── classes.html │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── files.html │ │ ├── functions.html │ │ ├── functions_0x61.html │ │ ├── functions_0x62.html │ │ ├── functions_0x63.html │ │ ├── functions_0x64.html │ │ ├── functions_0x65.html │ │ ├── functions_0x66.html │ │ ├── functions_0x67.html │ │ ├── functions_0x68.html │ │ ├── functions_0x69.html │ │ ├── functions_0x6c.html │ │ ├── functions_0x6d.html │ │ ├── functions_0x6e.html │ │ ├── functions_0x6f.html │ │ ├── functions_0x70.html │ │ ├── functions_0x71.html │ │ ├── functions_0x72.html │ │ ├── functions_0x73.html │ │ ├── functions_0x74.html │ │ ├── functions_0x75.html │ │ ├── functions_0x76.html │ │ ├── functions_0x77.html │ │ ├── functions_0x78.html │ │ ├── functions_0x7a.html │ │ ├── functions_0x7e.html │ │ ├── functions_func.html │ │ ├── functions_func_0x61.html │ │ ├── functions_func_0x62.html │ │ ├── functions_func_0x63.html │ │ ├── functions_func_0x64.html │ │ ├── functions_func_0x65.html │ │ ├── functions_func_0x66.html │ │ ├── functions_func_0x67.html │ │ ├── functions_func_0x68.html │ │ ├── functions_func_0x69.html │ │ ├── functions_func_0x6c.html │ │ ├── functions_func_0x6d.html │ │ ├── functions_func_0x6e.html │ │ ├── functions_func_0x6f.html │ │ ├── functions_func_0x70.html │ │ ├── functions_func_0x71.html │ │ ├── functions_func_0x72.html │ │ ├── functions_func_0x73.html │ │ ├── functions_func_0x74.html │ │ ├── functions_func_0x75.html │ │ ├── functions_func_0x76.html │ │ ├── functions_func_0x77.html │ │ ├── functions_func_0x78.html │ │ ├── functions_func_0x7a.html │ │ ├── functions_func_0x7e.html │ │ ├── functions_type.html │ │ ├── functions_vars.html │ │ ├── globals.html │ │ ├── globals_defs.html │ │ ├── globals_type.html │ │ ├── hierarchy.html │ │ ├── index.html │ │ ├── namespaceTCLAP.html │ │ ├── namespacemembers.html │ │ ├── namespacemembers_func.html │ │ ├── namespacemembers_type.html │ │ ├── namespaces.html │ │ ├── structTCLAP_1_1ArgTraits-members.html │ │ ├── structTCLAP_1_1ArgTraits.html │ │ ├── structTCLAP_1_1ArgTraits_3_01bool_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01bool_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01char_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01char_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01double_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01double_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01float_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01float_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01int_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01int_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01long_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01long_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01short_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01short_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01std_1_1string_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01std_1_1string_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01unsigned_01char_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01unsigned_01char_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01unsigned_01int_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01unsigned_01int_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01unsigned_01long_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01unsigned_01long_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01unsigned_01short_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01unsigned_01short_01_4.html │ │ ├── structTCLAP_1_1ArgTraits_3_01wchar__t_01_4-members.html │ │ ├── structTCLAP_1_1ArgTraits_3_01wchar__t_01_4.html │ │ ├── structTCLAP_1_1StringLike-members.html │ │ ├── structTCLAP_1_1StringLike.html │ │ ├── structTCLAP_1_1StringLikeTrait-members.html │ │ ├── structTCLAP_1_1StringLikeTrait.html │ │ ├── structTCLAP_1_1ValueLike-members.html │ │ ├── structTCLAP_1_1ValueLike.html │ │ ├── structTCLAP_1_1ValueLikeTrait-members.html │ │ ├── structTCLAP_1_1ValueLikeTrait.html │ │ ├── tab_b.gif │ │ ├── tab_l.gif │ │ ├── tab_r.gif │ │ └── tabs.css │ ├── index.html │ ├── manual.html │ ├── manual.xml │ └── style.css │ ├── examples │ ├── Makefile.am │ ├── Makefile.in │ ├── test1.cpp │ ├── test10.cpp │ ├── test11.cpp │ ├── test12.cpp │ ├── test13.cpp │ ├── test14.cpp │ ├── test15.cpp │ ├── test16.cpp │ ├── test17-a.cpp │ ├── test17.cpp │ ├── test18.cpp │ ├── test19.cpp │ ├── test2.cpp │ ├── test20.cpp │ ├── test21.cpp │ ├── test3.cpp │ ├── test4.cpp │ ├── test5.cpp │ ├── test6.cpp │ ├── test7.cpp │ ├── test8.cpp │ └── test9.cpp │ ├── include │ ├── Makefile.am │ ├── Makefile.in │ └── tclap │ │ ├── Arg.h │ │ ├── ArgException.h │ │ ├── ArgTraits.h │ │ ├── CmdLine.h │ │ ├── CmdLineInterface.h │ │ ├── CmdLineOutput.h │ │ ├── Constraint.h │ │ ├── DocBookOutput.h │ │ ├── HelpVisitor.h │ │ ├── IgnoreRestVisitor.h │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── MultiArg.h │ │ ├── MultiSwitchArg.h │ │ ├── OptionalUnlabeledTracker.h │ │ ├── StandardTraits.h │ │ ├── StdOutput.h │ │ ├── SwitchArg.h │ │ ├── UnlabeledMultiArg.h │ │ ├── UnlabeledValueArg.h │ │ ├── ValueArg.h │ │ ├── ValuesConstraint.h │ │ ├── VersionVisitor.h │ │ ├── Visitor.h │ │ ├── XorHandler.h │ │ └── ZshCompletionOutput.h │ ├── msc │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ ├── examples │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── test1.vcproj │ │ ├── test2.vcproj │ │ ├── test3.vcproj │ │ ├── test4.vcproj │ │ ├── test5.vcproj │ │ ├── test6.vcproj │ │ ├── test7.vcproj │ │ └── test8.vcproj │ ├── tclap-beta.ncb │ ├── tclap-beta.sln │ ├── tclap-beta.suo │ └── tclap-beta.vcproj │ └── tclap.pc.in ├── tools ├── base │ ├── Exception.php │ └── Monitor.php ├── getopt-php │ ├── .travis.yml │ ├── Argument.php │ ├── CommandLineParser.php │ ├── Getopt.php │ ├── Option.php │ └── OptionParser.php ├── grid ├── log_config.php └── plugin │ └── MonitorDefault.php └── unittest ├── CMakeLists.txt ├── conf └── easylogging.conf ├── lib ├── CMakeLists.txt └── gtest-1.6.0 │ ├── CHANGES │ ├── CMakeLists.txt │ ├── CONTRIBUTORS │ ├── COPYING │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ ├── aclocal.m4 │ ├── build-aux │ ├── config.guess │ ├── config.h.in │ ├── config.sub │ ├── depcomp │ ├── install-sh │ ├── ltmain.sh │ └── missing │ ├── cmake │ └── internal_utils.cmake │ ├── codegear │ ├── gtest.cbproj │ ├── gtest.groupproj │ ├── gtest_all.cc │ ├── gtest_link.cc │ ├── gtest_main.cbproj │ └── gtest_unittest.cbproj │ ├── configure │ ├── configure.ac │ ├── fused-src │ └── gtest │ │ ├── gtest-all.cc │ │ ├── gtest.h │ │ └── gtest_main.cc │ ├── include │ └── gtest │ │ ├── gtest-death-test.h │ │ ├── gtest-message.h │ │ ├── gtest-param-test.h │ │ ├── gtest-param-test.h.pump │ │ ├── gtest-printers.h │ │ ├── gtest-spi.h │ │ ├── gtest-test-part.h │ │ ├── gtest-typed-test.h │ │ ├── gtest.h │ │ ├── gtest_pred_impl.h │ │ ├── gtest_prod.h │ │ └── internal │ │ ├── gtest-death-test-internal.h │ │ ├── gtest-filepath.h │ │ ├── gtest-internal.h │ │ ├── gtest-linked_ptr.h │ │ ├── gtest-param-util-generated.h │ │ ├── gtest-param-util-generated.h.pump │ │ ├── gtest-param-util.h │ │ ├── gtest-port.h │ │ ├── gtest-string.h │ │ ├── gtest-tuple.h │ │ ├── gtest-tuple.h.pump │ │ ├── gtest-type-util.h │ │ └── gtest-type-util.h.pump │ ├── m4 │ ├── acx_pthread.m4 │ ├── gtest.m4 │ ├── libtool.m4 │ ├── ltoptions.m4 │ ├── ltsugar.m4 │ ├── ltversion.m4 │ └── lt~obsolete.m4 │ ├── make │ └── Makefile │ ├── msvc │ ├── gtest-md.sln │ ├── gtest-md.vcproj │ ├── gtest.sln │ ├── gtest.vcproj │ ├── gtest_main-md.vcproj │ ├── gtest_main.vcproj │ ├── gtest_prod_test-md.vcproj │ ├── gtest_prod_test.vcproj │ ├── gtest_unittest-md.vcproj │ └── gtest_unittest.vcproj │ ├── samples │ ├── prime_tables.h │ ├── sample1.cc │ ├── sample1.h │ ├── sample10_unittest.cc │ ├── sample1_unittest.cc │ ├── sample2.cc │ ├── sample2.h │ ├── sample2_unittest.cc │ ├── sample3-inl.h │ ├── sample3_unittest.cc │ ├── sample4.cc │ ├── sample4.h │ ├── sample4_unittest.cc │ ├── sample5_unittest.cc │ ├── sample6_unittest.cc │ ├── sample7_unittest.cc │ ├── sample8_unittest.cc │ └── sample9_unittest.cc │ ├── scripts │ ├── fuse_gtest_files.py │ ├── gen_gtest_pred_impl.py │ ├── gtest-config.in │ ├── pump.py │ └── test │ │ └── Makefile │ ├── src │ ├── gtest-all.cc │ ├── gtest-death-test.cc │ ├── gtest-filepath.cc │ ├── gtest-internal-inl.h │ ├── gtest-port.cc │ ├── gtest-printers.cc │ ├── gtest-test-part.cc │ ├── gtest-typed-test.cc │ ├── gtest.cc │ └── gtest_main.cc │ ├── test │ ├── gtest-death-test_ex_test.cc │ ├── gtest-death-test_test.cc │ ├── gtest-filepath_test.cc │ ├── gtest-linked_ptr_test.cc │ ├── gtest-listener_test.cc │ ├── gtest-message_test.cc │ ├── gtest-options_test.cc │ ├── gtest-param-test2_test.cc │ ├── gtest-param-test_test.cc │ ├── gtest-param-test_test.h │ ├── gtest-port_test.cc │ ├── gtest-printers_test.cc │ ├── gtest-test-part_test.cc │ ├── gtest-tuple_test.cc │ ├── gtest-typed-test2_test.cc │ ├── gtest-typed-test_test.cc │ ├── gtest-typed-test_test.h │ ├── gtest-unittest-api_test.cc │ ├── gtest_all_test.cc │ ├── gtest_break_on_failure_unittest.py │ ├── gtest_break_on_failure_unittest_.cc │ ├── gtest_catch_exceptions_test.py │ ├── gtest_catch_exceptions_test_.cc │ ├── gtest_color_test.py │ ├── gtest_color_test_.cc │ ├── gtest_env_var_test.py │ ├── gtest_env_var_test_.cc │ ├── gtest_environment_test.cc │ ├── gtest_filter_unittest.py │ ├── gtest_filter_unittest_.cc │ ├── gtest_help_test.py │ ├── gtest_help_test_.cc │ ├── gtest_list_tests_unittest.py │ ├── gtest_list_tests_unittest_.cc │ ├── gtest_main_unittest.cc │ ├── gtest_no_test_unittest.cc │ ├── gtest_output_test.py │ ├── gtest_output_test_.cc │ ├── gtest_output_test_golden_lin.txt │ ├── gtest_pred_impl_unittest.cc │ ├── gtest_prod_test.cc │ ├── gtest_repeat_test.cc │ ├── gtest_shuffle_test.py │ ├── gtest_shuffle_test_.cc │ ├── gtest_sole_header_test.cc │ ├── gtest_stress_test.cc │ ├── gtest_test_utils.py │ ├── gtest_throw_on_failure_ex_test.cc │ ├── gtest_throw_on_failure_test.py │ ├── gtest_throw_on_failure_test_.cc │ ├── gtest_uninitialized_test.py │ ├── gtest_uninitialized_test_.cc │ ├── gtest_unittest.cc │ ├── gtest_xml_outfile1_test_.cc │ ├── gtest_xml_outfile2_test_.cc │ ├── gtest_xml_outfiles_test.py │ ├── gtest_xml_output_unittest.py │ ├── gtest_xml_output_unittest_.cc │ ├── gtest_xml_test_utils.py │ ├── production.cc │ └── production.h │ └── xcode │ ├── Config │ ├── DebugProject.xcconfig │ ├── FrameworkTarget.xcconfig │ ├── General.xcconfig │ ├── ReleaseProject.xcconfig │ ├── StaticLibraryTarget.xcconfig │ └── TestTarget.xcconfig │ ├── Resources │ └── Info.plist │ ├── Samples │ └── FrameworkSample │ │ ├── Info.plist │ │ ├── WidgetFramework.xcodeproj │ │ └── project.pbxproj │ │ ├── runtests.sh │ │ ├── widget.cc │ │ ├── widget.h │ │ └── widget_test.cc │ ├── Scripts │ ├── runtests.sh │ └── versiongenerate.py │ └── gtest.xcodeproj │ └── project.pbxproj └── src ├── config_test.cc ├── manager_test.cc └── tools_test.cc /.gitignore: -------------------------------------------------------------------------------- 1 | ########################################### 2 | # DIRS 3 | _build 4 | _install 5 | tests 6 | cpp/tests/unittest/data 7 | CMakeFiles 8 | deploy 9 | 10 | ########################################### 11 | # SPECIAL FILES 12 | *.rpm* 13 | *.tar* 14 | *.tgz* 15 | *.swp* 16 | *.svn* 17 | *tags* 18 | *.bak 19 | Makefile 20 | CMakeCache.txt 21 | *.gdbm 22 | *.cmake 23 | gmon.out 24 | *.log 25 | 26 | ########################################### 27 | # JAVA COMMON IGNORE 28 | 29 | *.class 30 | 31 | # Mobile Tools for Java (J2ME) 32 | .mtj.tmp/ 33 | 34 | # Package Files # 35 | *.jar 36 | *.war 37 | *.ear 38 | 39 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 40 | hs_err_pid* 41 | 42 | ########################################### 43 | # C++ COMMON IGNORE 44 | 45 | # Compiled Object files 46 | *.slo 47 | *.lo 48 | *.o 49 | *.obj 50 | 51 | # Compiled Dynamic libraries 52 | *.so* 53 | *.dylib 54 | *.dll 55 | 56 | # Compiled Static libraries 57 | *.lai 58 | *.la 59 | *.a 60 | *.lib 61 | 62 | # Executables 63 | *.exe 64 | *.out 65 | *.app 66 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Name should be added: Name or Organization(email address) 2 | 3 | Qihoo 360 4 | 5 | Qiao Junlong(qiaojunlong@360.cn) 6 | Zhu Chao(zhuchao@360.cn) 7 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | LICENSE.996ICU AND LICENSE.MIT 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/LICENSE -------------------------------------------------------------------------------- /LICENSE.MIT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | ==== 24 | 25 | This license applies to all parts of logkafka that are not externally 26 | maintained libraries. 27 | 28 | - confuse 29 | The ISC License (ISC) 30 | 31 | - easylogging 32 | Copyright (c) 2015 muflihun.com 33 | The MIT License (MIT) 34 | 35 | - rapidjson 36 | Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 37 | The MIT License (MIT) 38 | 39 | - tclap 40 | Copyright (c) 2003 Michael E. Smoot 41 | The MIT License (MIT) 42 | -------------------------------------------------------------------------------- /conf/easylogging.conf: -------------------------------------------------------------------------------- 1 | * ALL: // We need to start level with star '*' and end with colon ':' 2 | FORMAT = "%host - %user %datetime %level %thread %loc - %log" // Quotes are not necessary but to make it more readable we wrap quotes around. 3 | FILENAME = "logs/testLog.log" 4 | ENABLED = true 5 | TO_FILE = true 6 | TO_STANDARD_OUTPUT = false 7 | MILLISECONDS_WIDTH = 3 8 | PERFORMANCE_TRACKING = false 9 | ROLL_OUT_SIZE = 2097152 // Throw log files away after 2MB 10 | 11 | // Following configuration only defines FILENAME for ERROR, rest of the configurations are used from ALL configurations above 12 | * ERROR: 13 | FILENAME = "logs/testLog_error.log" // relative to the dir of executable file 14 | 15 | * DEBUG: 16 | FILENAME = "logs/testLog_debug.log" // relative to the dir of executable file 17 | -------------------------------------------------------------------------------- /docs/FAQ.md: -------------------------------------------------------------------------------- 1 | ## FAQ 2 | 3 | #### What situation will cause data loss 4 | 5 | 1. logkafka crash or killed when librdkafka still holds unsent messages 6 | 7 | We choose librdkafka as our message producer, librdkafka only provide *async* interface and use internal memory queue. If you set config `message_timeout_ms=0 (default value)`, the librdkafka will keep your unsent messages in its memory queue until sent successfully. Consequencely, the messages will be lost if the program crashes when there are still unsent messages in librdkafka's queue. 8 | 9 | Solution: the optimal solution is providing [disk persistent queue](https://github.com/edenhill/librdkafka/issues/31) in librdkafka, and we are working on it. 10 | 11 | 2. log file was deleted before logkafka start collecting it 12 | 13 | Assumed that current time is 2015.01.01.03, f1 is being collecting, and f2, f3 are not collected. 14 | 15 | ``` 16 | f1: /usr/local/logkafka/systest/src/logkafka_test.2015.01.01.01 (Collecting) 17 | f2: /usr/local/logkafka/systest/src/logkafka_test.2015.01.01.02 (Uncollected) 18 | f3: /usr/local/logkafka/systest/src/logkafka_test.2015.01.01.03 (Uncollected) 19 | ``` 20 | 21 | Now, delete f1 and f2, the data of f2 will be lost. 22 | 23 | The log file will be colleted as fast as possible, but if log file is too huge, or going through network failure, collection will be stuck. 24 | 25 | Solution: monitor the log collecting state will prevent this from happening. 26 | 27 | #### Will out-of-order delivery happen 28 | 29 | Yes, but just when network failue happen. 30 | 31 | -------------------------------------------------------------------------------- /docs/Users.md: -------------------------------------------------------------------------------- 1 | ## Users 2 | 3 | ### Qihoo360 4 | 5 | * Team addops: We deployed logkafka over +100 servers to collect openstack logs. 6 | 7 | ### ICBC 8 | 9 | * Team SDC (Software Development Center): We use logkafka to collect ssdb read&write operation logs. -------------------------------------------------------------------------------- /docs/imgs/add_cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/docs/imgs/add_cluster.png -------------------------------------------------------------------------------- /docs/imgs/create_logkafka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/docs/imgs/create_logkafka.png -------------------------------------------------------------------------------- /docs/imgs/delete_logkafka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/docs/imgs/delete_logkafka.png -------------------------------------------------------------------------------- /docs/imgs/list_logkafka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/docs/imgs/list_logkafka.png -------------------------------------------------------------------------------- /docs/imgs/logkafka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/docs/imgs/logkafka.png -------------------------------------------------------------------------------- /docs/install-libgdbm.md: -------------------------------------------------------------------------------- 1 | ## install libgdbm 2 | 3 | 4 | For Centos, just run `sudo yum install -y gdbm` 5 | 6 | Or, build from source 7 | 8 | ``` 9 | cd /tmp 10 | wget -N -O- http://ftp.gnu.org/gnu/gdbm/gdbm-1.8.3.tar.gz | tar zxvf - 11 | cd gdbm-1.8.3 12 | ./configure 13 | make -j4 14 | sudo make BINOWN=root BINGRP=root install-compat 15 | ``` 16 | -------------------------------------------------------------------------------- /docs/install-libpcre2.md: -------------------------------------------------------------------------------- 1 | ## install libpcre2 2 | 3 | For Mac: 4 | ``` 5 | brew install pcre2 6 | ``` 7 | 8 | For linux: 9 | ``` 10 | cd /tmp 11 | wget -N -O- http://sourceforge.net/projects/pcre/files/pcre2/10.20/pcre2-10.20.tar.gz | tar zxvf - 12 | cd pcre2-10.20 13 | ./configure 14 | make -j4 15 | sudo make install 16 | ``` 17 | Any problems, check [this](http://www.pcre.org/) 18 | -------------------------------------------------------------------------------- /docs/install-librdkafka.md: -------------------------------------------------------------------------------- 1 | ## install librdkafka 2 | 3 | For Mac and linux: 4 | ``` 5 | cd /tmp 6 | 7 | wget -N https://github.com/edenhill/librdkafka/archive/0.8.6.zip -O librdkafka.zip; 8 | unzip librdkafka.zip 9 | rm -f librdkafka.zip 10 | 11 | cd librdkafka-0.8.6 12 | ./configure 13 | make -j4 14 | sudo make install 15 | ``` 16 | 17 | Any problems, check [this](https://github.com/edenhill/librdkafka) 18 | -------------------------------------------------------------------------------- /docs/install-libuv.md: -------------------------------------------------------------------------------- 1 | ## install libuv 2 | 3 | 4 | For Centos, just run `sudo yum install -y libuv` 5 | 6 | Or, build from source 7 | 8 | ``` 9 | cd /tmp 10 | git clone https://github.com/libuv/libuv.git 11 | cd libuv 12 | sh autogen.sh 13 | ./configure 14 | make -j4 15 | sudo make install 16 | ``` 17 | -------------------------------------------------------------------------------- /docs/install-libzookeeper_mt.md: -------------------------------------------------------------------------------- 1 | ## install libzookeeper_mt 2 | 3 | 4 | ``` 5 | cd /tmp 6 | 7 | wget -N http://archive.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz 8 | tar zxvf zookeeper-3.4.6.tar.gz 9 | rm -f zookeeper-3.4.6.tar.gz 10 | 11 | cd zookeeper-3.4.6/src/c 12 | ./configure 13 | make -j4 14 | sudo make install 15 | ``` 16 | Any problems, check [this](http://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#Installation) 17 | -------------------------------------------------------------------------------- /docs/install-php-zookeeper-extension.md: -------------------------------------------------------------------------------- 1 | ## install php zookeeper extension 2 | 3 | We assume that you already have php installed, version > 5.3. 4 | 5 | 1. check your php version 6 | 7 | ``` 8 | php -v 9 | ``` 10 | 11 | 2. download php zookeeper package 12 | 13 | ``` 14 | cd /tmp 15 | wget -N -O- https://pecl.php.net/get/zookeeper-0.2.2.tgz | tar zxvf - 16 | cd zookeeper-0.2.2 17 | phpize 18 | ./configure --with-php-config=/usr/local/php/bin/php-config --with-libzookeeper-dir=/usr/local/zookeeper 19 | make 20 | sudo make install 21 | ``` 22 | 23 | 3. add zookeeper item to php.ini 24 | 25 | check your php.ini 26 | 27 | ``` 28 | php -i | grep php.ini 29 | ``` 30 | 31 | add below to your php.ini 32 | 33 | ``` 34 | ; zookeeper 35 | extension=zookeeper.so 36 | ``` -------------------------------------------------------------------------------- /docs/ppt/log_collection_research_report.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/docs/ppt/log_collection_research_report.key -------------------------------------------------------------------------------- /docs/ppt/logkafka.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/docs/ppt/logkafka.graffle -------------------------------------------------------------------------------- /modules/Buildlibpcre2.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "installing libpcre2 ...") 2 | CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2) 3 | 4 | ExternalProject_Add(project_libpcre2 5 | URL http://sourceforge.net/projects/pcre/files/pcre2/10.20/pcre2-10.20.tar.gz 6 | PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libpcre2 7 | CONFIGURE_COMMAND cd && ./configure --prefix= 8 | BUILD_COMMAND cd && make -j4 9 | INSTALL_COMMAND cd && make install 10 | ) 11 | 12 | ExternalProject_Get_Property(project_libpcre2 install_dir) 13 | 14 | add_library(libpcre2 STATIC IMPORTED) 15 | set_property(TARGET libpcre2 PROPERTY IMPORTED_LOCATION ${install_dir}/lib/libpcre2-8.a) 16 | add_dependencies(libpcre2 project_libpcre2) 17 | ADD_DEPENDENCIES(logkafka_lib project_libpcre2) 18 | 19 | TARGET_LINK_LIBRARIES(logkafka libpcre2) 20 | INCLUDE_DIRECTORIES(${install_dir}/include) 21 | -------------------------------------------------------------------------------- /modules/Buildlibrdkafka.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "installing librdkafka ...") 2 | CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2) 3 | 4 | ExternalProject_Add(project_librdkafka 5 | GIT_REPOSITORY https://github.com/edenhill/librdkafka.git 6 | GIT_TAG 0.8.6 7 | PREFIX ${CMAKE_CURRENT_BINARY_DIR}/librdkafka 8 | CONFIGURE_COMMAND cd && ./configure --prefix= 9 | BUILD_COMMAND cd && make 10 | INSTALL_COMMAND cd && make install 11 | ) 12 | 13 | ExternalProject_Get_Property(project_librdkafka install_dir) 14 | 15 | #add_library(librdkafka SHARED IMPORTED) 16 | #set_property(TARGET librdkafka PROPERTY IMPORTED_LOCATION ${install_dir}/lib/librdkafka.so) 17 | add_library(librdkafka STATIC IMPORTED) 18 | set_property(TARGET librdkafka PROPERTY IMPORTED_LOCATION ${install_dir}/lib/librdkafka.a) 19 | add_dependencies(librdkafka project_librdkafka) 20 | ADD_DEPENDENCIES(logkafka_lib project_librdkafka) 21 | 22 | TARGET_LINK_LIBRARIES(logkafka librdkafka) 23 | INCLUDE_DIRECTORIES(${install_dir}/include) 24 | -------------------------------------------------------------------------------- /modules/Buildlibuv.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "installing libuv ...") 2 | CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2) 3 | 4 | ExternalProject_Add(project_libuv 5 | GIT_REPOSITORY https://github.com/libuv/libuv.git 6 | GIT_TAG v1.6.0 7 | PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libuv 8 | CONFIGURE_COMMAND cd && sh autogen.sh && ./configure --prefix= 9 | BUILD_COMMAND cd && make 10 | INSTALL_COMMAND cd && make install 11 | ) 12 | 13 | ExternalProject_Get_Property(project_libuv install_dir) 14 | 15 | #add_library(libuv SHARED IMPORTED) 16 | #set_property(TARGET libuv PROPERTY IMPORTED_LOCATION ${install_dir}/lib/libuv.so) 17 | add_library(libuv STATIC IMPORTED) 18 | set_property(TARGET libuv PROPERTY IMPORTED_LOCATION ${install_dir}/lib/libuv.a) 19 | add_dependencies(libuv project_libuv) 20 | ADD_DEPENDENCIES(logkafka_lib project_libuv) 21 | 22 | TARGET_LINK_LIBRARIES(logkafka libuv) 23 | INCLUDE_DIRECTORIES(${install_dir}/include) 24 | -------------------------------------------------------------------------------- /modules/Buildlibzookeeper_mt.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "installing libzookeeper_mt ...") 2 | CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2) 3 | 4 | IF (OS_X_VERSION VERSION_GREATER_EQUAL "10.10") 5 | MESSAGE(STATUS "downloading lib zookeeper patch for Mac OS X ${OS_X_VERSION} ...") 6 | #SET(ZOOKEEPER_PATCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/libzookeeper_mt/ZOOKEEPER-2049.noprefix.trunk.patch) 7 | #SET(ZOOKEEPER_PATCH_URL https://issues.apache.org/jira/secure/attachment/12673212/ZOOKEEPER-2049.noprefix.trunk.patch) 8 | #EXECUTE_PROCESS(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libzookeeper_mt 9 | # COMMAND wget ${ZOOKEEPER_PATCH_URL} -O ${ZOOKEEPER_PATCH_FILE}) 10 | SET(ZOOKEEPER_PATCH_FILE ${PROJECT_SOURCE_DIR}/patches/ZOOKEEPER-2049.noprefix.trunk.patch) 11 | SET(LIBZK_OSX_PATCH_CMD "patch -p0 -N -s < ${ZOOKEEPER_PATCH_FILE} || true") 12 | ELSE (OS_X_VERSION VERSION_GREATER_EQUAL "10.10") 13 | SET(LIBZK_OSX_PATCH_CMD ":") # do nothing 14 | ENDIF (OS_X_VERSION VERSION_GREATER_EQUAL "10.10") 15 | 16 | ExternalProject_Add(project_libzookeeper_mt 17 | URL http://archive.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz 18 | PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libzookeeper_mt 19 | PATCH_COMMAND cd && sh -c "${LIBZK_OSX_PATCH_CMD}" 20 | CONFIGURE_COMMAND cd /src/c && ./configure --prefix= 21 | BUILD_COMMAND cd /src/c && make -j4 22 | INSTALL_COMMAND cd /src/c && make install 23 | ) 24 | 25 | ExternalProject_Get_Property(project_libzookeeper_mt install_dir) 26 | 27 | add_library(libzookeeper_mt STATIC IMPORTED) 28 | set_property(TARGET libzookeeper_mt PROPERTY IMPORTED_LOCATION ${install_dir}/lib/libzookeeper_mt.a) 29 | add_dependencies(libzookeeper_mt project_libzookeeper_mt) 30 | ADD_DEPENDENCIES(logkafka_lib project_libzookeeper_mt) 31 | 32 | TARGET_LINK_LIBRARIES(logkafka libzookeeper_mt) 33 | INCLUDE_DIRECTORIES(${install_dir}/include) 34 | -------------------------------------------------------------------------------- /modules/Findlibgcov.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "Using bundled Findlibgcov.cmake...") 2 | FIND_PATH( 3 | LIBGCOV_INCLUDE_DIR 4 | /usr/include/ 5 | /usr/local/include/ 6 | ) 7 | 8 | FIND_LIBRARY( 9 | LIBGCOV_LIBRARIES NAMES libgcov.a gcov 10 | PATHS /usr/lib/ /usr/local/lib/ 11 | ) 12 | -------------------------------------------------------------------------------- /modules/Findlibpcre2.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "Using bundled Findlibpcre2.cmake...") 2 | FIND_PATH( 3 | LIBPCRE2_INCLUDE_DIR 4 | pcre2.h 5 | /usr/include/ 6 | /usr/local/include 7 | /usr/local/include/pcre2 8 | /usr/local/opt/pcre2/include/pcre2 9 | ) 10 | 11 | FIND_LIBRARY( 12 | LIBPCRE2_LIBRARIES NAMES libpcre2-8.a pcre2 13 | PATHS /usr/lib /usr/local/lib /usr/local/opt/pcre2/lib 14 | ) 15 | -------------------------------------------------------------------------------- /modules/Findlibpthread.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "Using bundled Findlibpthread.cmake...") 2 | FIND_PATH( 3 | LIBPTHREAD_INCLUDE_DIR 4 | pthread.h 5 | /usr/include/ 6 | /usr/local/include/ 7 | ) 8 | 9 | FIND_LIBRARY( 10 | LIBPTHREAD_LIBRARIES NAMES pthread 11 | PATHS /usr/lib/ /usr/local/lib/ 12 | ) 13 | -------------------------------------------------------------------------------- /modules/Findlibrdkafka.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "Using bundled Findlibrdkafka.cmake...") 2 | FIND_PATH( 3 | LIBRDKAFKA_INCLUDE_DIR 4 | librdkafka/rdkafka.h 5 | /usr/include/ 6 | /usr/local/include/ 7 | /usr/local/opt/librdkafka/include/ 8 | ) 9 | 10 | FIND_LIBRARY( 11 | LIBRDKAFKA_LIBRARIES NAMES librdkafka.a rdkafka 12 | PATHS /usr/lib/ /usr/local/lib/ /usr/local/opt/librdkafka/lib/ 13 | ) 14 | -------------------------------------------------------------------------------- /modules/Findlibrt.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "Using bundled Findlibrt.cmake...") 2 | FIND_PATH( 3 | LIBRT_INCLUDE_DIR 4 | time.h 5 | /usr/include/ 6 | /usr/local/include/ 7 | ) 8 | 9 | FIND_LIBRARY( 10 | LIBRT_LIBRARIES NAMES rt 11 | PATHS /usr/lib/ /usr/local/lib/ 12 | ) 13 | -------------------------------------------------------------------------------- /modules/Findlibuv.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "Using bundled Findlibuv.cmake...") 2 | FIND_PATH( 3 | LIBUV_INCLUDE_DIR 4 | uv.h 5 | /usr/include/ 6 | /usr/local/include/uv 7 | ) 8 | 9 | FIND_LIBRARY( 10 | LIBUV_LIBRARIES NAMES libuv.a uv 11 | PATHS /usr/lib /usr/local/lib 12 | ) 13 | -------------------------------------------------------------------------------- /modules/Findlibz.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "Using bundled Findlibz.cmake...") 2 | FIND_PATH( 3 | LIBZ_INCLUDE_DIR 4 | zlib.h 5 | /usr/include/ 6 | /usr/local/include/ 7 | /usr/local/opt/zlib/include/ 8 | ) 9 | 10 | FIND_LIBRARY( 11 | LIBZ_LIBRARIES NAMES z 12 | PATHS /usr/lib/ /usr/local/lib/ /usr/local/opt/zlib/lib 13 | ) 14 | -------------------------------------------------------------------------------- /modules/Findlibzookeeper_mt.cmake: -------------------------------------------------------------------------------- 1 | MESSAGE(STATUS "Using bundled Findlibzookeeper_mt.cmake...") 2 | FIND_PATH( 3 | LIBZOOKEEPER_MT_INCLUDE_DIR 4 | zookeeper.h 5 | $ENV{LIBZOOKEEPER_INCLUDE_PATH} 6 | /usr/include/zookeeper 7 | /usr/include/ 8 | /usr/local/include/ 9 | /usr/local/include/zookeeper/ 10 | /usr/local/zookeeper/include/zookeeper/ 11 | /usr/local/opt/zookeeper/include/zookeeper/ 12 | ) 13 | 14 | FIND_LIBRARY( 15 | LIBZOOKEEPER_MT_LIBRARIES NAMES libzookeeper_mt.a zookeeper_mt 16 | PATHS $ENV{LIBZOOKEEPER_LIB_PATH} /usr/lib/ /usr/local/lib/ /usr/local/zookeeper/lib/ /usr/local/opt/zookeeper/lib/ 17 | ) 18 | -------------------------------------------------------------------------------- /src/base/Property.h: -------------------------------------------------------------------------------- 1 | // Some utility templates for emulating 2 | // properties - preferring a library solution 3 | // to a new language feature 4 | // Each property has three sets of redundant 5 | // acccessors: 6 | // 1. function call syntax 7 | // 2. get() and set() functions 8 | // 3. overloaded operator = 9 | 10 | // a read-write property with data store and 11 | // automatically generated get/set functions. 12 | // this is what C++/CLI calls a trivial scalar 13 | // property 14 | template 15 | class Property { 16 | T data; 17 | public: 18 | 19 | // access with function call syntax 20 | Property() : data() { } 21 | T operator()() const { 22 | return data; 23 | } 24 | T operator()(T const & value) { 25 | data = value; 26 | return data; 27 | } 28 | 29 | // access with get()/set() syntax 30 | T get() const { 31 | return data; 32 | } 33 | T set(T const & value) { 34 | data = value; 35 | return data; 36 | } 37 | 38 | // access with '=' sign 39 | // in an industrial-strength library, 40 | // specializations for appropriate types 41 | // might choose to add combined operators 42 | // like +=, etc. 43 | operator T() const { 44 | return data; 45 | } 46 | T operator=(T const & value) { 47 | data = value; 48 | return data; 49 | } 50 | typedef T value_type; 51 | // might be useful for template 52 | // deductions 53 | }; 54 | -------------------------------------------------------------------------------- /src/base/ROProperty.h: -------------------------------------------------------------------------------- 1 | // a read-only property calling a 2 | // user-defined getter 3 | template 5 | class ROProperty { 6 | Object * my_object; 7 | public: 8 | ROProperty() : my_object(0) {} 9 | ROProperty(Object * me) 10 | : my_object(me) {} 11 | 12 | // this function must be called by the 13 | // containing class, normally in a 14 | // constructor, to initialize the 15 | // ROProperty so it knows where its 16 | // real implementation code can be 17 | // found. 18 | // obj is usually the containing 19 | // class, but need not be; it could be a 20 | // special implementation object. 21 | void operator()(Object * obj) { 22 | my_object = obj; 23 | } 24 | 25 | // function call syntax 26 | T operator()() const { 27 | return (my_object->*real_getter)(); 28 | } 29 | 30 | // get/set syntax 31 | T get() const { 32 | return (my_object->*real_getter)(); 33 | } 34 | void set(T const & value); 35 | // reserved but not implemented, 36 | // per C++/CLI 37 | 38 | // use on rhs of '=' 39 | operator T() const { 40 | return (my_object->*real_getter)(); 41 | } 42 | 43 | typedef T value_type; 44 | // might be useful for template 45 | // deductions 46 | }; 47 | 48 | -------------------------------------------------------------------------------- /src/base/RWProperty.h: -------------------------------------------------------------------------------- 1 | // a read-write property which invokes 2 | // user-defined functions 3 | template 7 | class RWProperty { 8 | Object * my_object; 9 | public: 10 | RWProperty() : my_object(0) {} 11 | RWProperty(Object * me) 12 | : my_object(me) {} 13 | 14 | // this function must be called by the 15 | // containing class, normally in a 16 | // constructor, to initialize the 17 | // ROProperty so it knows where its 18 | // real implementation code can be 19 | // found 20 | void operator()(Object * obj) { 21 | my_object = obj; 22 | } 23 | 24 | // function call syntax 25 | T operator()() const { 26 | return (my_object->*real_getter)(); 27 | } 28 | T operator()(T const & value) { 29 | return (my_object->*real_setter)(value); 30 | } 31 | 32 | // get/set syntax 33 | T get() const { 34 | return (my_object->*real_getter)(); 35 | } 36 | T set(T const & value) { 37 | return (my_object->*real_setter)(value); 38 | } 39 | // access with '=' sign 40 | operator T() const { 41 | return (my_object->*real_getter)(); 42 | } 43 | T operator=(T const & value) { 44 | return (my_object->*real_setter)(value); 45 | } 46 | 47 | typedef T value_type; 48 | // might be useful for template 49 | // deductions 50 | }; 51 | -------------------------------------------------------------------------------- /src/base/WOProperty.h: -------------------------------------------------------------------------------- 1 | // a write-only property calling a 2 | // user-defined setter 3 | template 5 | class WOProperty { 6 | Object * my_object; 7 | public: 8 | WOProperty() : my_object(0) {} 9 | WOProperty(Object * me) 10 | : my_object(me) {} 11 | 12 | // this function must be called by the 13 | // containing class, normally in a 14 | // constructor, to initialize the 15 | // WOProperty so it knows where its real 16 | // implementation code can be found 17 | void operator()(Object * obj) { 18 | my_object = obj; 19 | } 20 | // function call syntax 21 | T operator()(T const & value) { 22 | return (my_object->*real_setter)(value); 23 | } 24 | // get/set syntax 25 | T get() const; 26 | // reserved but not implemented, 27 | // per C++/CLI 28 | T set(T const & value) { 29 | return (my_object->*real_setter)(value); 30 | } 31 | 32 | // access with '=' sign 33 | T operator=(T const & value) { 34 | return (my_object->*real_setter)(value); 35 | } 36 | 37 | typedef T value_type; 38 | // might be useful for template 39 | // deductions 40 | }; 41 | -------------------------------------------------------------------------------- /src/base/common.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef BASE_COMMON_H_ 23 | #define BASE_COMMON_H_ 24 | 25 | #define INO_NONE 0 26 | #define FD_NONE -1 27 | 28 | #endif // BASE_COMMON_H_ 29 | -------------------------------------------------------------------------------- /src/base/mutex.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef BASE_MUTEX_H_ 23 | #define BASE_MUTEX_H_ 24 | 25 | #include 26 | #include 27 | 28 | namespace base { 29 | 30 | class Mutex 31 | { 32 | public: 33 | Mutex() 34 | { 35 | if ((pthread_mutex_init(&m_lock, NULL) != 0)) { 36 | throw "init spin lock failed!!!"; 37 | } 38 | } 39 | 40 | ~Mutex() 41 | { 42 | pthread_mutex_destroy(&m_lock); 43 | } 44 | 45 | void lock() 46 | { 47 | pthread_mutex_lock(&m_lock); 48 | } 49 | 50 | void unlock() 51 | { 52 | pthread_mutex_unlock(&m_lock); 53 | } 54 | 55 | pthread_mutex_t& mutex() 56 | { 57 | return m_lock; 58 | } 59 | 60 | private: 61 | pthread_mutex_t m_lock; 62 | }; 63 | 64 | } // namespace base 65 | 66 | #endif // BASE_MUTEX_H_ 67 | -------------------------------------------------------------------------------- /src/base/noncopyable.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef BASE_NONCOPYABLE_H_ 23 | #define BASE_NONCOPYABLE_H_ 24 | 25 | namespace base { 26 | 27 | // Private copy constructor and copy assignment ensure classes derived from 28 | // class noncopyable cannot be copied. 29 | 30 | // Contributed by Dave Abrahams 31 | 32 | namespace noncopyable_ // protection from unintended ADL 33 | { 34 | class noncopyable 35 | { 36 | protected: 37 | noncopyable() {} 38 | ~noncopyable() {} 39 | private: // emphasize the following members are private 40 | noncopyable( const noncopyable& ); 41 | const noncopyable& operator=( const noncopyable& ); 42 | }; 43 | } 44 | 45 | typedef noncopyable_::noncopyable noncopyable; 46 | 47 | } // namespace base 48 | 49 | #endif // BASE_NONCOPYABLE_H_ 50 | -------------------------------------------------------------------------------- /src/base/singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef BASE_SINGLETON_H_ 2 | #define BASE_SINGLETON_H_ 3 | 4 | #include 5 | #include "base/noncopyable.h" 6 | 7 | namespace base { 8 | 9 | template 10 | class Singleton : base::noncopyable { 11 | public: 12 | static T& instance() { 13 | pthread_once(&ponce_, &Singleton::init); 14 | return *value_; 15 | } 16 | 17 | static void init() { 18 | value_ = new T(); 19 | } 20 | private: 21 | static pthread_once_t ponce_; 22 | static T* value_; 23 | }; 24 | 25 | template 26 | pthread_once_t Singleton::ponce_ = PTHREAD_ONCE_INIT; 27 | 28 | template 29 | T* Singleton::value_ = NULL; 30 | 31 | } // namespace base 32 | 33 | #endif // BASE_SINGLETON_H_ 34 | -------------------------------------------------------------------------------- /src/logkafka/filter.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef LOGKAFKA_FILTER_H_ 23 | #define LOGKAFKA_FILTER_H_ 24 | 25 | #include 26 | #include 27 | 28 | using namespace std; 29 | 30 | namespace logkafka { 31 | 32 | class Filter 33 | { 34 | public: 35 | Filter() {}; 36 | virtual ~Filter() {}; 37 | virtual bool init(void *arg) = 0; 38 | virtual bool filter(void *arg, vector &lines) = 0; 39 | }; 40 | 41 | } // namespace logkafka 42 | 43 | #endif // LOGKAFKA_FILTER_H_ 44 | -------------------------------------------------------------------------------- /src/logkafka/filter_regex.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef LOGKAFKA_FILTER_REGEX_H_ 23 | #define LOGKAFKA_FILTER_REGEX_H_ 24 | 25 | #include 26 | #include 27 | 28 | #include "logkafka/filter.h" 29 | #include "logkafka/task_conf.h" 30 | 31 | #include "pcre2.h" 32 | 33 | using namespace std; 34 | 35 | namespace logkafka { 36 | 37 | class FilterRegex: public virtual Filter 38 | { 39 | public: 40 | FilterRegex(): Filter() {}; 41 | FilterRegex(FilterConf filter_conf): 42 | m_filter_conf(filter_conf) { m_re = NULL; }; 43 | virtual ~FilterRegex() { 44 | pcre2_code_free(m_re); m_re = NULL; 45 | }; 46 | bool init(void *arg); 47 | bool filter(void *arg, vector &lines); 48 | 49 | private: 50 | FilterConf m_filter_conf; 51 | pcre2_code *m_re; 52 | }; 53 | 54 | } // namespace logkafka 55 | 56 | #endif // LOGKAFKA_FILTER_REGEX_H_ 57 | -------------------------------------------------------------------------------- /src/logkafka/logkafka.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef LOGKAFKA_H_ 23 | #define LOGKAFKA_H_ 24 | 25 | #include "base/timer_watcher.h" 26 | #include "logkafka/config.h" 27 | #include "logkafka/manager.h" 28 | #include "logkafka/signal_handler.h" 29 | 30 | using namespace std; 31 | using namespace base; 32 | 33 | namespace logkafka { 34 | 35 | class LogKafka 36 | { 37 | public: 38 | LogKafka() {}; 39 | explicit LogKafka(const Config *config); 40 | ~LogKafka(); 41 | 42 | bool init(); 43 | void close(); 44 | bool start(); 45 | void stop(); 46 | 47 | static void onSignal(void *arg); 48 | static void exitAsyncCb(uv_async_t* handle); 49 | 50 | private: 51 | Manager *m_manager; 52 | uv_loop_t *m_loop; 53 | SignalHandler *m_signal_handler; 54 | TimerWatcher *m_upload_timer_trigger; 55 | 56 | const Config *m_config; 57 | uv_async_t m_exit_handle; 58 | }; 59 | 60 | } // namespace logkafka 61 | 62 | #endif // LOGKAFKA_H_ 63 | -------------------------------------------------------------------------------- /src/logkafka/memory_position_entry.cc: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #include "logkafka/memory_position_entry.h" 23 | 24 | namespace logkafka { 25 | 26 | bool MemoryPositionEntry::update(ino_t inode, off_t pos) 27 | {/*{{{*/ 28 | m_inode = inode; 29 | m_pos = pos; 30 | 31 | return true; 32 | }/*}}}*/ 33 | 34 | bool MemoryPositionEntry::updatePos(off_t pos) 35 | {/*{{{*/ 36 | m_pos = pos; 37 | 38 | return true; 39 | }/*}}}*/ 40 | 41 | ino_t MemoryPositionEntry::readInode() 42 | {/*{{{*/ 43 | return m_inode; 44 | }/*}}}*/ 45 | 46 | off_t MemoryPositionEntry::readPos() 47 | {/*{{{*/ 48 | return m_pos; 49 | }/*}}}*/ 50 | 51 | } // namespace logkafka 52 | -------------------------------------------------------------------------------- /src/logkafka/memory_position_entry.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef LOGKAFKA_MEMORY_POSITION_ENTRY_H_ 23 | #define LOGKAFKA_MEMORY_POSITION_ENTRY_H_ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include "base/common.h" 34 | #include "logkafka/position_entry.h" 35 | 36 | using namespace std; 37 | 38 | namespace logkafka { 39 | 40 | class MemoryPositionEntry: public virtual PositionEntry 41 | { 42 | public: 43 | MemoryPositionEntry(): PositionEntry() {}; 44 | bool init(ino_t inode, off_t pos); 45 | bool update(ino_t inode, off_t pos); 46 | bool updatePos(off_t pos); 47 | ino_t readInode(); 48 | off_t readPos(); 49 | 50 | private: 51 | ino_t m_inode; 52 | off_t m_pos; 53 | }; 54 | 55 | } // namespace logkafka 56 | 57 | #endif // LOGKAFKA_MEMORY_POSITION_ENTRY_H_ 58 | -------------------------------------------------------------------------------- /src/logkafka/option.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef LOGKAFKA_OPTION_H_ 23 | #define LOGKAFKA_OPTION_H_ 24 | 25 | #include 26 | 27 | using namespace std; 28 | 29 | namespace logkafka { 30 | 31 | class Option 32 | { 33 | public: 34 | Option(); 35 | Option(int argc, char *argv[]); 36 | void parseArgs(int argc, char *argv[], Option &option); 37 | 38 | public: 39 | string logkafka_config_path; 40 | string easylogging_config_path; 41 | bool daemon; 42 | }; 43 | 44 | } // namespace logkafka 45 | 46 | #endif // LOGKAFKA_OPTION_H_ 47 | -------------------------------------------------------------------------------- /src/logkafka/output.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef LOGKAFKA_OUTPUT_H_ 23 | #define LOGKAFKA_OUTPUT_H_ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include "base/common.h" 34 | 35 | using namespace std; 36 | 37 | namespace logkafka { 38 | 39 | class Output 40 | { 41 | public: 42 | Output() {}; 43 | virtual ~Output() {}; 44 | virtual bool init(void *arg) = 0; 45 | virtual bool output(void *arg, 46 | const vector &lines, 47 | vector &unsent_lines) = 0; 48 | }; 49 | 50 | } // namespace logkafka 51 | 52 | #endif // LOGKAFKA_OUTPUT_H_ 53 | -------------------------------------------------------------------------------- /src/logkafka/position_entry.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef LOGKAFKA_POSITION_ENTRY_H_ 23 | #define LOGKAFKA_POSITION_ENTRY_H_ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include "base/common.h" 34 | 35 | using namespace std; 36 | 37 | namespace logkafka { 38 | 39 | class PositionEntry 40 | { 41 | public: 42 | PositionEntry() {}; 43 | virtual ~PositionEntry() {}; 44 | virtual bool update(ino_t inode, off_t pos) = 0; 45 | virtual bool updatePos(off_t pos) = 0; 46 | virtual ino_t readInode() = 0; 47 | virtual off_t readPos() = 0; 48 | }; 49 | 50 | } // namespace logkafka 51 | 52 | #endif // LOGKAFKA_POSITION_ENTRY_H_ 53 | -------------------------------------------------------------------------------- /src/logkafka/properties.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef LOGKAFKA_PROPERTIES_H_ 23 | #define LOGKAFKA_PROPERTIES_H_ 24 | 25 | #include 26 | 27 | using namespace std; 28 | 29 | namespace logkafka { 30 | 31 | class Properties 32 | { 33 | public: 34 | string logkafka_config_path; 35 | string easylogging_config_path; 36 | }; 37 | 38 | } // namespace logkafka 39 | 40 | #endif // LOGKAFKA_PROPERTIES_H_ 41 | -------------------------------------------------------------------------------- /src/logkafka/signal_handler.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // logkafka - Collect logs and send lines to Apache Kafka v0.8+ 4 | // 5 | /////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. 8 | // 9 | // Licensed under the MIT License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://opensource.org/licenses/MIT 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | /////////////////////////////////////////////////////////////////////////// 22 | #ifndef LOGKAFKA_SIGNAL_HANDLER_H_ 23 | #define LOGKAFKA_SIGNAL_HANDLER_H_ 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include "base/tools.h" 32 | 33 | #include "easylogging/easylogging++.h" 34 | 35 | #include 36 | 37 | using namespace std; 38 | 39 | namespace logkafka { 40 | 41 | typedef void (*SignalFunc)(void *); 42 | 43 | class SignalHandler 44 | { 45 | public: 46 | SignalHandler() {}; 47 | bool init(uv_loop_t *loop, 48 | int signum, 49 | void *signal_func_arg, 50 | SignalFunc on_signal); 51 | 52 | private: 53 | static void default_cb(uv_signal_t* handle, int signum); 54 | SignalFunc m_signal_func; 55 | void *m_signal_func_arg; 56 | uv_signal_t m_handle; 57 | }; 58 | 59 | } // namespace logkafka 60 | 61 | #endif // LOGKAFKA_SIGNAL_HANDLER_H_ 62 | -------------------------------------------------------------------------------- /src/third_party/confuse/.cvsignore: -------------------------------------------------------------------------------- 1 | .gdb_history 2 | aclocal.m4 3 | autom4te.cache 4 | config.h 5 | config.h.in 6 | config.log 7 | config.status 8 | configure 9 | confuse-config 10 | Doxyfile 11 | libconfuse.pc 12 | libconfuse.spec 13 | libtool 14 | libtool.patch 15 | Makefile 16 | Makefile.in 17 | stamp-h1 18 | -------------------------------------------------------------------------------- /src/third_party/confuse/AUTHORS: -------------------------------------------------------------------------------- 1 | Martin Hedenfalk 2 | 3 | Josh Myer fixed a buffer-checking FIXME 4 | -------------------------------------------------------------------------------- /src/third_party/confuse/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(src .) 2 | aux_source_directory(src DIR_LIB_SRCS) 3 | add_library (confuse ${DIR_LIB_SRCS}) 4 | 5 | set(package_version, '2.7') 6 | add_definitions(-DPACKAGE_VERSION="${package_version}") 7 | set(package_string, 'libConfuse 2.7') 8 | add_definitions(-DPACKAGE_STRING="${package_string}") 9 | add_definitions(-DHAVE_STRDUP) 10 | add_definitions(-DHAVE_STRNDUP) 11 | 12 | IF (OS_X_VERSION VERSION_GREATER "10.10") 13 | add_definitions(-DHAVE_UNISTD_H) 14 | ENDIF (OS_X_VERSION VERSION_GREATER "10.10") 15 | -------------------------------------------------------------------------------- /src/third_party/confuse/README: -------------------------------------------------------------------------------- 1 | This is libConfuse, a library for parsing configuration files. It was 2 | called libcfg before, but was changed to not confuse with other 3 | similar libraries. 4 | 5 | See the INSTALL file for installation instructions. By default, only a 6 | static library is built. Specify --enable-shared to the configure 7 | script to also build a shared library. 8 | 9 | With libtool 1.4.2 (and/or automake 1.6.3) there is a problem building 10 | the sources. The libtool script expects the environment variable SED 11 | to point to a usable sed binary, but this variable does not get 12 | set. You'll have to do a "export SED=sed" (if using bash) or "setenv 13 | SED sed" (if using csh) before running make. 14 | 15 | Documentation can be built by running doxygen in the top-level 16 | directory. It is also available at http://www.nongnu.org/confuse/manual/. 17 | 18 | There is a project page at http://sv.nongnu.org/projects/confuse. 19 | Report bugs to 20 | 21 | -------------------------------------------------------------------------------- /src/third_party/confuse/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo -n "Running autopoint..." 4 | autopoint && echo " done" 5 | rm -f ABOUT-NLS 6 | 7 | echo -n "Running aclocal..." 8 | aclocal -I m4 || exit 9 | echo " done" 10 | 11 | echo -n "Running autoconf..." 12 | autoconf || exit 13 | echo " done" 14 | 15 | echo -n "Running autoheader..." 16 | autoheader || exit 17 | echo " done" 18 | 19 | echo -n "Running libtoolize..." 20 | libtoolize --automake || glibtoolize --automake || exit 21 | echo " done" 22 | 23 | echo -n "Running automake..." 24 | automake --add-missing || exit 25 | echo " done" 26 | 27 | echo "Running configure $*..." 28 | ./configure --enable-maintainer-mode $* 29 | 30 | -------------------------------------------------------------------------------- /src/third_party/confuse/configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with -*- autoconf -*- to produce a configure script. 2 | 3 | AC_PREREQ(2.50) 4 | 5 | AC_INIT(libConfuse, 2.7, confuse-devel@nongnu.org, confuse) 6 | AC_CONFIG_AUX_DIR(support) 7 | AM_MAINTAINER_MODE 8 | AM_INIT_AUTOMAKE 9 | AM_CONFIG_HEADER(config.h) 10 | AC_CONFIG_SRCDIR(src/confuse.c) 11 | 12 | # Checks for programs. 13 | # disable unnecessary compiler checks 14 | AC_DEFUN([AC_PROG_F77], [:]) 15 | AC_DEFUN([AC_PROG_FC], [:]) 16 | AC_DEFUN([AC_PROG_CXX], [:]) 17 | AC_DEFUN([AC_PROG_CXXCPP], [:]) 18 | AC_DEFUN([AC_PROG_OBJC], [:]) 19 | AC_DEFUN([AC_PROG_OBJCCPP], [:]) 20 | AC_DEFUN([AC_LIBTOOL_CXX], [:]) 21 | AC_DEFUN([AC_LIBTOOL_F77], [:]) 22 | AC_PROG_CC 23 | AM_PROG_LEX 24 | AC_DISABLE_SHARED 25 | AC_PROG_LIBTOOL 26 | 27 | # optional building of examples: 28 | AC_ARG_ENABLE([examples], 29 | [AC_HELP_STRING([--disable-examples], [don't build examples in examples])], 30 | [], [enable_examples=yes]) 31 | AM_CONDITIONAL([ENABLE_EXAMPLES], [test "$enable_examples" = yes]) 32 | 33 | AM_GNU_GETTEXT([external]) 34 | AM_GNU_GETTEXT_VERSION([0.16.1]) 35 | 36 | # Checks for header files. 37 | AC_HEADER_STDC 38 | AC_CHECK_HEADERS([unistd.h]) 39 | 40 | # Checks for typedefs, structures, and compiler characteristics. 41 | AC_C_CONST 42 | 43 | # Checks for library functions. 44 | AC_CHECK_FUNCS([strcasecmp strdup strndup]) 45 | 46 | dnl Check for the library containing inet_aton/inet_ntoa (for tests) 47 | AC_SEARCH_LIBS([inet_ntoa], [socket nsl]) 48 | 49 | AC_CONFIG_FILES([Makefile \ 50 | src/Makefile \ 51 | examples/Makefile \ 52 | po/Makefile.in \ 53 | m4/Makefile \ 54 | tests/Makefile \ 55 | doc/Makefile \ 56 | doc/Doxyfile \ 57 | libconfuse.pc \ 58 | libconfuse.spec]) 59 | AC_OUTPUT 60 | 61 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/.cvsignore: -------------------------------------------------------------------------------- 1 | .gdb_history 2 | conf.d 3 | html 4 | listing1.xml 5 | listing2.xml 6 | listing3.xml 7 | listing4.xml 8 | listing5.xml 9 | listing6.xml 10 | listing7.xml 11 | listing8.xml 12 | Makefile 13 | Makefile.in 14 | man 15 | tutorial 16 | tutorial-html 17 | tutorial-source 18 | valid.c 19 | .Makefile.am.swp 20 | tutorial-build.timestamp 21 | Doxyfile 22 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = doxygen-footer.html doxygen-header.html doxygen.css tutorial.xml \ 2 | $(TUTORIAL_CSOURCES) css.xsl tutorial.css Doxyfile.in Doxyfile 3 | 4 | # I'd like to have these programs only compile at 'make documentation' time. 5 | # How? 6 | # noinst_PROGRAMS = listing1 listing2 listing3 listing4 listing5 listing8 7 | LDADD = ../src/libconfuse.la 8 | INCLUDES = -I$(top_srcdir)/src 9 | AM_LDFLAGS = -L../src/ 10 | LIBS = $(LTLIBINTL) 11 | 12 | TUTORIAL_CSOURCES = listing1.c listing2.c listing3.c listing4.c \ 13 | listing5.c listing6.c listing7.c listing8.c 14 | TUTORIAL_LISTINGS = $(TUTORIAL_CSOURCES:.c=.xml) 15 | 16 | .c.xml: 17 | echo " $@ 18 | sed = $< | sed 'N;s/\n/\t/' >> $@ 19 | echo ']]>' >> $@ 20 | 21 | tutorial-html/index.html: tutorial.xml $(TUTORIAL_LISTINGS) css.xsl tutorial.css 22 | xmllint --valid --noout $< && xmlto -o tutorial-html --extensions -m css.xsl xhtml $< 23 | cp -f tutorial.css tutorial-html/ 24 | 25 | tutorial.pdf: tutorial.xml $(TUTORIAL_LISTINGS) 26 | xmllint --valid --noout $< && xmlto pdf $< 27 | 28 | tutorial: tutorial-html 29 | tutorial-html: tutorial-html/index.html 30 | tutorial-pdf: tutorial.pdf 31 | 32 | html/index.html: Doxyfile 33 | doxygen 34 | doxygen-manual: html/index.html ../src/confuse.h 35 | 36 | documentation: tutorial doxygen-manual 37 | 38 | dist-hook: tutorial doxygen-manual 39 | cp -pr html $(distdir) 40 | cp -pr man $(distdir) 41 | cp -pr tutorial-html $(distdir) 42 | 43 | CLEANFILES=*~ '\#*\#' $(TUTORIAL_LISTINGS) 44 | DISTCLEANFILES= 45 | MOSTLYCLEANFILES=tutorial.pdf 46 | 47 | celan: clean 48 | 49 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/css.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/doxygen-footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/doxygen-header.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | $title 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/listing1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | printf("Hello, World!\n"); 6 | return 0; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/listing2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t opts[] = 7 | { 8 | CFG_STR("target", "World", CFGF_NONE), 9 | CFG_END() 10 | }; 11 | cfg_t *cfg; 12 | 13 | cfg = cfg_init(opts, CFGF_NONE); 14 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 15 | return 1; 16 | 17 | printf("Hello, %s!\n", cfg_getstr(cfg, "target")); 18 | 19 | cfg_free(cfg); 20 | return 0; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/listing3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t opts[] = 7 | { 8 | CFG_STR("target", "World", CFGF_NONE), 9 | CFG_INT("repeat", 1, CFGF_NONE), 10 | CFG_END() 11 | }; 12 | cfg_t *cfg; 13 | int repeat; 14 | 15 | cfg = cfg_init(opts, CFGF_NONE); 16 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 17 | return 1; 18 | 19 | repeat = cfg_getint(cfg, "repeat"); 20 | while(repeat--) 21 | printf("Hello, %s!\n", cfg_getstr(cfg, "target")); 22 | 23 | cfg_free(cfg); 24 | return 0; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/listing4.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t opts[] = 7 | { 8 | CFG_STR_LIST("targets", "{World}", CFGF_NONE), 9 | CFG_INT("repeat", 1, CFGF_NONE), 10 | CFG_END() 11 | }; 12 | cfg_t *cfg; 13 | int repeat; 14 | int i; 15 | 16 | cfg = cfg_init(opts, CFGF_NONE); 17 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 18 | return 1; 19 | 20 | repeat = cfg_getint(cfg, "repeat"); 21 | while(repeat--) 22 | { 23 | printf("Hello"); 24 | for(i = 0; i < cfg_size(cfg, "targets"); i++) 25 | printf(", %s", cfg_getnstr(cfg, "targets", i)); 26 | printf("!\n"); 27 | } 28 | 29 | cfg_free(cfg); 30 | return 0; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/listing5.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | cfg_opt_t greet_opts[] = 7 | { 8 | CFG_STR_LIST("targets", "{World}", CFGF_NONE), 9 | CFG_INT("repeat", 1, CFGF_NONE), 10 | CFG_END() 11 | }; 12 | cfg_opt_t opts[] = 13 | { 14 | CFG_SEC("greeting", greet_opts, CFGF_TITLE | CFGF_MULTI), 15 | CFG_END() 16 | }; 17 | cfg_t *cfg, *cfg_greet; 18 | int repeat; 19 | int i, j; 20 | 21 | cfg = cfg_init(opts, CFGF_NONE); 22 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 23 | return 1; 24 | 25 | for(j = 0; j < cfg_size(cfg, "greeting"); j++) 26 | { 27 | cfg_greet = cfg_getnsec(cfg, "greeting", j); 28 | 29 | repeat = cfg_getint(cfg_greet, "repeat"); 30 | while(repeat--) 31 | { 32 | printf("%s", cfg_title(cfg_greet)); 33 | for(i = 0; i < cfg_size(cfg_greet, "targets"); i++) 34 | printf(", %s", cfg_getnstr(cfg_greet, "targets", i)); 35 | printf("!\n"); 36 | } 37 | } 38 | 39 | cfg_free(cfg); 40 | return 0; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/listing6.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | /* ... setup options ... */ 7 | 8 | cfg = cfg_init(opts, CFGF_NONE); 9 | cfg_parse(cfg, "hello.conf"); 10 | 11 | if(cfg_size(cfg, "greeting") == 0) 12 | { 13 | cfg_parse_buf(cfg, "greeting Hello {}"); 14 | } 15 | 16 | /* ... print the greetings ... */ 17 | } 18 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/listing7.c: -------------------------------------------------------------------------------- 1 | int validate_unsigned_int(cfg_t *cfg, cfg_opt_t *opt) 2 | { 3 | int value = cfg_opt_getnint(opt, cfg_opt_size(opt) - 1); 4 | if(value < 0) 5 | { 6 | cfg_error(cfg, "integer option '%s' must be positive in section '%s'", 7 | opt->name, cfg->name); 8 | return -1; 9 | } 10 | return 0; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/listing8.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int validate_unsigned_int(cfg_t *cfg, cfg_opt_t *opt) 5 | { 6 | int value = cfg_opt_getnint(opt, cfg_opt_size(opt) - 1); 7 | if(value < 0) 8 | { 9 | cfg_error(cfg, "integer option '%s' must be positive in section '%s'", 10 | opt->name, cfg->name); 11 | return -1; 12 | } 13 | return 0; 14 | } 15 | 16 | int main(void) 17 | { 18 | cfg_opt_t greet_opts[] = 19 | { 20 | CFG_STR_LIST("targets", "{World}", CFGF_NONE), 21 | CFG_INT("repeat", 1, CFGF_NONE), 22 | CFG_END() 23 | }; 24 | cfg_opt_t opts[] = 25 | { 26 | CFG_SEC("greeting", greet_opts, CFGF_TITLE | CFGF_MULTI), 27 | CFG_END() 28 | }; 29 | cfg_t *cfg, *cfg_greet; 30 | int repeat; 31 | int i, j; 32 | 33 | cfg = cfg_init(opts, CFGF_NONE); 34 | cfg_set_validate_func(cfg, "greeting|repeat", validate_unsigned_int); 35 | if(cfg_parse(cfg, "hello.conf") == CFG_PARSE_ERROR) 36 | return 1; 37 | 38 | for(j = 0; j < cfg_size(cfg, "greeting"); j++) 39 | { 40 | cfg_greet = cfg_getnsec(cfg, "greeting", j); 41 | 42 | repeat = cfg_getint(cfg_greet, "repeat"); 43 | while(repeat--) 44 | { 45 | printf("%s", cfg_title(cfg_greet)); 46 | for(i = 0; i < cfg_size(cfg_greet, "targets"); i++) 47 | printf(", %s", cfg_getnstr(cfg_greet, "targets", i)); 48 | printf("!\n"); 49 | } 50 | } 51 | 52 | cfg_free(cfg); 53 | return 0; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/third_party/confuse/doc/tutorial.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 1em; 3 | margin: 1em; 4 | } 5 | 6 | body p { 7 | margin-left: 1em; 8 | margin-right: 1em; 9 | text-align: justify; 10 | } 11 | 12 | p.copyright 13 | { 14 | margin-left: 0em; 15 | } 16 | 17 | h1, h2 { 18 | /*letter-spacing: 0.15em;*/ 19 | border-bottom: 1px solid black; 20 | } 21 | 22 | hr { display: none; } 23 | 24 | a[href] { 25 | background: transparent; 26 | color: #04D; 27 | text-decoration: none; 28 | } 29 | 30 | a[href]:hover { text-decoration: underline; } 31 | 32 | pre.programlisting 33 | { 34 | margin-left: 1em; 35 | margin-right: 1em; 36 | border: 1px solid #DDDDDD; 37 | background: #F4F4F4; 38 | padding: 1em; 39 | } 40 | 41 | /*.copyright { 42 | color: #777; 43 | background: transparent; 44 | font-size: x-small; 45 | margin-left: 1em; 46 | margin-right: 1em; 47 | text-align: right; 48 | border-top: 1px solid black; 49 | }*/ 50 | 51 | a img { border: 0px; } 52 | 53 | div.sflogo { 54 | text-align: right; 55 | padding-left: 1em; 56 | } 57 | 58 | hr { clear: both; } 59 | 60 | .warn { 61 | color: red; 62 | background: transparent; 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/third_party/confuse/examples/.cvsignore: -------------------------------------------------------------------------------- 1 | .deps 2 | .gdb_history 3 | .libs 4 | cfgtest 5 | Makefile 6 | Makefile.in 7 | reread 8 | simple 9 | simple.conf.out 10 | test.conf.out 11 | ftpconf 12 | -------------------------------------------------------------------------------- /src/third_party/confuse/examples/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = simple.conf reread.conf ftp.conf 2 | noinst_PROGRAMS = simple reread ftpconf 3 | INCLUDES = -I$(top_srcdir)/src 4 | AM_LDFLAGS = -L../src/ 5 | LDADD = ../src/libconfuse.la 6 | CLEANFILES=*~ \#*\# 7 | LIBS = $(LTLIBINTL) 8 | -------------------------------------------------------------------------------- /src/third_party/confuse/examples/ftp.conf: -------------------------------------------------------------------------------- 1 | # test config file 2 | 3 | passive-mode = on 4 | remote-completion = off 5 | 6 | # sections 7 | bookmark gnu 8 | { 9 | login = "anonymous" 10 | password = ${ANONPASS:-secret} 11 | directory = "/pub/gnu" 12 | host = "ftp.gnu.org" 13 | } 14 | 15 | bookmark kernel 16 | { 17 | host = "ftp.kernel.org" 18 | directory = "/pub/linux/kernel/v2.6" 19 | port = 8021 20 | } 21 | 22 | # functions 23 | alias("ls", "ls -F") 24 | alias("ll", "ls -lF") 25 | 26 | # lists 27 | xterm-terminals = {"xterm", "rxvt", "xterm-debian"} 28 | 29 | # possible values are yes/no/ask 30 | auto-create-bookmark = ask 31 | 32 | -------------------------------------------------------------------------------- /src/third_party/confuse/examples/reread.c: -------------------------------------------------------------------------------- 1 | #include "confuse.h" 2 | #include 3 | #include 4 | #include 5 | 6 | cfg_t *cfg = 0; 7 | const char *config_filename = "./reread.conf"; 8 | 9 | void read_config(void) 10 | { 11 | cfg_opt_t arg_opts[] = { 12 | CFG_STR("value", "default", CFGF_NONE), 13 | CFG_END() 14 | }; 15 | cfg_opt_t opts[] = { 16 | CFG_INT("delay", 3, CFGF_NONE), 17 | CFG_STR("message", "This is a message", CFGF_NONE), 18 | CFG_SEC("argument", arg_opts, CFGF_MULTI | CFGF_TITLE), 19 | CFG_END() 20 | }; 21 | int ret; 22 | 23 | char *buf = "" \ 24 | " delay = 3\n" \ 25 | "# message = \"asdfasfasfd tersf\"\n" \ 26 | " argument one { value = 1 }\n" \ 27 | " argument two { value=foo}\n"; 28 | 29 | cfg_free(cfg); 30 | 31 | cfg = cfg_init(opts, 0); 32 | ret = cfg_parse_buf(cfg, buf); 33 | ret = cfg_parse(cfg, config_filename); 34 | } 35 | 36 | void sighandler(int sig) 37 | { 38 | read_config(); 39 | signal(SIGHUP, sighandler); 40 | } 41 | 42 | static int loop = 1; 43 | 44 | void usr1handler(int sig) 45 | { 46 | loop = 0; 47 | } 48 | 49 | int main(void) 50 | { 51 | unsigned int i; 52 | 53 | read_config(); 54 | signal(SIGHUP, sighandler); 55 | signal(SIGUSR1, usr1handler); 56 | 57 | while(loop) 58 | { 59 | printf("Message: %s", cfg_getstr(cfg, "message")); 60 | for(i = 0; i < cfg_size(cfg, "argument"); i++) 61 | { 62 | cfg_t *arg = cfg_getnsec(cfg, "argument", i); 63 | printf(", %s", cfg_getstr(arg, "value")); 64 | } 65 | printf("\n"); 66 | 67 | sleep(cfg_getint(cfg, "delay")); 68 | } 69 | 70 | cfg_free(cfg); 71 | cfg = 0; 72 | 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /src/third_party/confuse/examples/reread.conf: -------------------------------------------------------------------------------- 1 | delay = 1 2 | message = "another message" 3 | argument one { 4 | value = "arghh!" 5 | } 6 | argument three { 7 | value = "gazonk" 8 | } 9 | -------------------------------------------------------------------------------- /src/third_party/confuse/examples/simple.conf: -------------------------------------------------------------------------------- 1 | # this is a comment 2 | 3 | verbose=true 4 | #server = "localhost" 5 | user = "joe" 6 | debug = 17 7 | #delay = 6.77712472349623E-139 8 | -------------------------------------------------------------------------------- /src/third_party/confuse/examples/wincfgtest.conf: -------------------------------------------------------------------------------- 1 | bool = true 2 | /* string = "another string" */ 3 | /* comment */ 4 | number=4711 5 | float=1.234e3 6 | 7 | message("This is a string passed to the message() function") 8 | -------------------------------------------------------------------------------- /src/third_party/confuse/examples/wincfgtest.dev: -------------------------------------------------------------------------------- 1 | [Project] 2 | FileName=wincfgtest.dev 3 | Name=wincfgtest 4 | UnitCount=1 5 | Type=1 6 | Ver=1 7 | ObjFiles= 8 | Includes=../src 9 | Libs= 10 | PrivateResource= 11 | ResourceIncludes= 12 | MakeIncludes= 13 | Compiler= 14 | CppCompiler= 15 | Linker= 16 | IsCpp=0 17 | Icon= 18 | ExeOutput= 19 | ObjectOutput= 20 | OverrideOutput=0 21 | OverrideOutputName=wincfgtest.exe 22 | HostApplication= 23 | Folders= 24 | CommandLine= 25 | IncludeVersionInfo=0 26 | SupportXPThemes=0 27 | CompilerSet=0 28 | CompilerSettings=000000000000000100 29 | 30 | [Unit1] 31 | FileName=wincfgtest.c 32 | CompileCpp=0 33 | Folder= 34 | Compile=1 35 | Link=1 36 | Priority=1000 37 | OverrideBuildCmd=0 38 | BuildCmd= 39 | 40 | [VersionInfo] 41 | Major=0 42 | Minor=1 43 | Release=1 44 | Build=1 45 | LanguageID=1033 46 | CharsetID=1252 47 | CompanyName= 48 | FileVersion= 49 | FileDescription=Developed using the Dev-C++ IDE 50 | InternalName= 51 | LegalCopyright= 52 | LegalTrademarks= 53 | OriginalFilename= 54 | ProductName= 55 | ProductVersion= 56 | AutoIncBuildNr=0 57 | 58 | -------------------------------------------------------------------------------- /src/third_party/confuse/libconfuse.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | 7 | Name: @PACKAGE@ 8 | Version: @VERSION@ 9 | Description: configuration file parser library 10 | Requires: 11 | Libs: -L${libdir} -lconfuse @LTLIBINTL@ 12 | Cflags: -I${includedir} 13 | 14 | -------------------------------------------------------------------------------- /src/third_party/confuse/m4/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | codeset.m4 4 | gettext.m4 5 | glibc2.m4 6 | glibc21.m4 7 | iconv.m4 8 | intdiv0.m4 9 | intl.m4 10 | intldir.m4 11 | intmax.m4 12 | inttypes-pri.m4 13 | inttypes_h.m4 14 | lcmessage.m4 15 | lib-ld.m4 16 | lib-link.m4 17 | lib-prefix.m4 18 | lock.m4 19 | longdouble.m4 20 | longlong.m4 21 | nls.m4 22 | po.m4 23 | printf-posix.m4 24 | progtest.m4 25 | size_max.m4 26 | stdint_h.m4 27 | uintmax_t.m4 28 | ulonglong.m4 29 | visibility.m4 30 | wchar_t.m4 31 | wint_t.m4 32 | xsize.m4 33 | -------------------------------------------------------------------------------- /src/third_party/confuse/m4/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = intdiv0.m4 inttypes_h.m4 inttypes-pri.m4 nls.m4 \ 2 | po.m4 stdint_h.m4 uintmax_t.m4 intmax.m4 ulonglong.m4 codeset.m4 \ 3 | gettext.m4 glibc21.m4 iconv.m4 lcmessage.m4 \ 4 | lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 \ 5 | longdouble.m4 longlong.m4 \ 6 | printf-posix.m4 size_max.m4 wchar_t.m4 wint_t.m4 \ 7 | xsize.m4 8 | 9 | -------------------------------------------------------------------------------- /src/third_party/confuse/po/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | Makevars.template 4 | POTFILES 5 | stamp-po 6 | sv.gmo 7 | remove-potcdate.sed 8 | fr.gmo 9 | Makefile.in.in 10 | Rules-quot 11 | boldquot.sed 12 | confuse.pot 13 | en@boldquot.header 14 | en@quot.header 15 | insert-header.sin 16 | quot.sed 17 | remove-potcdate.sin 18 | -------------------------------------------------------------------------------- /src/third_party/confuse/po/LINGUAS: -------------------------------------------------------------------------------- 1 | sv 2 | fr 3 | 4 | -------------------------------------------------------------------------------- /src/third_party/confuse/po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = Martin Hedenfalk 22 | 23 | # This is the email address or URL to which the translators shall report 24 | # bugs in the untranslated strings: 25 | # - Strings which are not entire sentences, see the maintainer guidelines 26 | # in the GNU gettext documentation, section 'Preparing Strings'. 27 | # - Strings which use unclear terms or require additional context to be 28 | # understood. 29 | # - Strings which make invalid assumptions about notation of date, time or 30 | # money. 31 | # - Pluralisation problems. 32 | # - Incorrect English spelling. 33 | # - Incorrect formatting. 34 | # It can be your email address, or a mailing list address where translators 35 | # can write to without being subscribed, or the URL of a web page through 36 | # which the translators can contact you. 37 | MSGID_BUGS_ADDRESS = confuse-devel@nongnu.org 38 | 39 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 40 | # message catalogs shall be used. It is usually empty. 41 | EXTRA_LOCALE_CATEGORIES = 42 | -------------------------------------------------------------------------------- /src/third_party/confuse/po/POTFILES.in: -------------------------------------------------------------------------------- 1 | src/confuse.c 2 | src/lexer.l 3 | -------------------------------------------------------------------------------- /src/third_party/confuse/po/fr.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/confuse/po/fr.po -------------------------------------------------------------------------------- /src/third_party/confuse/po/sv.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/confuse/po/sv.po -------------------------------------------------------------------------------- /src/third_party/confuse/src/.cvsignore: -------------------------------------------------------------------------------- 1 | .deps 2 | .libs 3 | confuse.lo 4 | lexer.c 5 | lexer.lo 6 | libconfuse.la 7 | Makefile 8 | Makefile.in 9 | -------------------------------------------------------------------------------- /src/third_party/confuse/src/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libconfuse.la 2 | 3 | libconfuse_la_SOURCES = confuse.c lexer.l 4 | libconfuse_la_LIBADD = $(LTLIBINTL) 5 | 6 | include_HEADERS = confuse.h 7 | 8 | datadir = @datadir@ 9 | localedir = $(datadir)/locale 10 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 11 | 12 | LIBS = @LIBS@ 13 | 14 | CLEANFILES=*~ \#*\# 15 | AM_LFLAGS=-Pcfg_yy -olex.yy.c 16 | lexer.c: lexer.l 17 | 18 | celan: clean 19 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/borland/cfgtest.bpf: -------------------------------------------------------------------------------- 1 | This file is used by the project manager only and should be treated like the project file 2 | 3 | main -------------------------------------------------------------------------------- /src/third_party/confuse/windows/borland/confuse.bpg: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | VERSION = BWS.01 3 | #------------------------------------------------------------------------------ 4 | !ifndef ROOT 5 | ROOT = $(MAKEDIR)\.. 6 | !endif 7 | #------------------------------------------------------------------------------ 8 | MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** 9 | DCC = $(ROOT)\bin\dcc32.exe $** 10 | BRCC = $(ROOT)\bin\brcc32.exe $** 11 | #------------------------------------------------------------------------------ 12 | PROJECTS = libConfuse.dll cfgtest.exe 13 | #------------------------------------------------------------------------------ 14 | default: $(PROJECTS) 15 | #------------------------------------------------------------------------------ 16 | 17 | libConfuse.dll: libConfuse.bpr 18 | $(ROOT)\bin\bpr2mak $** 19 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 20 | 21 | cfgtest.exe: cfgtest.bpr 22 | $(ROOT)\bin\bpr2mak $** 23 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/borland/libConfuse.bpf: -------------------------------------------------------------------------------- 1 | This file is used by the project manager only and should be treated like the project file 2 | 3 | DllEntryPoint 4 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/devcpp/cfgtest.dev: -------------------------------------------------------------------------------- 1 | [Project] 2 | FileName=cfgtest.dev 3 | Name=cfgtest 4 | UnitCount=1 5 | Type=1 6 | Ver=1 7 | ObjFiles= 8 | Includes=../../src 9 | Libs= 10 | PrivateResource= 11 | ResourceIncludes= 12 | MakeIncludes= 13 | Compiler= 14 | CppCompiler= 15 | Linker=liblibConfuse.a_@@_ 16 | IsCpp=0 17 | Icon= 18 | ExeOutput= 19 | ObjectOutput= 20 | OverrideOutput=0 21 | OverrideOutputName=cfgtest.exe 22 | HostApplication= 23 | Folders= 24 | CommandLine= 25 | IncludeVersionInfo=0 26 | SupportXPThemes=0 27 | CompilerSet=0 28 | CompilerSettings=000000000000000000 29 | 30 | [Unit1] 31 | FileName=..\..\examples\cfgtest.c 32 | CompileCpp=0 33 | Folder=cfgtest 34 | Compile=1 35 | Link=1 36 | Priority=1000 37 | OverrideBuildCmd=0 38 | BuildCmd= 39 | 40 | [VersionInfo] 41 | Major=0 42 | Minor=1 43 | Release=1 44 | Build=1 45 | LanguageID=1033 46 | CharsetID=1252 47 | CompanyName= 48 | FileVersion= 49 | FileDescription=Developed using the Dev-C++ IDE 50 | InternalName= 51 | LegalCopyright= 52 | LegalTrademarks= 53 | OriginalFilename= 54 | ProductName= 55 | ProductVersion= 56 | AutoIncBuildNr=0 57 | 58 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/devcpp/libConfuse.dev: -------------------------------------------------------------------------------- 1 | [Project] 2 | FileName=libConfuse.dev 3 | Name=libConfuse 4 | UnitCount=3 5 | Type=3 6 | Ver=1 7 | ObjFiles= 8 | Includes=. 9 | Libs= 10 | PrivateResource= 11 | ResourceIncludes= 12 | MakeIncludes= 13 | Compiler=-DBUILDING_DLL=1_@@_-DHAVE_CONFIG_H_@@_ 14 | CppCompiler= 15 | Linker=--no-export-all-symbols_@@_--add-stdcall-alias_@@_ 16 | IsCpp=0 17 | Icon= 18 | ExeOutput= 19 | ObjectOutput= 20 | OverrideOutput=0 21 | OverrideOutputName=libConfuse.dll 22 | HostApplication= 23 | Folders= 24 | CommandLine= 25 | IncludeVersionInfo=0 26 | SupportXPThemes=0 27 | CompilerSet=0 28 | CompilerSettings=000000000100100000 29 | 30 | [Unit1] 31 | FileName=config.h 32 | CompileCpp=0 33 | Folder=libConfuse 34 | Compile=1 35 | Link=1 36 | Priority=1000 37 | OverrideBuildCmd=0 38 | BuildCmd= 39 | 40 | [Unit2] 41 | FileName=..\..\src\lexer.c 42 | CompileCpp=0 43 | Folder=libConfuse 44 | Compile=1 45 | Link=1 46 | Priority=1000 47 | OverrideBuildCmd=0 48 | BuildCmd= 49 | 50 | [Unit3] 51 | FileName=..\..\src\confuse.c 52 | CompileCpp=0 53 | Folder=libConfuse 54 | Compile=1 55 | Link=1 56 | Priority=1000 57 | OverrideBuildCmd=0 58 | BuildCmd= 59 | 60 | [Unit4] 61 | FileName=config.h 62 | CompileCpp=0 63 | Folder=libConfuse 64 | Compile=1 65 | Link=1 66 | Priority=1000 67 | OverrideBuildCmd=0 68 | BuildCmd= 69 | 70 | [VersionInfo] 71 | Major=0 72 | Minor=1 73 | Release=1 74 | Build=1 75 | LanguageID=1033 76 | CharsetID=1252 77 | CompanyName= 78 | FileVersion= 79 | FileDescription=Developed using the Dev-C++ IDE 80 | InternalName= 81 | LegalCopyright= 82 | LegalTrademarks= 83 | OriginalFilename= 84 | ProductName= 85 | ProductVersion= 86 | AutoIncBuildNr=0 87 | 88 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/mingw/README.TXT: -------------------------------------------------------------------------------- 1 | 2 | Compilation of the static library with MinGW. 3 | --------------------------------------------- 4 | 5 | * QUICK START 6 | 7 | 1) In order to build the library successfully, you should first check that the 8 | MinGW 'bin' directory is in the PATH environment variable. 9 | 10 | 2) Then, launch the script 'build.bat' to produce 'libconfuse.a'. 11 | 12 | This script has been tested with MinGW 3.1.0 under Windows 2000. 13 | It should also work with other versions of MinGW and Windows. 14 | 15 | 16 | * DETAILED DESCRIPTION 17 | 18 | The build script is very simple. It just sets the relative path to the source 19 | directory and the compilation flags. Then, it runs the appropriate gcc 20 | commands to produce the object files. Finally, it uses the 'ar' command to 21 | produce the static library 'libconfuse.a'. 22 | 23 | There is no file 'config.h' in this directory because this is not necessary. 24 | The script uses the Borland one from directory "../borland" as is. 25 | 26 | Once you've built the library, you need only two files to add libConfuse to 27 | your project: 'confuse.h' located in the source directory and 'libconfuse.a'. 28 | 29 | Here is an example of how to use this library under Windows with MinGW: 30 | gcc -Wall -I..\..\src -L. -o myexample.exe myexample.c -lconfuse 31 | 32 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/mingw/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem Compilation script of the static library for MinGW. 4 | rem 5 | echo. 6 | echo Compiling libconfuse.a for MinGW... 7 | echo. 8 | 9 | rem Source directory 10 | set SRC_DIR=..\..\src 11 | 12 | rem The Borland "config.h" file can be used as is 13 | rem by adding -DHAVE_STRCASECMP on the gcc command line. 14 | set INCLUDE=-I..\borland -I%SRC_DIR% 15 | set CFLAGS=-Wall -DHAVE_CONFIG_H -DHAVE_STRCASECMP %INCLUDE% -c 16 | 17 | set COMPILE=gcc %CFLAGS% %SRC_DIR%\confuse.c 18 | echo %COMPILE% 19 | %COMPILE% || goto fatal 20 | 21 | set COMPILE=gcc %CFLAGS% %SRC_DIR%\lexer.c 22 | echo %COMPILE% 23 | %COMPILE% || goto fatal 24 | 25 | set LINK=ar rc libconfuse.a confuse.o lexer.o 26 | echo %LINK% 27 | %LINK% || goto fatal 28 | 29 | del confuse.o 30 | del lexer.o 31 | 32 | echo. 33 | echo [ OK ] 34 | echo. 35 | goto end 36 | 37 | :fatal 38 | echo. 39 | echo [ FAILED ] 40 | echo. 41 | 42 | :end 43 | pause 44 | 45 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/msvc6/libConfuse/libConfuse.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "libConfuse"=".\libConfuse.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/msvc6/libConfuse/unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef _unistd_h 2 | 3 | 4 | #endif 5 | 6 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/msvs.net/msvs.net.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 7.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libConfuse", "libConfuse\libConfuse.vcproj", "{073826D0-615E-4065-906E-4867AD9FA290}" 3 | EndProject 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cfgtest", "cfgtest\cfgtest.vcproj", "{99461085-21CE-4044-8818-31E3B84CCF09}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | ConfigName.0 = Debug 9 | ConfigName.1 = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectDependencies) = postSolution 12 | {99461085-21CE-4044-8818-31E3B84CCF09}.0 = {073826D0-615E-4065-906E-4867AD9FA290} 13 | EndGlobalSection 14 | GlobalSection(ProjectConfiguration) = postSolution 15 | {073826D0-615E-4065-906E-4867AD9FA290}.Debug.ActiveCfg = Release|Win32 16 | {073826D0-615E-4065-906E-4867AD9FA290}.Debug.Build.0 = Release|Win32 17 | {073826D0-615E-4065-906E-4867AD9FA290}.Release.ActiveCfg = Release|Win32 18 | {073826D0-615E-4065-906E-4867AD9FA290}.Release.Build.0 = Release|Win32 19 | {99461085-21CE-4044-8818-31E3B84CCF09}.Debug.ActiveCfg = Release|Win32 20 | {99461085-21CE-4044-8818-31E3B84CCF09}.Debug.Build.0 = Release|Win32 21 | {99461085-21CE-4044-8818-31E3B84CCF09}.Release.ActiveCfg = Release|Win32 22 | {99461085-21CE-4044-8818-31E3B84CCF09}.Release.Build.0 = Release|Win32 23 | EndGlobalSection 24 | GlobalSection(ExtensibilityGlobals) = postSolution 25 | EndGlobalSection 26 | GlobalSection(ExtensibilityAddIns) = postSolution 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /src/third_party/confuse/windows/msvs.net/unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef _unistd_h 2 | 3 | 4 | #endif 5 | 6 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/* 2 | !/bin/data 3 | !/bin/encodings 4 | !/bin/jsonchecker 5 | /build 6 | /doc/html 7 | /doc/doxygen_*.db 8 | *.a 9 | 10 | # Temporary files created during CMake build 11 | CMakeCache.txt 12 | CMakeFiles 13 | cmake_install.cmake 14 | CTestTestfile.cmake 15 | Makefile 16 | RapidJSON*.cmake 17 | RapidJSON.pc 18 | Testing 19 | /googletest 20 | install_manifest.txt 21 | Doxyfile 22 | DartConfiguration.tcl 23 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "thirdparty/gtest"] 2 | path = thirdparty/gtest 3 | url = https://chromium.googlesource.com/external/googletest.git 4 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/RapidJSON.pc.in: -------------------------------------------------------------------------------- 1 | includedir=@INCLUDE_INSTALL_DIR@ 2 | 3 | Name: @PROJECT_NAME@ 4 | Description: A fast JSON parser/generator for C++ with both SAX/DOM style API 5 | Version: @LIB_VERSION_STRING@ 6 | URL: https://github.com/miloyip/rapidjson 7 | Cflags: -I${includedir} 8 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/RapidJSONConfig.cmake.in: -------------------------------------------------------------------------------- 1 | get_filename_component(RAPIDJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 2 | set(RAPIDJSON_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@") 3 | message(STATUS "RapidJSON found. Headers: ${RAPIDJSON_INCLUDE_DIRS}") 4 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/RapidJSONConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | SET(PACKAGE_VERSION "@LIB_VERSION_STRING@") 2 | 3 | IF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) 4 | SET(PACKAGE_VERSION_EXACT "true") 5 | ENDIF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) 6 | IF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) 7 | SET(PACKAGE_VERSION_COMPATIBLE "true") 8 | ELSE (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) 9 | SET(PACKAGE_VERSION_UNSUITABLE "true") 10 | ENDIF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) 11 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.1.{build} 2 | 3 | configuration: 4 | - Debug 5 | - Release 6 | 7 | environment: 8 | matrix: 9 | - VS_VERSION: 11 10 | VS_PLATFORM: win32 11 | - VS_VERSION: 11 12 | VS_PLATFORM: x64 13 | - VS_VERSION: 12 14 | VS_PLATFORM: win32 15 | - VS_VERSION: 12 16 | VS_PLATFORM: x64 17 | 18 | before_build: 19 | - git submodule update --init --recursive 20 | - cmake -H. -BBuild/VS -G "Visual Studio %VS_VERSION%" -DCMAKE_GENERATOR_PLATFORM=%VS_PLATFORM% -DBUILD_SHARED_LIBS=true -Wno-dev 21 | 22 | build: 23 | project: Build\VS\RapidJSON.sln 24 | parallel: true 25 | verbosity: minimal 26 | 27 | test_script: 28 | - cd Build\VS && if %CONFIGURATION%==Debug (ctest --verbose -E perftest --build-config %CONFIGURATION%) else (ctest --verbose --build-config %CONFIGURATION%) 29 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/data/glossary.json: -------------------------------------------------------------------------------- 1 | { 2 | "glossary": { 3 | "title": "example glossary", 4 | "GlossDiv": { 5 | "title": "S", 6 | "GlossList": { 7 | "GlossEntry": { 8 | "ID": "SGML", 9 | "SortAs": "SGML", 10 | "GlossTerm": "Standard Generalized Markup Language", 11 | "Acronym": "SGML", 12 | "Abbrev": "ISO 8879:1986", 13 | "GlossDef": { 14 | "para": "A meta-markup language, used to create markup languages such as DocBook.", 15 | "GlossSeeAlso": ["GML", "XML"] 16 | }, 17 | "GlossSee": "markup" 18 | } 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/data/menu.json: -------------------------------------------------------------------------------- 1 | {"menu": { 2 | "header": "SVG Viewer", 3 | "items": [ 4 | {"id": "Open"}, 5 | {"id": "OpenNew", "label": "Open New"}, 6 | null, 7 | {"id": "ZoomIn", "label": "Zoom In"}, 8 | {"id": "ZoomOut", "label": "Zoom Out"}, 9 | {"id": "OriginalView", "label": "Original View"}, 10 | null, 11 | {"id": "Quality"}, 12 | {"id": "Pause"}, 13 | {"id": "Mute"}, 14 | null, 15 | {"id": "Find", "label": "Find..."}, 16 | {"id": "FindAgain", "label": "Find Again"}, 17 | {"id": "Copy"}, 18 | {"id": "CopyAgain", "label": "Copy Again"}, 19 | {"id": "CopySVG", "label": "Copy SVG"}, 20 | {"id": "ViewSVG", "label": "View SVG"}, 21 | {"id": "ViewSource", "label": "View Source"}, 22 | {"id": "SaveAs", "label": "Save As"}, 23 | null, 24 | {"id": "Help"}, 25 | {"id": "About", "label": "About Adobe CVG Viewer..."} 26 | ] 27 | }} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/data/readme.txt: -------------------------------------------------------------------------------- 1 | sample.json is obtained from http://code.google.com/p/json-test-suite/downloads/detail?name=sample.zip 2 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/data/widget.json: -------------------------------------------------------------------------------- 1 | {"widget": { 2 | "debug": "on", 3 | "window": { 4 | "title": "Sample Konfabulator Widget", 5 | "name": "main_window", 6 | "width": 500, 7 | "height": 500 8 | }, 9 | "image": { 10 | "src": "Images/Sun.png", 11 | "name": "sun1", 12 | "hOffset": 250, 13 | "vOffset": 250, 14 | "alignment": "center" 15 | }, 16 | "text": { 17 | "data": "Click Here", 18 | "size": 36, 19 | "style": "bold", 20 | "name": "text1", 21 | "hOffset": 250, 22 | "vOffset": 100, 23 | "alignment": "center", 24 | "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" 25 | } 26 | }} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf16be.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/bin/encodings/utf16be.json -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf16bebom.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/bin/encodings/utf16bebom.json -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf16le.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/bin/encodings/utf16le.json -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf16lebom.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/bin/encodings/utf16lebom.json -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf32be.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/bin/encodings/utf32be.json -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf32bebom.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/bin/encodings/utf32bebom.json -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf32le.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/bin/encodings/utf32le.json -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf32lebom.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/bin/encodings/utf32lebom.json -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf8.json: -------------------------------------------------------------------------------- 1 | { 2 | "en":"I can eat glass and it doesn't hurt me.", 3 | "zh-Hant":"我能吞下玻璃而不傷身體。", 4 | "zh-Hans":"我能吞下玻璃而不伤身体。", 5 | "ja":"私はガラスを食べられます。それは私を傷つけません。", 6 | "ko":"나는 유리를 먹을 수 있어요. 그래도 아프지 않아요" 7 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/encodings/utf8bom.json: -------------------------------------------------------------------------------- 1 | { 2 | "en":"I can eat glass and it doesn't hurt me.", 3 | "zh-Hant":"我能吞下玻璃而不傷身體。", 4 | "zh-Hans":"我能吞下玻璃而不伤身体。", 5 | "ja":"私はガラスを食べられます。それは私を傷つけません。", 6 | "ko":"나는 유리를 먹을 수 있어요. 그래도 아프지 않아요" 7 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail1.json: -------------------------------------------------------------------------------- 1 | "A JSON payload should be an object or array, not a string." -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail10.json: -------------------------------------------------------------------------------- 1 | {"Extra value after close": true} "misplaced quoted value" -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail11.json: -------------------------------------------------------------------------------- 1 | {"Illegal expression": 1 + 2} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail12.json: -------------------------------------------------------------------------------- 1 | {"Illegal invocation": alert()} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail13.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot have leading zeroes": 013} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail14.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot be hex": 0x14} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail15.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \x15"] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail16.json: -------------------------------------------------------------------------------- 1 | [\naked] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail17.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \017"] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail18.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail19.json: -------------------------------------------------------------------------------- 1 | {"Missing colon" null} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail2.json: -------------------------------------------------------------------------------- 1 | ["Unclosed array" -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail20.json: -------------------------------------------------------------------------------- 1 | {"Double colon":: null} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail21.json: -------------------------------------------------------------------------------- 1 | {"Comma instead of colon", null} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail22.json: -------------------------------------------------------------------------------- 1 | ["Colon instead of comma": false] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail23.json: -------------------------------------------------------------------------------- 1 | ["Bad value", truth] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail24.json: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail25.json: -------------------------------------------------------------------------------- 1 | [" tab character in string "] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail26.json: -------------------------------------------------------------------------------- 1 | ["tab\ character\ in\ string\ "] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail27.json: -------------------------------------------------------------------------------- 1 | ["line 2 | break"] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail28.json: -------------------------------------------------------------------------------- 1 | ["line\ 2 | break"] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail29.json: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail3.json: -------------------------------------------------------------------------------- 1 | {unquoted_key: "keys must be quoted"} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail30.json: -------------------------------------------------------------------------------- 1 | [0e+] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail31.json: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail32.json: -------------------------------------------------------------------------------- 1 | {"Comma instead if closing brace": true, -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail33.json: -------------------------------------------------------------------------------- 1 | ["mismatch"} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail4.json: -------------------------------------------------------------------------------- 1 | ["extra comma",] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail5.json: -------------------------------------------------------------------------------- 1 | ["double extra comma",,] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail6.json: -------------------------------------------------------------------------------- 1 | [ , "<-- missing value"] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail7.json: -------------------------------------------------------------------------------- 1 | ["Comma after the close"], -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail8.json: -------------------------------------------------------------------------------- 1 | ["Extra close"]] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/fail9.json: -------------------------------------------------------------------------------- 1 | {"Extra comma": true,} -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/pass1.json: -------------------------------------------------------------------------------- 1 | [ 2 | "JSON Test Pattern pass1", 3 | {"object with 1 member":["array with 1 element"]}, 4 | {}, 5 | [], 6 | -42, 7 | true, 8 | false, 9 | null, 10 | { 11 | "integer": 1234567890, 12 | "real": -9876.543210, 13 | "e": 0.123456789e-12, 14 | "E": 1.234567890E+34, 15 | "": 23456789012E66, 16 | "zero": 0, 17 | "one": 1, 18 | "space": " ", 19 | "quote": "\"", 20 | "backslash": "\\", 21 | "controls": "\b\f\n\r\t", 22 | "slash": "/ & \/", 23 | "alpha": "abcdefghijklmnopqrstuvwyz", 24 | "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ", 25 | "digit": "0123456789", 26 | "0123456789": "digit", 27 | "special": "`1~!@#$%^&*()_+-={':[,]}|;.?", 28 | "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A", 29 | "true": true, 30 | "false": false, 31 | "null": null, 32 | "array":[ ], 33 | "object":{ }, 34 | "address": "50 St. James Street", 35 | "url": "http://www.JSON.org/", 36 | "comment": "// /* */": " ", 38 | " s p a c e d " :[1,2 , 3 39 | 40 | , 41 | 42 | 4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7], 43 | "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", 44 | "quotes": "" \u0022 %22 0x22 034 "", 45 | "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" 46 | : "A key can be any string" 47 | }, 48 | 0.5 ,98.6 49 | , 50 | 99.44 51 | , 52 | 53 | 1066, 54 | 1e1, 55 | 0.1e1, 56 | 1e-1, 57 | 1e00,2e+00,2e-00 58 | ,"rosebud"] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/pass2.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/pass3.json: -------------------------------------------------------------------------------- 1 | { 2 | "JSON Test Pattern pass3": { 3 | "The outermost value": "must be an object or array.", 4 | "In this test": "It is an object." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/bin/jsonchecker/readme.txt: -------------------------------------------------------------------------------- 1 | Test suite from http://json.org/JSON_checker/. 2 | 3 | If the JSON_checker is working correctly, it must accept all of the pass*.json files and reject all of the fail*.json files. 4 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(Doxygen) 2 | 3 | IF(NOT DOXYGEN_FOUND) 4 | MESSAGE(STATUS "No Doxygen found. Documentation won't be built") 5 | ELSE() 6 | file(GLOB SOURCES ${CMAKE_SOURCE_DIR}/include/*) 7 | file(GLOB MARKDOWN_DOC ${CMAKE_SOURCE_DIR}/doc/*.md) 8 | list(APPEND MARKDOWN_DOC ${CMAKE_SOURCE_DIR}/readme.md) 9 | 10 | CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY) 11 | CONFIGURE_FILE(Doxyfile.zh-cn.in Doxyfile.zh-cn @ONLY) 12 | 13 | add_custom_command(OUTPUT html 14 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 15 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.zh-cn 16 | COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html 17 | DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile* 18 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 19 | ) 20 | 21 | add_custom_target(doc ALL DEPENDS html) 22 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html 23 | DESTINATION ${DOC_INSTALL_DIR} 24 | COMPONENT doc) 25 | ENDIF() 26 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/architecture.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | compound=true 3 | fontname="Inconsolata, Consolas" 4 | fontsize=10 5 | margin="0,0" 6 | ranksep=0.2 7 | nodesep=0.5 8 | penwidth=0.5 9 | colorscheme=spectral7 10 | 11 | node [shape=box, fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5, style=filled, fillcolor=white] 12 | edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5] 13 | 14 | subgraph cluster1 { 15 | margin="10,10" 16 | labeljust="left" 17 | label = "SAX" 18 | style=filled 19 | fillcolor=6 20 | 21 | Reader -> Writer [style=invis] 22 | } 23 | 24 | subgraph cluster2 { 25 | margin="10,10" 26 | labeljust="left" 27 | label = "DOM" 28 | style=filled 29 | fillcolor=7 30 | 31 | Value 32 | Document 33 | } 34 | 35 | Handler [label="<>\nHandler"] 36 | 37 | { 38 | edge [arrowtail=onormal, dir=back] 39 | Value -> Document 40 | Handler -> Document 41 | Handler -> Writer 42 | } 43 | 44 | { 45 | edge [arrowhead=vee, style=dashed, constraint=false] 46 | Reader -> Handler [label="calls"] 47 | Value -> Handler [label="calls"] 48 | Document -> Reader [label="uses"] 49 | } 50 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/architecture.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/insituparsing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/insituparsing.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/makefile: -------------------------------------------------------------------------------- 1 | %.pdf: %.dot 2 | dot $< -Tpdf -o $@ 3 | 4 | %.png: %.dot 5 | dot $< -Tpng -o $@ 6 | 7 | DOTFILES = $(basename $(wildcard *.dot)) 8 | all: $(addsuffix .png, $(DOTFILES)) $(addsuffix .pdf, $(DOTFILES)) 9 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/move1.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | compound=true 3 | fontname="Inconsolata, Consolas" 4 | fontsize=10 5 | margin="0,0" 6 | ranksep=0.2 7 | penwidth=0.5 8 | 9 | node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5] 10 | edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal] 11 | 12 | subgraph cluster1 { 13 | margin="10,10" 14 | labeljust="left" 15 | label = "Before" 16 | style=filled 17 | fillcolor=gray95 18 | 19 | node [shape=Mrecord, style=filled, colorscheme=spectral7] 20 | 21 | { 22 | rank = same 23 | b1 [label="{b:number|456}", fillcolor=6] 24 | a1 [label="{a:number|123}", fillcolor=6] 25 | } 26 | 27 | a1 -> b1 [style="dashed", label="Move", dir=back] 28 | } 29 | 30 | subgraph cluster2 { 31 | margin="10,10" 32 | labeljust="left" 33 | label = "After" 34 | style=filled 35 | fillcolor=gray95 36 | 37 | node [shape=Mrecord, style=filled, colorscheme=spectral7] 38 | 39 | { 40 | rank = same 41 | b2 [label="{b:null|}", fillcolor=1] 42 | a2 [label="{a:number|456}", fillcolor=6] 43 | } 44 | a2 -> b2 [style=invis, dir=back] 45 | } 46 | b1 -> b2 [style=invis] 47 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/move1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/move1.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/move2.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | compound=true 3 | fontname="Inconsolata, Consolas" 4 | fontsize=10 5 | margin="0,0" 6 | ranksep=0.2 7 | penwidth=0.5 8 | 9 | node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5] 10 | edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal] 11 | 12 | subgraph cluster1 { 13 | margin="10,10" 14 | labeljust="left" 15 | label = "Before Copying (Hypothetic)" 16 | style=filled 17 | fillcolor=gray95 18 | 19 | node [shape=Mrecord, style=filled, colorscheme=spectral7] 20 | 21 | c1 [label="{contact:array|}", fillcolor=4] 22 | c11 [label="{|}"] 23 | c12 [label="{|}"] 24 | c13 [shape="none", label="...", style="solid"] 25 | o1 [label="{o:object|}", fillcolor=3] 26 | ghost [label="{o:object|}", style=invis] 27 | 28 | c1 -> o1 [style="dashed", label="AddMember", constraint=false] 29 | 30 | edge [arrowhead=vee] 31 | c1 -> { c11; c12; c13 } 32 | o1 -> ghost [style=invis] 33 | } 34 | 35 | subgraph cluster2 { 36 | margin="10,10" 37 | labeljust="left" 38 | label = "After Copying (Hypothetic)" 39 | style=filled 40 | fillcolor=gray95 41 | 42 | node [shape=Mrecord, style=filled, colorscheme=spectral7] 43 | 44 | c2 [label="{contact:array|}", fillcolor=4] 45 | c3 [label="{array|}", fillcolor=4] 46 | c21 [label="{|}"] 47 | c22 [label="{|}"] 48 | c23 [shape=none, label="...", style="solid"] 49 | o2 [label="{o:object|}", fillcolor=3] 50 | cs [label="{string|\"contact\"}", fillcolor=5] 51 | c31 [label="{|}"] 52 | c32 [label="{|}"] 53 | c33 [shape="none", label="...", style="solid"] 54 | 55 | edge [arrowhead=vee] 56 | c2 -> { c21; c22; c23 } 57 | o2 -> cs 58 | cs -> c3 [arrowhead=none] 59 | c3 -> { c31; c32; c33 } 60 | } 61 | ghost -> o2 [style=invis] 62 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/move2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/move2.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/move3.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | compound=true 3 | fontname="Inconsolata, Consolas" 4 | fontsize=10 5 | margin="0,0" 6 | ranksep=0.2 7 | penwidth=0.5 8 | forcelabels=true 9 | 10 | node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5] 11 | edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal] 12 | 13 | subgraph cluster1 { 14 | margin="10,10" 15 | labeljust="left" 16 | label = "Before Moving" 17 | style=filled 18 | fillcolor=gray95 19 | 20 | node [shape=Mrecord, style=filled, colorscheme=spectral7] 21 | 22 | c1 [label="{contact:array|}", fillcolor=4] 23 | c11 [label="{|}"] 24 | c12 [label="{|}"] 25 | c13 [shape=none, label="...", style="solid"] 26 | o1 [label="{o:object|}", fillcolor=3] 27 | ghost [label="{o:object|}", style=invis] 28 | 29 | c1 -> o1 [style="dashed", constraint=false, label="AddMember"] 30 | 31 | edge [arrowhead=vee] 32 | c1 -> { c11; c12; c13 } 33 | o1 -> ghost [style=invis] 34 | } 35 | 36 | subgraph cluster2 { 37 | margin="10,10" 38 | labeljust="left" 39 | label = "After Moving" 40 | style=filled 41 | fillcolor=gray95 42 | 43 | node [shape=Mrecord, style=filled, colorscheme=spectral7] 44 | 45 | c2 [label="{contact:null|}", fillcolor=1] 46 | c3 [label="{array|}", fillcolor=4] 47 | c21 [label="{|}"] 48 | c22 [label="{|}"] 49 | c23 [shape="none", label="...", style="solid"] 50 | o2 [label="{o:object|}", fillcolor=3] 51 | cs [label="{string|\"contact\"}", fillcolor=5] 52 | c2 -> o2 [style="dashed", constraint=false, label="AddMember", style=invis] 53 | 54 | edge [arrowhead=vee] 55 | c3 -> { c21; c22; c23 } 56 | o2 -> cs 57 | cs -> c3 [arrowhead=none] 58 | } 59 | ghost -> o2 [style=invis] 60 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/move3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/move3.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/normalparsing.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | compound=true 3 | fontname="Inconsolata, Consolas" 4 | fontsize=10 5 | margin="0,0" 6 | ranksep=0.2 7 | penwidth=0.5 8 | 9 | node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5] 10 | edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal] 11 | 12 | { 13 | node [shape=record, fontsize="8", margin="0.04", height=0.2, color=gray] 14 | normaljson [label="\{|\"|m|s|g|\"|:|\"|H|e|l|l|o|\\|n|W|o|r|l|d|!|\"|,|\"|\\|u|0|0|7|3|t|a|r|s\"|:|1|0|\}"] 15 | 16 | { 17 | rank = same 18 | msgstring [label="m|s|g|\\0"] 19 | helloworldstring [label="H|e|l|l|o|\\n|W|o|r|l|d|!|\\0"] 20 | starsstring [label="s|t|a|r|s\\0"] 21 | } 22 | } 23 | 24 | subgraph cluster1 { 25 | margin="10,10" 26 | labeljust="left" 27 | label = "Document by Normal Parsing" 28 | style=filled 29 | fillcolor=gray95 30 | node [shape=Mrecord, style=filled, colorscheme=spectral7] 31 | 32 | root [label="{object|}", fillcolor=3] 33 | 34 | { 35 | msg [label="{string|}", fillcolor=5] 36 | helloworld [label="{string|}", fillcolor=5] 37 | stars [label="{string|}", fillcolor=5] 38 | ten [label="{number|10}", fillcolor=6] 39 | } 40 | } 41 | 42 | normaljson -> root [label=" Parse()" lhead="cluster1"] 43 | edge [arrowhead=vee] 44 | root -> { msg; stars } 45 | 46 | edge [arrowhead="none"] 47 | msg -> helloworld 48 | stars -> ten 49 | 50 | edge [arrowhead=vee, arrowtail=dot, arrowsize=0.5, dir=both, tailclip=false] 51 | msg:a:c -> msgstring:w 52 | helloworld:a:c -> helloworldstring:w 53 | stars:a:c -> starsstring:w 54 | 55 | msgstring -> helloworldstring -> starsstring [style=invis] 56 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/normalparsing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/normalparsing.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/simpledom.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | compound=true 3 | fontname="Inconsolata, Consolas" 4 | fontsize=10 5 | margin="0,0" 6 | ranksep=0.2 7 | penwidth=0.5 8 | 9 | node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5] 10 | edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal] 11 | 12 | { 13 | node [shape=record, fontsize="8", margin="0.04", height=0.2, color=gray] 14 | srcjson [label="\{|\"|p|r|o|j|e|c|t|\"|:|\"|r|a|p|i|d|j|s|o|n|\"|,|\"|s|t|a|r|s|\"|:|1|0|\}"] 15 | dstjson [label="\{|\"|p|r|o|j|e|c|t|\"|:|\"|r|a|p|i|d|j|s|o|n|\"|,|\"|s|t|a|r|s|\"|:|1|1|\}"] 16 | } 17 | 18 | { 19 | node [shape="box", style="filled", fillcolor="gray95"] 20 | Document2 [label="(Modified) Document"] 21 | Writer 22 | } 23 | 24 | subgraph cluster1 { 25 | margin="10,10" 26 | labeljust="left" 27 | label = "Document" 28 | style=filled 29 | fillcolor=gray95 30 | node [shape=Mrecord, style=filled, colorscheme=spectral7] 31 | 32 | root [label="{object|}", fillcolor=3] 33 | 34 | { 35 | project [label="{string|\"project\"}", fillcolor=5] 36 | rapidjson [label="{string|\"rapidjson\"}", fillcolor=5] 37 | stars [label="{string|\"stars\"}", fillcolor=5] 38 | ten [label="{number|10}", fillcolor=6] 39 | } 40 | 41 | edge [arrowhead=vee] 42 | root -> { project; stars } 43 | 44 | edge [arrowhead="none"] 45 | project -> rapidjson 46 | stars -> ten 47 | } 48 | 49 | srcjson -> root [label=" Parse()", lhead="cluster1"] 50 | 51 | ten -> Document2 [label=" Increase \"stars\"", ltail="cluster1" ] 52 | Document2 -> Writer [label=" Traverse DOM by Accept()"] 53 | Writer -> dstjson [label=" Output to StringBuffer"] 54 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/simpledom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/simpledom.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/tutorial.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | compound=true 3 | fontname="Inconsolata, Consolas" 4 | fontsize=10 5 | margin="0,0" 6 | ranksep=0.2 7 | penwidth=0.5 8 | 9 | node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5] 10 | edge [fontname="Inconsolata, Consolas", fontsize=10] 11 | 12 | subgraph cluster1 { 13 | margin="10,10" 14 | labeljust="left" 15 | label = "Document" 16 | style=filled 17 | fillcolor=gray95 18 | node [shape=Mrecord, style=filled, colorscheme=spectral7] 19 | 20 | root [label="{object|}", fillcolor=3] 21 | 22 | { 23 | hello [label="{string|\"hello\"}", fillcolor=5] 24 | t [label="{string|\"t\"}", fillcolor=5] 25 | f [label="{string|\"f\"}", fillcolor=5] 26 | n [label="{string|\"n\"}", fillcolor=5] 27 | i [label="{string|\"i\"}", fillcolor=5] 28 | pi [label="{string|\"pi\"}", fillcolor=5] 29 | a [label="{string|\"a\"}", fillcolor=5] 30 | 31 | world [label="{string|\"world\"}", fillcolor=5] 32 | true [label="{true|}", fillcolor=7] 33 | false [label="{false|}", fillcolor=2] 34 | null [label="{null|}", fillcolor=1] 35 | i1 [label="{number|123}", fillcolor=6] 36 | pi1 [label="{number|3.1416}", fillcolor=6] 37 | array [label="{array|size=4}", fillcolor=4] 38 | 39 | a1 [label="{number|1}", fillcolor=6] 40 | a2 [label="{number|2}", fillcolor=6] 41 | a3 [label="{number|3}", fillcolor=6] 42 | a4 [label="{number|4}", fillcolor=6] 43 | } 44 | 45 | edge [arrowhead=vee] 46 | root -> { hello; t; f; n; i; pi; a } 47 | array -> { a1; a2; a3; a4 } 48 | 49 | edge [arrowhead=none] 50 | hello -> world 51 | t -> true 52 | f -> false 53 | n -> null 54 | i -> i1 55 | pi -> pi1 56 | a -> array 57 | } 58 | } -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/tutorial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/tutorial.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/diagram/utilityclass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/diagram/utilityclass.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/logo/rapidjson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/doc/logo/rapidjson.png -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/misc/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/misc/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | $projectname: $title 9 | $title 10 | 11 | 12 | 13 | $treeview 14 | $search 15 | $mathjax 16 | 17 | $extrastylesheet 18 | 19 | 20 |
21 |
22 | $searchbox 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/performance.md: -------------------------------------------------------------------------------- 1 | # Performance 2 | 3 | There is a [native JSON benchmark collection] [1] which evaluates speed, memory usage and code size of various operations among 20 JSON libaries. 4 | 5 | [1]: https://github.com/miloyip/nativejson-benchmark 6 | 7 | The old performance article for RapidJSON 0.1 is provided [here](https://code.google.com/p/rapidjson/wiki/Performance). 8 | 9 | Additionally, you may refer to the following third-party benchmarks. 10 | 11 | ## Third-party benchmarks 12 | 13 | * [Basic benchmarks for miscellaneous C++ JSON parsers and generators](https://github.com/mloskot/json_benchmark) by Mateusz Loskot (Jun 2013) 14 | * [casablanca](https://casablanca.codeplex.com/) 15 | * [json_spirit](https://github.com/cierelabs/json_spirit) 16 | * [jsoncpp](http://jsoncpp.sourceforge.net/) 17 | * [libjson](http://sourceforge.net/projects/libjson/) 18 | * [rapidjson](https://github.com/miloyip/rapidjson/) 19 | * [QJsonDocument](http://qt-project.org/doc/qt-5.0/qtcore/qjsondocument.html) 20 | 21 | * [JSON Parser Benchmarking](http://chadaustin.me/2013/01/json-parser-benchmarking/) by Chad Austin (Jan 2013) 22 | * [sajson](https://github.com/chadaustin/sajson) 23 | * [rapidjson](https://github.com/miloyip/rapidjson/) 24 | * [vjson](https://code.google.com/p/vjson/) 25 | * [YAJL](http://lloyd.github.com/yajl/) 26 | * [Jansson](http://www.digip.org/jansson/) 27 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/doc/performance.zh-cn.md: -------------------------------------------------------------------------------- 1 | # 性能 2 | 3 | 有一个[native JSON benchmark collection][1]项目,能评估20个JSON库在不同操作下的速度、內存用量及代码大小。 4 | 5 | [1]: https://github.com/miloyip/nativejson-benchmark 6 | 7 | RapidJSON 0.1版本的性能测试文章位于[这里](https://code.google.com/p/rapidjson/wiki/Performance). 8 | 9 | 此外,你也可以参考以下这些第三方的评测。 10 | 11 | ## 第三方评测 12 | 13 | * [Basic benchmarks for miscellaneous C++ JSON parsers and generators](https://github.com/mloskot/json_benchmark) by Mateusz Loskot (Jun 2013) 14 | * [casablanca](https://casablanca.codeplex.com/) 15 | * [json_spirit](https://github.com/cierelabs/json_spirit) 16 | * [jsoncpp](http://jsoncpp.sourceforge.net/) 17 | * [libjson](http://sourceforge.net/projects/libjson/) 18 | * [rapidjson](https://github.com/miloyip/rapidjson/) 19 | * [QJsonDocument](http://qt-project.org/doc/qt-5.0/qtcore/qjsondocument.html) 20 | 21 | * [JSON Parser Benchmarking](http://chadaustin.me/2013/01/json-parser-benchmarking/) by Chad Austin (Jan 2013) 22 | * [sajson](https://github.com/chadaustin/sajson) 23 | * [rapidjson](https://github.com/miloyip/rapidjson/) 24 | * [vjson](https://code.google.com/p/vjson/) 25 | * [YAJL](http://lloyd.github.com/yajl/) 26 | * [Jansson](http://www.digip.org/jansson/) 27 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011 Milo Yip (miloyip@gmail.com) 2 | # Copyright (c) 2013 Rafal Jeczalik (rjeczalik@gmail.com) 3 | # Distributed under the MIT License (see license.txt file) 4 | 5 | set(EXAMPLES 6 | capitalize 7 | condense 8 | messagereader 9 | pretty 10 | prettyauto 11 | serialize 12 | simpledom 13 | simplereader 14 | simplewriter 15 | tutorial) 16 | 17 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") 18 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default") 19 | elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") 20 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default") 21 | elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") 22 | add_definitions(-D_CRT_SECURE_NO_WARNINGS=1) 23 | endif() 24 | 25 | foreach (example ${EXAMPLES}) 26 | add_executable(${example} ${example}/${example}.cpp) 27 | endforeach() 28 | 29 | add_custom_target(examples ALL DEPENDS ${EXAMPLES}) 30 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/example/condense/condense.cpp: -------------------------------------------------------------------------------- 1 | // JSON condenser example 2 | 3 | // This example parses JSON text from stdin with validation, 4 | // and re-output the JSON content to stdout without whitespace. 5 | 6 | #include "rapidjson/reader.h" 7 | #include "rapidjson/writer.h" 8 | #include "rapidjson/filereadstream.h" 9 | #include "rapidjson/filewritestream.h" 10 | #include "rapidjson/error/en.h" 11 | 12 | using namespace rapidjson; 13 | 14 | int main(int, char*[]) { 15 | // Prepare JSON reader and input stream. 16 | Reader reader; 17 | char readBuffer[65536]; 18 | FileReadStream is(stdin, readBuffer, sizeof(readBuffer)); 19 | 20 | // Prepare JSON writer and output stream. 21 | char writeBuffer[65536]; 22 | FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer)); 23 | Writer writer(os); 24 | 25 | // JSON reader parse from the input stream and let writer generate the output. 26 | if (!reader.Parse(is, writer)) { 27 | fprintf(stderr, "\nError(%u): %s\n", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode())); 28 | return 1; 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/example/pretty/pretty.cpp: -------------------------------------------------------------------------------- 1 | // JSON pretty formatting example 2 | // This example can only handle UTF-8. For handling other encodings, see prettyauto example. 3 | 4 | #include "rapidjson/reader.h" 5 | #include "rapidjson/prettywriter.h" 6 | #include "rapidjson/filereadstream.h" 7 | #include "rapidjson/filewritestream.h" 8 | #include "rapidjson/error/en.h" 9 | 10 | using namespace rapidjson; 11 | 12 | int main(int, char*[]) { 13 | // Prepare reader and input stream. 14 | Reader reader; 15 | char readBuffer[65536]; 16 | FileReadStream is(stdin, readBuffer, sizeof(readBuffer)); 17 | 18 | // Prepare writer and output stream. 19 | char writeBuffer[65536]; 20 | FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer)); 21 | PrettyWriter writer(os); 22 | 23 | // JSON reader parse from the input stream and let writer generate the output. 24 | if (!reader.Parse(is, writer)) { 25 | fprintf(stderr, "\nError(%u): %s\n", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode())); 26 | return 1; 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/example/simpledom/simpledom.cpp: -------------------------------------------------------------------------------- 1 | // JSON simple example 2 | // This example does not handle errors. 3 | 4 | #include "rapidjson/document.h" 5 | #include "rapidjson/writer.h" 6 | #include "rapidjson/stringbuffer.h" 7 | #include 8 | 9 | using namespace rapidjson; 10 | 11 | int main() { 12 | // 1. Parse a JSON string into DOM. 13 | const char* json = "{\"project\":\"rapidjson\",\"stars\":10}"; 14 | Document d; 15 | d.Parse(json); 16 | 17 | // 2. Modify it by DOM. 18 | Value& s = d["stars"]; 19 | s.SetInt(s.GetInt() + 1); 20 | 21 | // 3. Stringify the DOM 22 | StringBuffer buffer; 23 | Writer writer(buffer); 24 | d.Accept(writer); 25 | 26 | // Output {"project":"rapidjson","stars":11} 27 | std::cout << buffer.GetString() << std::endl; 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/example/simplereader/simplereader.cpp: -------------------------------------------------------------------------------- 1 | #include "rapidjson/reader.h" 2 | #include 3 | 4 | using namespace rapidjson; 5 | using namespace std; 6 | 7 | struct MyHandler { 8 | bool Null() { cout << "Null()" << endl; return true; } 9 | bool Bool(bool b) { cout << "Bool(" << boolalpha << b << ")" << endl; return true; } 10 | bool Int(int i) { cout << "Int(" << i << ")" << endl; return true; } 11 | bool Uint(unsigned u) { cout << "Uint(" << u << ")" << endl; return true; } 12 | bool Int64(int64_t i) { cout << "Int64(" << i << ")" << endl; return true; } 13 | bool Uint64(uint64_t u) { cout << "Uint64(" << u << ")" << endl; return true; } 14 | bool Double(double d) { cout << "Double(" << d << ")" << endl; return true; } 15 | bool String(const char* str, SizeType length, bool copy) { 16 | cout << "String(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl; 17 | return true; 18 | } 19 | bool StartObject() { cout << "StartObject()" << endl; return true; } 20 | bool Key(const char* str, SizeType length, bool copy) { 21 | cout << "Key(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl; 22 | return true; 23 | } 24 | bool EndObject(SizeType memberCount) { cout << "EndObject(" << memberCount << ")" << endl; return true; } 25 | bool StartArray() { cout << "StartArray()" << endl; return true; } 26 | bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; } 27 | }; 28 | 29 | int main() { 30 | const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } "; 31 | 32 | MyHandler handler; 33 | Reader reader; 34 | StringStream ss(json); 35 | reader.Parse(ss, handler); 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/example/simplewriter/simplewriter.cpp: -------------------------------------------------------------------------------- 1 | #include "rapidjson/writer.h" 2 | #include "rapidjson/stringbuffer.h" 3 | #include 4 | 5 | using namespace rapidjson; 6 | using namespace std; 7 | 8 | int main() { 9 | StringBuffer s; 10 | Writer writer(s); 11 | 12 | writer.StartObject(); 13 | writer.String("hello"); 14 | writer.String("world"); 15 | writer.String("t"); 16 | writer.Bool(true); 17 | writer.String("f"); 18 | writer.Bool(false); 19 | writer.String("n"); 20 | writer.Null(); 21 | writer.String("i"); 22 | writer.Uint(123); 23 | writer.String("pi"); 24 | writer.Double(3.1416); 25 | writer.String("a"); 26 | writer.StartArray(); 27 | for (unsigned i = 0; i < 4; i++) 28 | writer.Uint(i); 29 | writer.EndArray(); 30 | writer.EndObject(); 31 | 32 | cout << s.GetString() << endl; 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/include/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 16 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | namespace internal { 22 | 23 | //! Custom strlen() which works on different character types. 24 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 25 | \param s Null-terminated input string. 26 | \return Number of characters in the string. 27 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 28 | */ 29 | template 30 | inline SizeType StrLen(const Ch* s) { 31 | const Ch* p = s; 32 | while (*p) ++p; 33 | return SizeType(p - s); 34 | } 35 | 36 | } // namespace internal 37 | RAPIDJSON_NAMESPACE_END 38 | 39 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 40 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(GTestSrc) 2 | 3 | IF(GTESTSRC_FOUND) 4 | enable_testing() 5 | 6 | if (WIN32 AND (NOT CYGWIN) AND (NOT MINGW)) 7 | set(gtest_disable_pthreads ON) 8 | set(gtest_force_shared_crt ON) 9 | endif() 10 | 11 | add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest) 12 | include_directories(${GTEST_INCLUDE_DIR}) 13 | 14 | set(TEST_LIBRARIES gtest gtest_main) 15 | 16 | add_custom_target(tests ALL) 17 | add_subdirectory(perftest) 18 | add_subdirectory(unittest) 19 | 20 | ENDIF(GTESTSRC_FOUND) 21 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/test/perftest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(PERFTEST_SOURCES 2 | misctest.cpp 3 | perftest.cpp 4 | platformtest.cpp 5 | rapidjsontest.cpp) 6 | 7 | add_executable(perftest ${PERFTEST_SOURCES}) 8 | target_link_libraries(perftest ${TEST_LIBRARIES}) 9 | 10 | add_dependencies(tests perftest) 11 | 12 | IF(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug")) 13 | add_test(NAME perftest 14 | COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/perftest 15 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) 16 | ENDIF() 17 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/test/perftest/perftest.cpp: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #include "perftest.h" 16 | 17 | int main(int argc, char **argv) { 18 | #if _MSC_VER 19 | _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); 20 | //void *testWhetherMemoryLeakDetectionWorks = malloc(1); 21 | #endif 22 | ::testing::InitGoogleTest(&argc, argv); 23 | return RUN_ALL_TESTS(); 24 | } 25 | -------------------------------------------------------------------------------- /src/third_party/rapidjson/test/unittest/readertest.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/rapidjson/test/unittest/readertest.cpp -------------------------------------------------------------------------------- /src/third_party/rapidjson/test/unittest/unittest.cpp: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #include "unittest.h" 16 | #include "rapidjson/rapidjson.h" 17 | 18 | int main(int argc, char **argv) { 19 | ::testing::InitGoogleTest(&argc, argv); 20 | 21 | std::cout << "RapidJSON v" << RAPIDJSON_VERSION_STRING << std::endl; 22 | 23 | #if _MSC_VER 24 | _CrtMemState memoryState = { 0 }; 25 | _CrtMemCheckpoint(&memoryState); 26 | //_CrtSetBreakAlloc(X); 27 | //void *testWhetherMemoryLeakDetectionWorks = malloc(1); 28 | #endif 29 | 30 | int ret = RUN_ALL_TESTS(); 31 | 32 | #if _MSC_VER 33 | // Current gtest constantly leak 2 blocks at exit 34 | _CrtMemDumpAllObjectsSince(&memoryState); 35 | #endif 36 | return ret; 37 | } 38 | -------------------------------------------------------------------------------- /src/third_party/tclap/AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | original author: Michael E. Smoot 3 | invaluable contributions: Daniel Aarno 4 | more contributions: Erik Zeek 5 | more contributions: Fabien Carmagnac (Tinbergen-AM) 6 | outstanding editing: Carol Smoot 7 | -------------------------------------------------------------------------------- /src/third_party/tclap/COPYING: -------------------------------------------------------------------------------- 1 | 2 | 3 | Copyright (c) 2003 Michael E. Smoot 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 21 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/third_party/tclap/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | ACLOCAL_AMFLAGS = -I config 3 | 4 | SUBDIRS = include examples docs tests msc config 5 | 6 | pkgconfigdir = $(libdir)/pkgconfig 7 | pkgconfig_DATA = $(PACKAGE).pc 8 | EXTRA_DIST = $(PACKAGE).pc.in 9 | 10 | DISTCLEANFILES = $(PACKAGE).pc 11 | -------------------------------------------------------------------------------- /src/third_party/tclap/README: -------------------------------------------------------------------------------- 1 | 2 | TCLAP - Templatized Command Line Argument Parser 3 | 4 | This is a simple C++ library that facilitates parsing command line 5 | arguments in a type independent manner. It doesn't conform exactly 6 | to either the GNU or POSIX standards, although it is close. See 7 | docs/manual.html for descriptions of how things work or look at the 8 | simple examples in the examples dir. 9 | 10 | To find out what the latest changes are read the NEWS file in this directory. 11 | 12 | 13 | Any and all feedback is welcome to: Mike Smoot 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/third_party/tclap/config/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = ac_cxx_have_sstream.m4\ 3 | ac_cxx_have_strstream.m4\ 4 | ac_cxx_namespaces.m4\ 5 | bb_enable_doxygen.m4 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/third_party/tclap/config/ac_cxx_have_long_long.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis AC_CXX_HAVE_LONG_LONG 2 | dnl 3 | dnl If the C++ implementation have a long long type 4 | dnl 5 | AC_DEFUN([AC_CXX_HAVE_LONG_LONG], 6 | [AC_LANG_SAVE 7 | AC_LANG_CPLUSPLUS 8 | AC_TRY_COMPILE([],[long long x = 1; return 0;], 9 | ac_cv_cxx_have_long_long=yes, ac_cv_cxx_have_long_long=no) 10 | 11 | if test "$ac_cv_cxx_have_long_long" = yes; then 12 | AC_DEFINE(HAVE_LONG_LONG, 1, 13 | [define if the C++ implementation have long long]) 14 | else 15 | AC_DEFINE(HAVE_LONG_LONG, 0, 16 | [define if the C++ implementation have long long]) 17 | fi 18 | AC_LANG_RESTORE 19 | ]) 20 | -------------------------------------------------------------------------------- /src/third_party/tclap/config/ac_cxx_have_sstream.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis AC_CXX_HAVE_SSTREAM 2 | dnl 3 | dnl If the C++ library has a working stringstream, define HAVE_SSTREAM. 4 | dnl 5 | dnl @author Ben Stanley 6 | dnl @version $Id: ac_cxx_have_sstream.m4,v 1.2 2006/02/22 02:10:28 zeekec Exp $ 7 | dnl 8 | AC_DEFUN([AC_CXX_HAVE_SSTREAM], 9 | [AC_REQUIRE([AC_CXX_NAMESPACES]) 10 | AC_LANG_SAVE 11 | AC_LANG_CPLUSPLUS 12 | AC_CHECK_HEADERS(sstream) 13 | AC_CACHE_CHECK([whether the STL defines stringstream], 14 | [ac_cv_cxx_have_sstream], 15 | [AC_TRY_COMPILE([#include 16 | #ifdef HAVE_NAMESPACES 17 | using namespace std; 18 | #endif],[stringstream message; message << "Hello"; return 0;], 19 | ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no) 20 | ]) 21 | if test "$ac_cv_cxx_have_sstream" = yes; then 22 | AC_DEFINE(HAVE_SSTREAM,1,[define if the compiler has stringstream]) 23 | fi 24 | AC_LANG_RESTORE 25 | ]) 26 | -------------------------------------------------------------------------------- /src/third_party/tclap/config/ac_cxx_have_strstream.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis AC_CXX_HAVE_STRSTREAM 2 | dnl 3 | dnl If the C++ library has a working strstream, define HAVE_CLASS_STRSTREAM. 4 | dnl 5 | dnl Adapted from ac_cxx_have_sstream.m4 by Steve Robbins 6 | dnl 7 | AC_DEFUN([AC_CXX_HAVE_STRSTREAM], 8 | [AC_REQUIRE([AC_CXX_NAMESPACES]) 9 | AC_LANG_SAVE 10 | AC_LANG_CPLUSPLUS 11 | AC_CHECK_HEADERS(strstream) 12 | AC_CACHE_CHECK([whether the STL defines strstream], 13 | [ac_cv_cxx_have_class_strstream], 14 | [AC_TRY_COMPILE([#if HAVE_STRSTREAM 15 | # include 16 | #else 17 | # include 18 | #endif 19 | #ifdef HAVE_NAMESPACES 20 | using namespace std; 21 | #endif],[ostrstream message; message << "Hello"; return 0;], 22 | ac_cv_cxx_have_class_strstream=yes, ac_cv_cxx_have_class_strstream=no) 23 | ]) 24 | if test "$ac_cv_cxx_have_class_strstream" = yes; then 25 | AC_DEFINE(HAVE_CLASS_STRSTREAM,1,[define if the library defines strstream]) 26 | fi 27 | AC_LANG_RESTORE 28 | ]) 29 | -------------------------------------------------------------------------------- /src/third_party/tclap/config/ac_cxx_namespaces.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis AC_CXX_NAMESPACES 2 | dnl 3 | dnl If the compiler can prevent names clashes using namespaces, define 4 | dnl HAVE_NAMESPACES. 5 | dnl 6 | dnl @version $Id: ac_cxx_namespaces.m4,v 1.1.1.1 2003/03/19 02:40:00 mes5k Exp $ 7 | dnl @author Luc Maisonobe 8 | dnl 9 | AC_DEFUN([AC_CXX_NAMESPACES], 10 | [AC_CACHE_CHECK(whether the compiler implements namespaces, 11 | ac_cv_cxx_namespaces, 12 | [AC_LANG_SAVE 13 | AC_LANG_CPLUSPLUS 14 | AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], 15 | [using namespace Outer::Inner; return i;], 16 | ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) 17 | AC_LANG_RESTORE 18 | ]) 19 | if test "$ac_cv_cxx_namespaces" = yes; then 20 | AC_DEFINE(HAVE_NAMESPACES,1,[define to 1 if the compiler implements namespaces]) 21 | fi 22 | ]) 23 | -------------------------------------------------------------------------------- /src/third_party/tclap/config/ac_cxx_warn_effective_cxx.m4: -------------------------------------------------------------------------------- 1 | dnl HAVE_WARN_EFFECTIVE_CXX 2 | dnl ---------------------- 3 | dnl 4 | dnl If the C++ compiler accepts the `-Weffc++' flag, 5 | dnl set output variable `WARN_EFFECTIVE_CXX' to `-Weffc++' and 6 | dnl `WARN_NO_EFFECTIVE_CXX' to `-Wno-effc++'. Otherwise, 7 | dnl leave both empty. 8 | dnl 9 | AC_DEFUN([HAVE_WARN_EFFECTIVE_CXX], 10 | [ 11 | AC_REQUIRE([AC_PROG_CXX]) 12 | AC_MSG_CHECKING([whether the C++ compiler (${CXX}) accepts -Weffc++]) 13 | AC_CACHE_VAL([cv_warn_effective_cxx], 14 | [ 15 | AC_LANG_SAVE 16 | AC_LANG_CPLUSPLUS 17 | save_cxxflags="$CXXFLAGS" 18 | CXXFLAGS="$CXXFLAGS -Weffc++" 19 | AC_TRY_COMPILE([],[main();], 20 | [cv_warn_effective_cxx=yes], [cv_warn_effective_cxx=no]) 21 | CXXFLAGS="$save_cxxflags" 22 | AC_LANG_RESTORE 23 | ]) 24 | AC_MSG_RESULT([$cv_warn_effective_cxx]) 25 | if test "$cv_warn_effective_cxx" = yes; then 26 | WARN_EFFECTIVE_CXX=-Weffc++ 27 | WARN_NO_EFFECTIVE_CXX=-Wno-effc++ 28 | fi 29 | AC_SUBST([WARN_EFFECTIVE_CXX]) 30 | AC_SUBST([WARN_NO_EFFECTIVE_CXX]) 31 | ]) 32 | -------------------------------------------------------------------------------- /src/third_party/tclap/config/bb_enable_doxygen.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([BB_ENABLE_DOXYGEN], 2 | [ 3 | AC_ARG_ENABLE(doxygen, [--enable-doxygen enable documentation generation with doxygen (auto)]) 4 | if test "x$enable_doxygen" = xno; then 5 | enable_doc=no 6 | else 7 | AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) 8 | if test x$DOXYGEN = x; then 9 | if test "x$enable_doxygen" = xyes; then 10 | AC_MSG_ERROR([could not find doxygen]) 11 | fi 12 | enable_doc=no 13 | else 14 | enable_doc=yes 15 | fi 16 | fi 17 | AM_CONDITIONAL(DOC, test x$enable_doc = xyes) 18 | ]) 19 | -------------------------------------------------------------------------------- /src/third_party/tclap/config/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.1 2003/04/03 18:13:41 mes5k Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /src/third_party/tclap/configure.in: -------------------------------------------------------------------------------- 1 | AC_INIT(Makefile.am) 2 | #AC_PREREQ(2.50) 3 | AC_CONFIG_AUX_DIR(config) 4 | AM_CONFIG_HEADER(config/config.h) 5 | AM_INIT_AUTOMAKE(tclap,1.2.1) 6 | AC_PROG_CXX 7 | AC_CXX_HAVE_SSTREAM 8 | AC_CXX_HAVE_STRSTREAM 9 | AC_CXX_HAVE_LONG_LONG 10 | AC_CHECK_PROG(DOT,dot,YES,NO) 11 | AC_PROG_RANLIB 12 | AC_PROG_INSTALL 13 | BB_ENABLE_DOXYGEN 14 | 15 | HAVE_WARN_EFFECTIVE_CXX 16 | CXXFLAGS="$CXXFLAGS $WARN_EFFECTIVE_CXX" 17 | 18 | AM_CONDITIONAL([HAVE_GNU_COMPILERS], [test x$ac_cv_cxx_compiler_gnu = xyes]) 19 | 20 | AC_OUTPUT([ Makefile \ 21 | tclap.pc \ 22 | examples/Makefile \ 23 | include/Makefile \ 24 | include/tclap/Makefile \ 25 | config/Makefile \ 26 | docs/Makefile \ 27 | docs/Doxyfile \ 28 | msc/Makefile \ 29 | msc/examples/Makefile \ 30 | tests/Makefile], \ 31 | [chmod a+x $ac_top_srcdir/tests/*.sh]) 32 | -------------------------------------------------------------------------------- /src/third_party/tclap/docs/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | if DOC 3 | 4 | all: 5 | @DOXYGEN@ Doxyfile 6 | 7 | else 8 | 9 | all: 10 | 11 | endif 12 | 13 | EXTRA_DIST = manual.xml 14 | dist_doc_DATA = index.html manual.html style.css 15 | docdir = ${datadir}/doc/${PACKAGE} 16 | 17 | install-data-local : 18 | $(mkdir_p) $(DESTDIR)$(docdir) 19 | cp -R $(abs_srcdir)/html $(DESTDIR)$(docdir) 20 | 21 | uninstall-local : 22 | chmod -R +w $(DESTDIR)$(docdir) 23 | rm -rf $(DESTDIR)$(docdir) 24 | 25 | dist-hook : 26 | $(mkdir_p) $(distdir) 27 | cp -R $(abs_srcdir)/html $(distdir) 28 | 29 | clean-local: 30 | $(RM) -rf $(abs_srcdir)/html/* 31 | 32 | -------------------------------------------------------------------------------- /src/third_party/tclap/docs/README: -------------------------------------------------------------------------------- 1 | 2 | To generate the manual from the docbook xml you need and xslt processor 3 | and an xsl file that defines the output. For example: 4 | 5 | xsltproc --stringparam html.stylesheet style.css /Users/mes/software/docbook-xsl-1.71.1/xhtml/docbook.xsl manual.xml > manual.html 6 | -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/CVS/Entries: -------------------------------------------------------------------------------- 1 | D 2 | -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/CVS/Repository: -------------------------------------------------------------------------------- 1 | tclap/docs/html 2 | -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/CVS/Root: -------------------------------------------------------------------------------- 1 | :ext:mes5k@tclap.cvs.sourceforge.net:/cvsroot/tclap 2 | -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1Arg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1Arg.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1ArgException.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1ArgException.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1ArgParseException.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1ArgParseException.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1CmdLine.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1CmdLine.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1CmdLineInterface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1CmdLineInterface.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1CmdLineOutput.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1CmdLineOutput.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1CmdLineParseException.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1CmdLineParseException.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1Constraint.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1Constraint.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1DocBookOutput.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1DocBookOutput.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1HelpVisitor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1HelpVisitor.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1IgnoreRestVisitor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1IgnoreRestVisitor.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1MultiArg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1MultiArg.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1MultiSwitchArg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1MultiSwitchArg.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1SpecificationException.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1SpecificationException.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1StdOutput.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1StdOutput.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1SwitchArg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1SwitchArg.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1UnlabeledMultiArg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1UnlabeledMultiArg.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1UnlabeledValueArg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1UnlabeledValueArg.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1ValueArg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1ValueArg.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1ValuesConstraint.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1ValuesConstraint.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1VersionVisitor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1VersionVisitor.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1Visitor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1Visitor.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/classTCLAP_1_1ZshCompletionOutput.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/classTCLAP_1_1ZshCompletionOutput.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/doxygen.png -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/globals_type.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | tclap: Class Members 6 | 7 | 8 | 9 | 10 | 11 | 34 |
35 |  
    36 |
  • istringstream 37 | : Arg.h 38 |
  • 39 |
40 |
41 |
Generated on Sat Apr 16 15:34:25 2011 for tclap by  42 | 43 | doxygen 1.6.0
44 | 45 | 46 | -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | tclap: Main Page 6 | 7 | 8 | 9 | 10 | 11 | 21 |
22 |

tclap Documentation

1.2.1

23 |
Generated on Sat Apr 16 15:34:24 2011 for tclap by  24 | 25 | doxygen 1.6.0
26 | 27 | 28 | -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/namespaces.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | tclap: Namespace Index 6 | 7 | 8 | 9 | 10 | 11 | 27 |
28 |

Namespace List

Here is a list of all namespaces with brief descriptions: 29 | 30 |
TCLAP
31 |
32 |
Generated on Sat Apr 16 15:34:24 2011 for tclap by  33 | 34 | doxygen 1.6.0
35 | 36 | 37 | -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/tab_b.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/tab_b.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/tab_l.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/tab_l.gif -------------------------------------------------------------------------------- /src/third_party/tclap/docs/html/tab_r.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/docs/html/tab_r.gif -------------------------------------------------------------------------------- /src/third_party/tclap/examples/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | noinst_PROGRAMS = test1 test2 test3 test4 test5 test6 test7 test8 test9 \ 3 | test10 test11 test12 test13 test14 test15 test16 \ 4 | test17 test18 test19 test20 test21 5 | 6 | test1_SOURCES = test1.cpp 7 | test2_SOURCES = test2.cpp 8 | test3_SOURCES = test3.cpp 9 | test4_SOURCES = test4.cpp 10 | test5_SOURCES = test5.cpp 11 | test6_SOURCES = test6.cpp 12 | test7_SOURCES = test7.cpp 13 | test8_SOURCES = test8.cpp 14 | test9_SOURCES = test9.cpp 15 | test10_SOURCES = test10.cpp 16 | test11_SOURCES = test11.cpp 17 | test12_SOURCES = test12.cpp 18 | test13_SOURCES = test13.cpp 19 | test14_SOURCES = test14.cpp 20 | test15_SOURCES = test15.cpp 21 | test16_SOURCES = test16.cpp 22 | test17_SOURCES = test17.cpp test17-a.cpp 23 | test18_SOURCES = test18.cpp 24 | test19_SOURCES = test19.cpp 25 | test20_SOURCES = test20.cpp 26 | test21_SOURCES = test21.cpp 27 | 28 | AM_CPPFLAGS = -I$(top_srcdir)/include 29 | 30 | if HAVE_GNU_COMPILERS 31 | AM_CXXFLAGS = -Wall -Wextra 32 | endif 33 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "tclap/CmdLine.h" 5 | 6 | using namespace TCLAP; 7 | using namespace std; 8 | 9 | int main(int argc, char** argv) 10 | { 11 | // Wrap everything in a try block. Do this every time, 12 | // because exceptions will be thrown for problems. 13 | try { 14 | 15 | // Define the command line object. 16 | CmdLine cmd("Command description message", ' ', "0.9"); 17 | 18 | // Define a value argument and add it to the command line. 19 | ValueArg nameArg("n","name","Name to print",true,"homer","string"); 20 | cmd.add( nameArg ); 21 | 22 | // Define a switch and add it to the command line. 23 | SwitchArg reverseSwitch("r","reverse","Print name backwards", false); 24 | cmd.add( reverseSwitch ); 25 | 26 | // Parse the args. 27 | cmd.parse( argc, argv ); 28 | 29 | // Get the value parsed by each arg. 30 | string name = nameArg.getValue(); 31 | bool reverseName = reverseSwitch.getValue(); 32 | 33 | // Do what you intend too... 34 | if ( reverseName ) 35 | { 36 | reverse(name.begin(),name.end()); 37 | cout << "My name (spelled backwards) is: " << name << endl; 38 | } 39 | else 40 | cout << "My name is: " << name << endl; 41 | 42 | 43 | } catch (ArgException &e) // catch any exceptions 44 | { cerr << "error: " << e.error() << " for arg " << e.argId() << endl; } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test10.cpp: -------------------------------------------------------------------------------- 1 | // Test only makes sure we can use different argv types for the 2 | // parser. Don't run, just compile. 3 | 4 | #include "tclap/CmdLine.h" 5 | 6 | using namespace TCLAP; 7 | int main() 8 | { 9 | char *argv5[] = {(char*)"Foo", 0}; 10 | const char *argv6[] = {"Foo", 0}; 11 | const char * const argv7[] = {"Foo", 0}; 12 | char **argv1 = argv5; 13 | const char **argv2 = argv6; 14 | const char * const * argv3 = argv7; 15 | const char * const * const argv4 = argv7; 16 | 17 | CmdLine cmd("Command description message", ' ', "0.9"); 18 | cmd.parse(0, argv1); 19 | cmd.parse(0, argv2); 20 | cmd.parse(0, argv3); 21 | cmd.parse(0, argv4); 22 | cmd.parse(0, argv5); 23 | cmd.parse(0, argv6); 24 | cmd.parse(0, argv7); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test11.cpp: -------------------------------------------------------------------------------- 1 | #include "tclap/CmdLine.h" 2 | #include 3 | 4 | using namespace TCLAP; 5 | 6 | // Define a simple 3D vector type 7 | struct Vect3D { 8 | double v[3]; 9 | 10 | // operator= will be used to assign to the vector 11 | Vect3D& operator=(const std::string &str) 12 | { 13 | std::istringstream iss(str); 14 | if (!(iss >> v[0] >> v[1] >> v[2])) 15 | throw TCLAP::ArgParseException(str + " is not a 3D vector"); 16 | 17 | return *this; 18 | } 19 | 20 | std::ostream& print(std::ostream &os) const 21 | { 22 | std::copy(v, v + 3, std::ostream_iterator(os, " ")); 23 | return os; 24 | } 25 | }; 26 | 27 | // Create an ArgTraits for the 3D vector type that declares it to be 28 | // of string like type 29 | namespace TCLAP { 30 | template<> 31 | struct ArgTraits { 32 | typedef StringLike ValueCategory; 33 | }; 34 | } 35 | 36 | int main(int argc, char *argv[]) 37 | { 38 | CmdLine cmd("Command description message", ' ', "0.9"); 39 | ValueArg vec("v", "vect", "vector", 40 | true, Vect3D(), "3D vector", cmd); 41 | 42 | try { 43 | cmd.parse(argc, argv); 44 | } catch(std::exception &e) { 45 | std::cout << e.what() << std::endl; 46 | return EXIT_FAILURE; 47 | } 48 | 49 | vec.getValue().print(std::cout); 50 | std::cout << std::endl; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test12.cpp: -------------------------------------------------------------------------------- 1 | #include "tclap/CmdLine.h" 2 | #include 3 | #include 4 | 5 | using namespace TCLAP; 6 | 7 | // Define a simple 3D vector type 8 | struct Vect3D { 9 | double v[3]; 10 | 11 | // operator= will be used to assign to the vector 12 | Vect3D& operator=(const std::string &str) 13 | { 14 | std::istringstream iss(str); 15 | if (!(iss >> v[0] >> v[1] >> v[2])) 16 | throw TCLAP::ArgParseException(str + " is not a 3D vector"); 17 | 18 | return *this; 19 | } 20 | 21 | std::ostream& print(std::ostream &os) const 22 | { 23 | std::copy(v, v + 3, std::ostream_iterator(os, " ")); 24 | return os; 25 | } 26 | 27 | }; 28 | 29 | std::ostream& operator<<(std::ostream &os, const Vect3D &v) 30 | { 31 | return v.print(os); 32 | } 33 | 34 | // Create an ArgTraits for the 3D vector type that declares it to be 35 | // of string like type 36 | namespace TCLAP { 37 | template<> 38 | struct ArgTraits { 39 | typedef StringLike ValueCategory; 40 | }; 41 | } 42 | 43 | int main(int argc, char *argv[]) 44 | { 45 | CmdLine cmd("Command description message", ' ', "0.9"); 46 | MultiArg vec("v", "vect", "vector", 47 | true, "3D vector", cmd); 48 | 49 | try { 50 | cmd.parse(argc, argv); 51 | } catch(std::exception &e) { 52 | std::cout << e.what() << std::endl; 53 | return EXIT_FAILURE; 54 | } 55 | 56 | std::copy(vec.begin(), vec.end(), 57 | std::ostream_iterator(std::cout, "\n")); 58 | 59 | std::cout << "REVERSED" << std::endl; 60 | 61 | // use alt. form getValue() 62 | std::vector v(vec.getValue()); 63 | std::reverse(v.begin(), v.end()); 64 | 65 | std::copy(v.begin(), v.end(), 66 | std::ostream_iterator(std::cout, "\n")); 67 | } 68 | 69 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test13.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | using namespace TCLAP; 7 | 8 | // 9 | // This file tests that we can parse args from a vector 10 | // of strings rather than argv. This also tests a bug 11 | // where a single element in the vector contains both 12 | // the flag and value AND the value contains the flag 13 | // from another switch arg. This would fool the parser 14 | // into thinking that the string was a combined switches 15 | // string rather than a flag value combo. 16 | // 17 | // This should not print an error 18 | // 19 | // Contributed by Nico Lugil. 20 | // 21 | int main() 22 | { 23 | 24 | try 25 | { 26 | CmdLine cmd("Test", ' ', "not versioned",true); 27 | 28 | MultiArg Arg("X","fli","fli module",false,"string"); 29 | cmd.add(Arg); 30 | MultiSwitchArg ArgMultiSwitch("d","long_d","example"); 31 | cmd.add(ArgMultiSwitch); 32 | 33 | std::vector in; 34 | in.push_back("prog name"); 35 | in.push_back("-X module"); 36 | cmd.parse(in); 37 | 38 | std::vector s = Arg.getValue(); 39 | for(unsigned int i = 0 ; i < s.size() ; i++) 40 | { 41 | std::cout << s[i] << "\n"; 42 | } 43 | std::cout << "MultiSwtichArg was found " << ArgMultiSwitch.getValue() << " times.\n"; 44 | 45 | } 46 | catch (ArgException &e) // catch any exceptions 47 | { 48 | std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; 49 | } 50 | 51 | std::cout << "done...\n"; 52 | 53 | return 0; 54 | } 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test14.cpp: -------------------------------------------------------------------------------- 1 | #include "tclap/CmdLine.h" 2 | #include 3 | #include 4 | 5 | // Define a simple 3D vector type 6 | template 7 | struct Vect : public TCLAP::StringLikeTrait { 8 | //typedef TCLAP::StringLike ValueCategory; 9 | T v[LEN]; 10 | 11 | // operator= will be used to assign to the vector 12 | Vect& operator=(const std::string &str) 13 | { 14 | std::istringstream iss(str); 15 | for (size_t n = 0; n < LEN; n++) { 16 | if (!(iss >> v[n])) { 17 | std::ostringstream oss; 18 | oss << " is not a vector of size " << LEN; 19 | throw TCLAP::ArgParseException(str + oss.str()); 20 | } 21 | } 22 | 23 | if (!iss.eof()) { 24 | std::ostringstream oss; 25 | oss << " is not a vector of size " << LEN; 26 | throw TCLAP::ArgParseException(str + oss.str()); 27 | } 28 | 29 | return *this; 30 | } 31 | 32 | std::ostream& print(std::ostream &os) const 33 | { 34 | std::copy(v, v + LEN, std::ostream_iterator(os, " ")); 35 | return os; 36 | } 37 | 38 | }; 39 | 40 | int main(int argc, char *argv[]) 41 | { 42 | TCLAP::CmdLine cmd("Command description message", ' ', "0.9"); 43 | TCLAP::ValueArg< Vect > vec("v", "vect", "vector", 44 | true, Vect(), 45 | "3D vector", cmd); 46 | 47 | try { 48 | cmd.parse(argc, argv); 49 | } catch(std::exception &e) { 50 | std::cout << e.what() << std::endl; 51 | return EXIT_FAILURE; 52 | } 53 | 54 | vec.getValue().print(std::cout); 55 | std::cout << std::endl; 56 | } 57 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test15.cpp: -------------------------------------------------------------------------------- 1 | #include "tclap/CmdLine.h" 2 | #include 3 | #include 4 | 5 | // Define a simple 3D vector type 6 | template 7 | struct Vect { 8 | typedef TCLAP::StringLike ValueCategory; 9 | T v[LEN]; 10 | 11 | // operator= will be used to assign to the vector 12 | Vect& operator=(const std::string &str) 13 | { 14 | std::istringstream iss(str); 15 | for (size_t n = 0; n < LEN; n++) { 16 | if (!(iss >> v[n])) { 17 | std::ostringstream oss; 18 | oss << " is not a vector of size " << LEN; 19 | throw TCLAP::ArgParseException(str + oss.str()); 20 | } 21 | } 22 | 23 | if (!iss.eof()) { 24 | std::ostringstream oss; 25 | oss << " is not a vector of size " << LEN; 26 | throw TCLAP::ArgParseException(str + oss.str()); 27 | } 28 | 29 | return *this; 30 | } 31 | 32 | std::ostream& print(std::ostream &os) const 33 | { 34 | std::copy(v, v + LEN, std::ostream_iterator(os, " ")); 35 | return os; 36 | } 37 | 38 | }; 39 | 40 | int main(int argc, char *argv[]) 41 | { 42 | TCLAP::CmdLine cmd("Command description message", ' ', "0.9"); 43 | TCLAP::ValueArg< Vect > vec("v", "vect", "vector", 44 | true, Vect(), 45 | "3D vector", cmd); 46 | 47 | try { 48 | cmd.parse(argc, argv); 49 | } catch(std::exception &e) { 50 | std::cout << e.what() << std::endl; 51 | return EXIT_FAILURE; 52 | } 53 | 54 | vec.getValue().print(std::cout); 55 | std::cout << std::endl; 56 | } 57 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test16.cpp: -------------------------------------------------------------------------------- 1 | #include "tclap/CmdLine.h" 2 | #include 3 | #include 4 | 5 | namespace TCLAP { 6 | template<> 7 | struct ArgTraits< std::vector > { 8 | typedef StringLike ValueCategory; 9 | }; 10 | 11 | template<> 12 | void SetString< std::vector >(std::vector &v, 13 | const std::string &s) 14 | { 15 | std::istringstream iss(s); 16 | while (iss) { 17 | double tmp; 18 | iss >> tmp; 19 | v.push_back(tmp); 20 | } 21 | } 22 | } 23 | 24 | int main(int argc, char *argv[]) 25 | { 26 | TCLAP::CmdLine cmd("Command description message", ' ', "0.9"); 27 | TCLAP::ValueArg< std::vector > vec("v", "vect", "vector", 28 | true, std::vector(), 29 | "3D vector", cmd); 30 | try { 31 | cmd.parse(argc, argv); 32 | } catch(std::exception &e) { 33 | std::cout << e.what() << std::endl; 34 | return EXIT_FAILURE; 35 | } 36 | 37 | const std::vector &v = vec.getValue(); 38 | std::copy(v.begin(), v.end(), 39 | std::ostream_iterator(std::cout, "\n")); 40 | std::cout << std::endl; 41 | } 42 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test17-a.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test17.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { } 4 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test18.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "tclap/CmdLine.h" 5 | 6 | using namespace TCLAP; 7 | using namespace std; 8 | 9 | int main(int argc, char** argv) 10 | { 11 | try { 12 | 13 | CmdLine cmd("Command description message", ' ', "0.9", true); 14 | 15 | cmd.setExceptionHandling(false); 16 | 17 | cmd.parse(argc, argv); 18 | 19 | } catch (ArgException &e) { // catch any exceptions 20 | cerr << "error: " << e.error() << " for arg " << e.argId() << endl; 21 | return 1; 22 | } catch (ExitException &e) { // catch any exceptions 23 | cerr << "Exiting on ExitException." << endl; 24 | return e.getExitStatus(); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test19.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #define TCLAP_SETBASE_ZERO 1 4 | 5 | #include "tclap/CmdLine.h" 6 | #include 7 | #include 8 | 9 | 10 | using namespace TCLAP; 11 | using namespace std; 12 | 13 | int main(int argc, char** argv) 14 | { 15 | 16 | try { 17 | 18 | CmdLine cmd("this is a message", ' ', "0.99" ); 19 | 20 | ValueArg itest("i", "intTest", "integer test", true, 5, "int"); 21 | cmd.add( itest ); 22 | 23 | // 24 | // Parse the command line. 25 | // 26 | cmd.parse(argc,argv); 27 | 28 | // 29 | // Set variables 30 | // 31 | int _intTest = itest.getValue(); 32 | cout << "found int: " << _intTest << endl; 33 | 34 | } catch ( ArgException& e ) 35 | { cout << "ERROR: " << e.error() << " " << e.argId() << endl; } 36 | } 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test20.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace TCLAP; 7 | using namespace std; 8 | 9 | int main(int argc, char** argv) 10 | { 11 | // Wrap everything in a try block. Do this every time, 12 | // because exceptions will be thrown for problems. 13 | try { 14 | 15 | // Define the command line object. 16 | CmdLine cmd("Command description message", '=', "0.9"); 17 | 18 | SwitchArg atmcSwitch("a", "atmc", "aContinuous time semantics", false); 19 | SwitchArg btmcSwitch("b", "btmc", "bDiscrete time semantics", false); 20 | cmd.xorAdd(atmcSwitch, btmcSwitch); 21 | 22 | // Parse the args. 23 | cmd.parse( argc, argv ); 24 | 25 | } catch (ArgException &e) // catch any exceptions 26 | { cerr << "error: " << e.error() << " for arg " << e.argId() << endl; } 27 | } 28 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test21.cpp: -------------------------------------------------------------------------------- 1 | 2 | // This illustrates how to change the flag and name start strings. 3 | // Note that these defines need to happen *before* tclap is included! 4 | #define TCLAP_NAMESTARTSTRING "~~" 5 | #define TCLAP_FLAGSTARTSTRING "/" 6 | 7 | #include 8 | #include 9 | #include 10 | #include "tclap/CmdLine.h" 11 | 12 | using namespace TCLAP; 13 | using namespace std; 14 | 15 | int main(int argc, char** argv) 16 | { 17 | // Wrap everything in a try block. Do this every time, 18 | // because exceptions will be thrown for problems. 19 | try { 20 | 21 | // Define the command line object. 22 | CmdLine cmd("Command description message", ' ', "0.9"); 23 | 24 | // Define a value argument and add it to the command line. 25 | ValueArg nameArg("n","name","Name to print",true,"homer","string"); 26 | cmd.add( nameArg ); 27 | 28 | // Define a switch and add it to the command line. 29 | SwitchArg reverseSwitch("r","reverse","Print name backwards", false); 30 | cmd.add( reverseSwitch ); 31 | 32 | // Parse the args. 33 | cmd.parse( argc, argv ); 34 | 35 | // Get the value parsed by each arg. 36 | string name = nameArg.getValue(); 37 | bool reverseName = reverseSwitch.getValue(); 38 | 39 | // Do what you intend too... 40 | if ( reverseName ) 41 | { 42 | reverse(name.begin(),name.end()); 43 | cout << "My name (spelled backwards) is: " << name << endl; 44 | } 45 | else 46 | cout << "My name is: " << name << endl; 47 | 48 | 49 | } catch (ArgException &e) // catch any exceptions 50 | { cerr << "error: " << e.error() << " for arg " << e.argId() << endl; } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test6.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "tclap/CmdLine.h" 3 | 4 | using namespace TCLAP; 5 | using namespace std; 6 | 7 | int main(int argc, char** argv) 8 | { 9 | // Wrap everything in a try block. Do this every time, 10 | // because exceptions will be thrown for problems. 11 | try { 12 | 13 | // Define the command line object. 14 | CmdLine cmd("Command description message", ' ', "0.9"); 15 | 16 | vector allowed; 17 | allowed.push_back("homer"); 18 | allowed.push_back("marge"); 19 | allowed.push_back("bart"); 20 | allowed.push_back("lisa"); 21 | allowed.push_back("maggie"); 22 | ValuesConstraint allowedVals( allowed ); 23 | 24 | ValueArg nameArg("n","name","Name to print",true,"homer", 25 | &allowedVals); 26 | cmd.add( nameArg ); 27 | 28 | vector iallowed; 29 | iallowed.push_back(1); 30 | iallowed.push_back(2); 31 | iallowed.push_back(3); 32 | ValuesConstraint iallowedVals( iallowed ); 33 | 34 | UnlabeledValueArg intArg("times","Number of times to print",true,1, 35 | &iallowedVals,false); 36 | cmd.add( intArg ); 37 | 38 | // Parse the args. 39 | cmd.parse( argc, argv ); 40 | 41 | // Get the value parsed by each arg. 42 | int num = intArg.getValue(); 43 | string name = nameArg.getValue(); 44 | 45 | for ( int i = 0; i < num; i++ ) 46 | cout << "My name is " << name << endl; 47 | 48 | } catch ( ArgException& e) // catch any exceptions 49 | { cerr << "error: " << e.error() << " for arg " << e.argId() << endl; } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /src/third_party/tclap/examples/test9.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "tclap/CmdLine.h" 5 | 6 | using namespace TCLAP; 7 | using namespace std; 8 | 9 | int main(int argc, char** argv) 10 | { 11 | try { 12 | 13 | CmdLine cmd("Command description message", ' ', "0.9",false); 14 | 15 | SwitchArg reverseSwitch("r","reverse","REVERSE instead of FORWARDS", false); 16 | cmd.add( reverseSwitch ); 17 | 18 | MultiSwitchArg verbose("V","verbose","Level of verbosity"); 19 | cmd.add( verbose ); 20 | 21 | MultiSwitchArg noise("N","noise","Level of noise",5); 22 | cmd.add( noise ); 23 | 24 | UnlabeledValueArg word("word","a random word", false, "string", 25 | "won't see this",false); 26 | cmd.add( word ); 27 | 28 | // Uncommenting the next arg will (correctly) cause an exception 29 | // to be thrown. 30 | 31 | // UnlabeledMultiArg badword("badword","a bad word", false,"string"); 32 | // 33 | // cmd.add( badword ); 34 | 35 | cmd.parse( argc, argv ); 36 | 37 | bool reverseName = reverseSwitch.getValue(); 38 | 39 | if ( reverseName ) 40 | cout << "REVERSE" << endl; 41 | else 42 | cout << "FORWARD" << endl; 43 | 44 | if ( verbose.isSet() ) 45 | cout << "Verbose level: " << verbose.getValue() << endl; 46 | 47 | if ( noise.isSet() ) 48 | cout << "Noise level: " << noise.getValue() << endl; 49 | 50 | if ( word.isSet() ) 51 | cout << "Word: " << word.getValue() << endl; 52 | 53 | } catch (ArgException &e) // catch any exceptions 54 | { cerr << "error: " << e.error() << " for arg " << e.argId() << endl; } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/third_party/tclap/include/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = tclap 2 | -------------------------------------------------------------------------------- /src/third_party/tclap/include/tclap/IgnoreRestVisitor.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * 4 | * file: IgnoreRestVisitor.h 5 | * 6 | * Copyright (c) 2003, Michael E. Smoot . 7 | * All rights reverved. 8 | * 9 | * See the file COPYING in the top directory of this distribution for 10 | * more information. 11 | * 12 | * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 13 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 15 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 18 | * DEALINGS IN THE SOFTWARE. 19 | * 20 | *****************************************************************************/ 21 | 22 | 23 | #ifndef TCLAP_IGNORE_REST_VISITOR_H 24 | #define TCLAP_IGNORE_REST_VISITOR_H 25 | 26 | #include 27 | #include 28 | 29 | namespace TCLAP { 30 | 31 | /** 32 | * A Vistor that tells the CmdLine to begin ignoring arguments after 33 | * this one is parsed. 34 | */ 35 | class IgnoreRestVisitor: public Visitor 36 | { 37 | public: 38 | 39 | /** 40 | * Constructor. 41 | */ 42 | IgnoreRestVisitor() : Visitor() {} 43 | 44 | /** 45 | * Sets Arg::_ignoreRest. 46 | */ 47 | void visit() { Arg::beginIgnoring(); } 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/third_party/tclap/include/tclap/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libtclapincludedir = $(includedir)/tclap 3 | 4 | libtclapinclude_HEADERS = \ 5 | CmdLineInterface.h \ 6 | ArgException.h \ 7 | CmdLine.h \ 8 | XorHandler.h \ 9 | MultiArg.h \ 10 | UnlabeledMultiArg.h \ 11 | ValueArg.h \ 12 | UnlabeledValueArg.h \ 13 | Visitor.h Arg.h \ 14 | HelpVisitor.h \ 15 | SwitchArg.h \ 16 | MultiSwitchArg.h \ 17 | VersionVisitor.h \ 18 | IgnoreRestVisitor.h \ 19 | CmdLineOutput.h \ 20 | StdOutput.h \ 21 | DocBookOutput.h \ 22 | ZshCompletionOutput.h \ 23 | OptionalUnlabeledTracker.h \ 24 | Constraint.h \ 25 | ValuesConstraint.h \ 26 | ArgTraits.h \ 27 | StandardTraits.h 28 | 29 | -------------------------------------------------------------------------------- /src/third_party/tclap/include/tclap/Visitor.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * 4 | * file: Visitor.h 5 | * 6 | * Copyright (c) 2003, Michael E. Smoot . 7 | * All rights reverved. 8 | * 9 | * See the file COPYING in the top directory of this distribution for 10 | * more information. 11 | * 12 | * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS 13 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 15 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 18 | * DEALINGS IN THE SOFTWARE. 19 | * 20 | *****************************************************************************/ 21 | 22 | 23 | #ifndef TCLAP_VISITOR_H 24 | #define TCLAP_VISITOR_H 25 | 26 | namespace TCLAP { 27 | 28 | /** 29 | * A base class that defines the interface for visitors. 30 | */ 31 | class Visitor 32 | { 33 | public: 34 | 35 | /** 36 | * Constructor. Does nothing. 37 | */ 38 | Visitor() { } 39 | 40 | /** 41 | * Destructor. Does nothing. 42 | */ 43 | virtual ~Visitor() { } 44 | 45 | /** 46 | * Does nothing. Should be overridden by child. 47 | */ 48 | virtual void visit() { } 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/third_party/tclap/msc/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = examples 2 | 3 | EXTRA_DIST = README\ 4 | tclap-beta.ncb\ 5 | tclap-beta.sln\ 6 | tclap-beta.suo\ 7 | tclap-beta.vcproj 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/third_party/tclap/msc/README: -------------------------------------------------------------------------------- 1 | 2 | Disclaimer! 3 | =========== 4 | 5 | The various files included in the subdirectory for provided as a courtesy 6 | to Microsoft Visual Studio users. The files were contributed by a thoughtful 7 | user and were not created by the authors of this project. Moreover, the 8 | (current) authors have no way of maintaining, improving or even using the 9 | files. 10 | 11 | ** This means we can't answer any questions about the files! ** 12 | 13 | That said, we have several reports of people successfully using the TCLAP 14 | library on various Windows platforms. As long as you use a reasonably modern 15 | compiler (and Visual C++ apparently is), you shouldn't have any trouble. 16 | 17 | Good luck! 18 | -------------------------------------------------------------------------------- /src/third_party/tclap/msc/examples/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = test1.vcproj\ 3 | test2.vcproj\ 4 | test3.vcproj\ 5 | test4.vcproj\ 6 | test5.vcproj\ 7 | test6.vcproj\ 8 | test7.vcproj\ 9 | test8.vcproj 10 | 11 | -------------------------------------------------------------------------------- /src/third_party/tclap/msc/tclap-beta.ncb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/msc/tclap-beta.ncb -------------------------------------------------------------------------------- /src/third_party/tclap/msc/tclap-beta.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/src/third_party/tclap/msc/tclap-beta.suo -------------------------------------------------------------------------------- /src/third_party/tclap/tclap.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | includedir=@includedir@ 3 | 4 | Name: tclap 5 | Description: Templatized C++ Command Line Parser 6 | Version: @VERSION@ 7 | Cflags: -I${includedir} 8 | -------------------------------------------------------------------------------- /tools/base/Exception.php: -------------------------------------------------------------------------------- 1 | message}' in {$this->file}({$this->line})\n" 37 | . "{$this->getTraceAsString()}"; 38 | } 39 | } 40 | ?> 41 | -------------------------------------------------------------------------------- /tools/base/Monitor.php: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /tools/getopt-php/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - 5.6 4 | - 5.5 5 | - 5.4 6 | - 5.3 7 | - hhvm 8 | 9 | before_script: 10 | - composer install 11 | -------------------------------------------------------------------------------- /unittest/conf/easylogging.conf: -------------------------------------------------------------------------------- 1 | * ALL: // We need to start level with star '*' and end with colon ':' 2 | FORMAT = "%level: %log" // Quotes are not necessary but to make it more readable we wrap quotes around. 3 | FILENAME = "logs/testLog.log" 4 | ENABLED = true 5 | TO_FILE = true 6 | TO_STANDARD_OUTPUT = false 7 | MILLISECONDS_WIDTH = 3 8 | PERFORMANCE_TRACKING = false 9 | ROLL_OUT_SIZE = 2097152 // Throw log files away after 2MB 10 | 11 | // Following configuration only defines FORMAT for INFO, rest of the configurations are used from ALL configurations above 12 | * INFO: 13 | FORMAT = "%host - %user %datetime %level %thread %loc - %log" 14 | -------------------------------------------------------------------------------- /unittest/lib/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/logkafka/f329b5a9806e0b0f716884759edbe54e72e4dec0/unittest/lib/CMakeLists.txt -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Bharat Mediratta 9 | Chandler Carruth 10 | Chris Prince 11 | Chris Taylor 12 | Dan Egnor 13 | Eric Roman 14 | Hady Zalek 15 | Jeffrey Yasskin 16 | Jói Sigurðsson 17 | Keir Mierle 18 | Keith Ray 19 | Kenton Varda 20 | Manuel Klimek 21 | Markus Heule 22 | Mika Raento 23 | Miklós Fazekas 24 | Pasi Valminen 25 | Patrick Hanna 26 | Patrick Riley 27 | Peter Kaminski 28 | Preston Jackson 29 | Rainer Klaffenboeck 30 | Russ Cox 31 | Russ Rufer 32 | Sean Mcafee 33 | Sigurður Ásgeirsson 34 | Tracy Bialik 35 | Vadim Berman 36 | Vlad Losev 37 | Zhanyong Wan 38 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/COPYING: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/fused-src/gtest/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | std::cout << "Running main() from gtest_main.cc\n"; 36 | 37 | testing::InitGoogleTest(&argc, argv); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3017 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6b]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3017]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.6b' 20 | macro_revision='1.3017' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | std::cout << "Running main() from gtest_main.cc\n"; 36 | 37 | testing::InitGoogleTest(&argc, argv); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/test/production.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // This is part of the unit test for include/gtest/gtest_prod.h. 33 | 34 | #include "production.h" 35 | 36 | PrivateCode::PrivateCode() : x_(0) {} 37 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/xcode/Config/DebugProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // DebugProject.xcconfig 3 | // 4 | // These are Debug Configuration project settings for the gtest framework and 5 | // examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // No optimization 14 | GCC_OPTIMIZATION_LEVEL = 0 15 | 16 | // Deployment postprocessing is what triggers Xcode to strip, turn it off 17 | DEPLOYMENT_POSTPROCESSING = NO 18 | 19 | // Dead code stripping off 20 | DEAD_CODE_STRIPPING = NO 21 | 22 | // Debug symbols should be on obviously 23 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES 24 | 25 | // Define the DEBUG macro in all debug builds 26 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1 27 | 28 | // These are turned off to avoid STL incompatibilities with client code 29 | // // Turns on special C++ STL checks to "encourage" good STL use 30 | // GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS 31 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/xcode/Config/FrameworkTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // FrameworkTarget.xcconfig 3 | // 4 | // These are Framework target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Dynamic libs need to be position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Dynamic libs should not have their external symbols stripped. 14 | STRIP_STYLE = non-global 15 | 16 | // Let the user install by specifying the $DSTROOT with xcodebuild 17 | SKIP_INSTALL = NO 18 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/xcode/Config/General.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // General.xcconfig 3 | // 4 | // These are General configuration settings for the gtest framework and 5 | // examples. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Build for PPC and Intel, 32- and 64-bit 11 | ARCHS = i386 x86_64 ppc ppc64 12 | 13 | // Zerolink prevents link warnings so turn it off 14 | ZERO_LINK = NO 15 | 16 | // Prebinding considered unhelpful in 10.3 and later 17 | PREBINDING = NO 18 | 19 | // Strictest warning policy 20 | WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare -Wshadow 21 | 22 | // Work around Xcode bugs by using external strip. See: 23 | // http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html 24 | SEPARATE_STRIP = YES 25 | 26 | // Force C99 dialect 27 | GCC_C_LANGUAGE_STANDARD = c99 28 | 29 | // not sure why apple defaults this on, but it's pretty risky 30 | ALWAYS_SEARCH_USER_PATHS = NO 31 | 32 | // Turn on position dependent code for most cases (overridden where appropriate) 33 | GCC_DYNAMIC_NO_PIC = YES 34 | 35 | // Default SDK and minimum OS version is 10.4 36 | SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk 37 | MACOSX_DEPLOYMENT_TARGET = 10.4 38 | GCC_VERSION = 4.0 39 | 40 | // VERSIONING BUILD SETTINGS (used in Info.plist) 41 | GTEST_VERSIONINFO_ABOUT = © 2008 Google Inc. 42 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/xcode/Config/ReleaseProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // ReleaseProject.xcconfig 3 | // 4 | // These are Release Configuration project settings for the gtest framework 5 | // and examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // subconfig/Release.xcconfig 14 | 15 | // Optimize for space and size (Apple recommendation) 16 | GCC_OPTIMIZATION_LEVEL = s 17 | 18 | // Deploment postprocessing is what triggers Xcode to strip 19 | DEPLOYMENT_POSTPROCESSING = YES 20 | 21 | // No symbols 22 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO 23 | 24 | // Dead code strip does not affect ObjC code but can help for C 25 | DEAD_CODE_STRIPPING = YES 26 | 27 | // NDEBUG is used by things like assert.h, so define it for general compat. 28 | // ASSERT going away in release tends to create unused vars. 29 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable 30 | 31 | // When we strip we want to strip all symbols in release, but save externals. 32 | STRIP_STYLE = all 33 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/xcode/Config/StaticLibraryTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // StaticLibraryTarget.xcconfig 3 | // 4 | // These are static library target settings for libgtest.a. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Static libs can be included in bundles so make them position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Static libs should not have their internal globals or external symbols 14 | // stripped. 15 | STRIP_STYLE = debugging 16 | 17 | // Let the user install by specifying the $DSTROOT with xcodebuild 18 | SKIP_INSTALL = NO 19 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/xcode/Config/TestTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // TestTarget.xcconfig 3 | // 4 | // These are Test target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | 7 | PRODUCT_NAME = $(TARGET_NAME) 8 | HEADER_SEARCH_PATHS = ../include 9 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/xcode/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.${PRODUCT_NAME} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | GTEST_VERSIONINFO_LONG 21 | CFBundleShortVersionString 22 | GTEST_VERSIONINFO_SHORT 23 | CFBundleGetInfoString 24 | ${PRODUCT_NAME} GTEST_VERSIONINFO_LONG, ${GTEST_VERSIONINFO_ABOUT} 25 | NSHumanReadableCopyright 26 | ${GTEST_VERSIONINFO_ABOUT} 27 | CSResourcesFileMapped 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /unittest/lib/gtest-1.6.0/xcode/Samples/FrameworkSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.gtest.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /unittest/src/config_test.cc: -------------------------------------------------------------------------------- 1 | #define protected public 2 | #define private public 3 | #include "logkafka/config.h" 4 | #undef protected 5 | #undef private 6 | #include "gtest/gtest.h" 7 | #include 8 | 9 | using namespace logkafka; 10 | 11 | class ConfigTest: public ::testing::Test { 12 | protected: 13 | ConfigTest() { 14 | } 15 | 16 | virtual ~ConfigTest() { 17 | } 18 | 19 | virtual void SetUp() { 20 | } 21 | 22 | virtual void TearDown() { 23 | } 24 | 25 | public: 26 | static bool createFile(char* filename, string content); 27 | 28 | }; 29 | 30 | bool ConfigTest::createFile(char* filename, string content) { 31 | if(-1 == mkstemp(filename)) { 32 | fprintf(stderr, "generate unique filename fail!\n"); 33 | return false; 34 | } 35 | 36 | FILE* res_stream = fopen(filename, "a"); 37 | if (res_stream == NULL) { 38 | fprintf(stderr, "%s open fail!\n", filename); 39 | return false; 40 | } 41 | 42 | flock(fileno(res_stream), LOCK_EX); 43 | fprintf(res_stream, "%s", content.c_str()); 44 | flock(fileno(res_stream), LOCK_UN); 45 | 46 | if (res_stream != NULL) { 47 | fclose(res_stream); 48 | res_stream = NULL; 49 | } 50 | } 51 | 52 | TEST_F (ConfigTest, TestReadConfString) { 53 | 54 | char filename[255] = "/tmp/logkafka_test.confXXXXXX"; 55 | ConfigTest::createFile(filename, 56 | "zookeeper.connect = 127.0.0.1:2181\n" \ 57 | "pos.path = /tmp/pos.logkafka_test\n" \ 58 | "line.max.bytes = 1048576\n" \ 59 | "stat.silent.max.ms = 10000\n" \ 60 | "zookeeper.upload.interval = 10000\n" \ 61 | "refresh.interval = 30000\n" \ 62 | ); 63 | 64 | Config config; 65 | config.init(filename); 66 | unlink(filename); 67 | 68 | EXPECT_STREQ("127.0.0.1:2181", config.zookeeper_connect.c_str()); 69 | } 70 | --------------------------------------------------------------------------------