├── vendor ├── jpeg-9a │ ├── libjpeg.map │ ├── makeadsw.vc6 │ ├── makeasln.v10 │ ├── makecdep.vc6 │ ├── makecdsp.vc6 │ ├── makecfil.v10 │ ├── makecmak.vc6 │ ├── makecvcx.v10 │ ├── makeddep.vc6 │ ├── makeddsp.vc6 │ ├── makedfil.v10 │ ├── makedmak.vc6 │ ├── makedvcx.v10 │ ├── makejdep.vc6 │ ├── makejdsp.vc6 │ ├── makejdsw.vc6 │ ├── makejfil.v10 │ ├── makejmak.vc6 │ ├── makejsln.v10 │ ├── makejvcx.v10 │ ├── makerdep.vc6 │ ├── makerdsp.vc6 │ ├── makerfil.v10 │ ├── makermak.vc6 │ ├── makervcx.v10 │ ├── maketdep.vc6 │ ├── maketdsp.vc6 │ ├── maketfil.v10 │ ├── maketmak.vc6 │ ├── maketvcx.v10 │ ├── makewdep.vc6 │ ├── makewdsp.vc6 │ ├── makewfil.v10 │ ├── makewmak.vc6 │ ├── makewvcx.v10 │ ├── testimg.bmp │ ├── testimg.jpg │ ├── testimg.ppm │ ├── testimgp.jpg │ ├── testorig.jpg │ ├── testprog.jpg │ ├── makvms.opt │ ├── jversion.h │ ├── jconfig.vms │ ├── jconfig.wat │ ├── jconfig.dj │ ├── jconfig.sas │ ├── maktjpeg.st │ ├── jconfig.mac │ ├── jconfig.manx │ ├── rdgif.c │ ├── jconfig.st │ ├── jconfig.bcc │ ├── jconfig.vc │ ├── makcjpeg.st │ ├── makdjpeg.st │ ├── jconfig.cfg │ ├── jconfig.mc6 │ ├── rdjpgcom.1 │ ├── wrjpgcom.1 │ ├── jcinit.c │ └── jmemnobs.c └── ProgramOptions │ ├── src │ ├── generator │ │ ├── row.cc │ │ └── generator.cc │ └── parser │ │ ├── item.cc │ │ └── error.cc │ ├── .gitignore │ ├── googletest │ ├── xcode │ │ ├── Config │ │ │ ├── TestTarget.xcconfig │ │ │ ├── FrameworkTarget.xcconfig │ │ │ ├── StaticLibraryTarget.xcconfig │ │ │ ├── DebugProject.xcconfig │ │ │ ├── ReleaseProject.xcconfig │ │ │ └── General.xcconfig │ │ ├── Samples │ │ │ └── FrameworkSample │ │ │ │ ├── Info.plist │ │ │ │ ├── widget.h │ │ │ │ ├── widget.cc │ │ │ │ ├── runtests.sh │ │ │ │ └── widget_test.cc │ │ ├── Resources │ │ │ └── Info.plist │ │ └── Scripts │ │ │ └── runtests.sh │ ├── m4 │ │ └── ltversion.m4 │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── test │ │ ├── production.cc │ │ ├── gtest_main_unittest.cc │ │ ├── gtest_uninitialized_test_.cc │ │ ├── gtest_xml_outfile1_test_.cc │ │ ├── gtest_xml_outfile2_test_.cc │ │ ├── gtest-typed-test2_test.cc │ │ ├── gtest_help_test_.cc │ │ ├── production.h │ │ ├── gtest_all_test.cc │ │ ├── gtest_prod_test.cc │ │ ├── gtest_sole_header_test.cc │ │ ├── gtest-param-test_test.h │ │ ├── gtest_no_test_unittest.cc │ │ ├── gtest-typed-test_test.h │ │ ├── gtest_uninitialized_test.py │ │ ├── gtest-param-test2_test.cc │ │ ├── gtest_color_test_.cc │ │ └── gtest_throw_on_failure_test_.cc │ ├── src │ │ ├── gtest_main.cc │ │ └── gtest-all.cc │ ├── fused-src │ │ └── gtest │ │ │ └── gtest_main.cc │ ├── codegear │ │ ├── gtest_all.cc │ │ ├── gtest_link.cc │ │ └── gtest.groupproj │ ├── scripts │ │ └── test │ │ │ └── Makefile │ ├── samples │ │ ├── sample4_unittest.cc │ │ ├── sample1.h │ │ ├── sample4.cc │ │ ├── sample4.h │ │ ├── sample2.cc │ │ ├── sample1.cc │ │ └── sample2.h │ ├── build-aux │ │ └── config.h.in │ ├── include │ │ └── gtest │ │ │ └── gtest_prod.h │ ├── msvc │ │ ├── gtest.sln │ │ └── gtest-md.sln │ ├── configure.ac │ └── make │ │ └── Makefile │ ├── include │ ├── parser │ │ ├── error.h │ │ └── item.h │ └── generator │ │ ├── row.h │ │ ├── subroutine.h │ │ └── generator.h │ ├── CMakeLists.txt │ └── test │ ├── combination_test.cc │ ├── generator_test.cc │ └── parser_test.cc ├── Resource ├── test │ ├── 0203.jpg │ ├── 0278.jpg │ ├── 1660.jpg │ ├── 1728.jpg │ ├── 2200.jpg │ ├── 2764.jpg │ ├── 3041.jpg │ ├── 3085.jpg │ ├── 3470.jpg │ ├── 4250.jpg │ ├── 4750.jpg │ ├── 5042.jpg │ ├── 6265.jpg │ ├── 6818.jpg │ ├── 6858.jpg │ ├── 7240.jpg │ ├── 7427.jpg │ ├── 8618.jpg │ ├── 8805.jpg │ ├── 8855.jpg │ └── README └── samples │ ├── 1036.jpg │ ├── 1352.jpg │ ├── 1422.jpg │ ├── 2057.jpg │ ├── 2117.jpg │ ├── 2138.jpg │ ├── 2483.jpg │ ├── 3281.jpg │ ├── 3515.jpg │ ├── 3542.jpg │ ├── 4140.jpg │ ├── 5228.jpg │ ├── 5485.jpg │ ├── 6156.jpg │ ├── 6447.jpg │ ├── 6527.jpg │ ├── 6612.jpg │ ├── 6833.jpg │ ├── 7402.jpg │ ├── 7678.jpg │ ├── 8632.jpg │ └── README ├── include ├── typedef.h ├── Decoder.h ├── Color.h ├── Study.h ├── Database.h ├── Jpeg.h ├── IImage.h ├── Bitmap.h └── Slice.h ├── src ├── IImage.cpp ├── Color.cpp ├── Study.cpp ├── Decoder.cpp ├── Database.cpp ├── Bitmap.cpp └── Slice.cpp ├── .gitignore ├── CMakeLists.txt ├── BOOST_LICENSE.txt └── README.md /vendor/jpeg-9a/libjpeg.map: -------------------------------------------------------------------------------- 1 | LIBJPEG_9.0 { 2 | global: 3 | *; 4 | }; 5 | -------------------------------------------------------------------------------- /Resource/test/0203.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/0203.jpg -------------------------------------------------------------------------------- /Resource/test/0278.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/0278.jpg -------------------------------------------------------------------------------- /Resource/test/1660.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/1660.jpg -------------------------------------------------------------------------------- /Resource/test/1728.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/1728.jpg -------------------------------------------------------------------------------- /Resource/test/2200.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/2200.jpg -------------------------------------------------------------------------------- /Resource/test/2764.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/2764.jpg -------------------------------------------------------------------------------- /Resource/test/3041.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/3041.jpg -------------------------------------------------------------------------------- /Resource/test/3085.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/3085.jpg -------------------------------------------------------------------------------- /Resource/test/3470.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/3470.jpg -------------------------------------------------------------------------------- /Resource/test/4250.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/4250.jpg -------------------------------------------------------------------------------- /Resource/test/4750.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/4750.jpg -------------------------------------------------------------------------------- /Resource/test/5042.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/5042.jpg -------------------------------------------------------------------------------- /Resource/test/6265.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/6265.jpg -------------------------------------------------------------------------------- /Resource/test/6818.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/6818.jpg -------------------------------------------------------------------------------- /Resource/test/6858.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/6858.jpg -------------------------------------------------------------------------------- /Resource/test/7240.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/7240.jpg -------------------------------------------------------------------------------- /Resource/test/7427.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/7427.jpg -------------------------------------------------------------------------------- /Resource/test/8618.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/8618.jpg -------------------------------------------------------------------------------- /Resource/test/8805.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/8805.jpg -------------------------------------------------------------------------------- /Resource/test/8855.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/test/8855.jpg -------------------------------------------------------------------------------- /Resource/samples/1036.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/1036.jpg -------------------------------------------------------------------------------- /Resource/samples/1352.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/1352.jpg -------------------------------------------------------------------------------- /Resource/samples/1422.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/1422.jpg -------------------------------------------------------------------------------- /Resource/samples/2057.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/2057.jpg -------------------------------------------------------------------------------- /Resource/samples/2117.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/2117.jpg -------------------------------------------------------------------------------- /Resource/samples/2138.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/2138.jpg -------------------------------------------------------------------------------- /Resource/samples/2483.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/2483.jpg -------------------------------------------------------------------------------- /Resource/samples/3281.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/3281.jpg -------------------------------------------------------------------------------- /Resource/samples/3515.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/3515.jpg -------------------------------------------------------------------------------- /Resource/samples/3542.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/3542.jpg -------------------------------------------------------------------------------- /Resource/samples/4140.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/4140.jpg -------------------------------------------------------------------------------- /Resource/samples/5228.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/5228.jpg -------------------------------------------------------------------------------- /Resource/samples/5485.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/5485.jpg -------------------------------------------------------------------------------- /Resource/samples/6156.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/6156.jpg -------------------------------------------------------------------------------- /Resource/samples/6447.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/6447.jpg -------------------------------------------------------------------------------- /Resource/samples/6527.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/6527.jpg -------------------------------------------------------------------------------- /Resource/samples/6612.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/6612.jpg -------------------------------------------------------------------------------- /Resource/samples/6833.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/6833.jpg -------------------------------------------------------------------------------- /Resource/samples/7402.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/7402.jpg -------------------------------------------------------------------------------- /Resource/samples/7678.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/7678.jpg -------------------------------------------------------------------------------- /Resource/samples/8632.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/Resource/samples/8632.jpg -------------------------------------------------------------------------------- /vendor/jpeg-9a/makeadsw.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makeadsw.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makeasln.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makeasln.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makecdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makecdep.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makecdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makecdsp.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makecfil.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makecfil.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makecmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makecmak.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makecvcx.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makecvcx.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makeddep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makeddep.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makeddsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makeddsp.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makedfil.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makedfil.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makedmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makedmak.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makedvcx.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makedvcx.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makejdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makejdep.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makejdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makejdsp.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makejdsw.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makejdsw.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makejfil.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makejfil.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makejmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makejmak.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makejsln.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makejsln.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makejvcx.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makejvcx.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makerdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makerdep.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makerdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makerdsp.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makerfil.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makerfil.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makermak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makermak.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makervcx.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makervcx.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/maketdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/maketdep.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/maketdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/maketdsp.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/maketfil.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/maketfil.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/maketmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/maketmak.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/maketvcx.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/maketvcx.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makewdep.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makewdep.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makewdsp.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makewdsp.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makewfil.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makewfil.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makewmak.vc6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makewmak.vc6 -------------------------------------------------------------------------------- /vendor/jpeg-9a/makewvcx.v10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/makewvcx.v10 -------------------------------------------------------------------------------- /vendor/jpeg-9a/testimg.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/testimg.bmp -------------------------------------------------------------------------------- /vendor/jpeg-9a/testimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/testimg.jpg -------------------------------------------------------------------------------- /vendor/jpeg-9a/testimg.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/testimg.ppm -------------------------------------------------------------------------------- /vendor/jpeg-9a/testimgp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/testimgp.jpg -------------------------------------------------------------------------------- /vendor/jpeg-9a/testorig.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/testorig.jpg -------------------------------------------------------------------------------- /vendor/jpeg-9a/testprog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooz/antivcode/HEAD/vendor/jpeg-9a/testprog.jpg -------------------------------------------------------------------------------- /vendor/ProgramOptions/src/generator/row.cc: -------------------------------------------------------------------------------- 1 | #include "generator/row.h" 2 | 3 | namespace program_options { 4 | Row::Row() : require_value(true) {} 5 | } -------------------------------------------------------------------------------- /Resource/test/README: -------------------------------------------------------------------------------- 1 | 1. add test jpgs here and name it with right words 2 | 2. execute command "decode -t -d Resource/test" 3 | 3. get the recognition rate and time consuming 4 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/src/parser/item.cc: -------------------------------------------------------------------------------- 1 | #include "parser/item.h" 2 | 3 | namespace program_options { 4 | 5 | ParseItem::ParseItem(const std::string& value) 6 | : value_(value) { } 7 | 8 | } -------------------------------------------------------------------------------- /include/typedef.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | typedef unsigned char byte; 7 | 8 | #if defined (WIN32) || (_WIN32) 9 | #pragma warning(disable:4996) 10 | #endif 11 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/makvms.opt: -------------------------------------------------------------------------------- 1 | ! A pointer to the VAX/VMS C Run-Time Shareable Library. 2 | ! This file is needed by makefile.mms and makefile.vms, 3 | ! but only for the older VAX C compiler. DEC C does not need it. 4 | Sys$Library:VAXCRTL.EXE /Share 5 | -------------------------------------------------------------------------------- /Resource/samples/README: -------------------------------------------------------------------------------- 1 | 1. add sample jpgs file in this folder and name each right words 2 | 2. excute command "decode -syn -d Resource/samples" 3 | 3. wait for auto generating a new sample database, to save database in a specified position,please set -b where/dbname 4 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/.gitignore: -------------------------------------------------------------------------------- 1 | # CLion 2 | .idea/ 3 | 4 | # binary 5 | bin/ 6 | 7 | # cmake 8 | CMakeFiles/ 9 | CMakeScripts/ 10 | CMakeCache.txt 11 | *.user 12 | 13 | # Xcode 14 | Debug/ 15 | Release/ 16 | .build/ 17 | *.xcodeproj 18 | 19 | # gtest 20 | Testing/ -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /include/Decoder.h: -------------------------------------------------------------------------------- 1 | #ifndef _DECODER_H_ 2 | #define _DECODER_H_ 3 | 4 | #include 5 | #include 6 | 7 | class Database; 8 | 9 | typedef std::vector CharSet; 10 | 11 | class Decoder { 12 | public: 13 | Decoder(const std::string& db); 14 | 15 | ~Decoder(); 16 | 17 | CharSet decode(const std::string& file); 18 | 19 | private: 20 | Database* _db; 21 | }; 22 | 23 | #endif //_DECODER_H_ 24 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/src/parser/error.cc: -------------------------------------------------------------------------------- 1 | #include "parser/error.h" 2 | 3 | namespace program_options { 4 | 5 | ParseError::ParseError(const std::string& msg) : _msg(msg) {} 6 | 7 | const char* ParseError::what() const throw() { 8 | std::string msg; 9 | msg.append("Command line parse error: ").append(_msg).push_back('.'); 10 | return msg.c_str(); 11 | } 12 | 13 | ParseError::~ParseError() throw() {} 14 | 15 | } 16 | -------------------------------------------------------------------------------- /include/Color.h: -------------------------------------------------------------------------------- 1 | #ifndef _COLOR_H_ 2 | #define _COLOR_H_ 3 | 4 | #include "typedef.h" 5 | 6 | class Color { 7 | public: 8 | Color(byte r, byte g, byte b); 9 | 10 | //getter 11 | byte r() const; 12 | 13 | byte g() const; 14 | 15 | byte b() const; 16 | 17 | //setter 18 | void setRgb(byte r, byte g, byte b); 19 | 20 | bool operator>(const int& hex); 21 | 22 | private: 23 | byte _r, _g, _b; 24 | }; 25 | 26 | #endif //_COLOR_H_ -------------------------------------------------------------------------------- /vendor/jpeg-9a/jversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jversion.h 3 | * 4 | * Copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains software version identification. 9 | */ 10 | 11 | 12 | #define JVERSION "9a 19-Jan-2014" 13 | 14 | #define JCOPYRIGHT "Copyright (C) 2014, Thomas G. Lane, Guido Vollbeding" 15 | -------------------------------------------------------------------------------- /include/Study.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef _STUDY_H_ 3 | #define _STUDY_H_ 4 | 5 | #include 6 | #include 7 | 8 | class Slice; 9 | 10 | class Database; 11 | 12 | //to auto generate attribute code & save into file. 13 | class Study { 14 | public: 15 | Study(const std::string& dbpath); 16 | 17 | ~Study(); 18 | 19 | void confirm(std::shared_ptr slice, char symbol); 20 | 21 | void finish(); 22 | 23 | private: 24 | Database* _db; 25 | }; 26 | 27 | #endif //_STUDY_H_ 28 | -------------------------------------------------------------------------------- /src/IImage.cpp: -------------------------------------------------------------------------------- 1 | #include "IImage.h" 2 | 3 | 4 | IImage::IImage() 5 | : 6 | _data(nullptr), _lattice(nullptr) { 7 | } 8 | 9 | bool* 10 | IImage::getLattice() const { 11 | return _lattice; 12 | } 13 | 14 | byte* 15 | IImage::getData() const { 16 | return _data; 17 | } 18 | 19 | IImage::~IImage() { 20 | if (_data != nullptr) { 21 | delete[] _data; 22 | _data = nullptr; 23 | } 24 | if (_lattice != nullptr) { 25 | delete[] _lattice; 26 | _lattice = nullptr; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Color.cpp: -------------------------------------------------------------------------------- 1 | #include "Color.h" 2 | 3 | Color::Color(byte r, byte g, byte b) 4 | : 5 | _r(r), _g(g), _b(b) { 6 | } 7 | 8 | byte Color::r() const { 9 | return _r; 10 | } 11 | 12 | byte Color::g() const { 13 | return _g; 14 | } 15 | 16 | byte Color::b() const { 17 | return _b; 18 | } 19 | 20 | void Color::setRgb(byte r, byte g, byte b) { 21 | _r = r; 22 | _g = g; 23 | _b = b; 24 | } 25 | 26 | bool Color::operator>(const int& hex) { 27 | return (_r << 16 | _g << 8 | _b) > hex; 28 | } 29 | -------------------------------------------------------------------------------- /include/Database.h: -------------------------------------------------------------------------------- 1 | #ifndef _DATABASE_H_ 2 | #define _DATABASE_H_ 3 | 4 | #include 5 | #include 6 | #include "IImage.h" 7 | #include "Slice.h" 8 | 9 | //provide attribute code storage algorithm. 10 | class Database { 11 | public: 12 | Database(const std::string& root, const std::string& dbname); 13 | 14 | ~Database(); 15 | 16 | void add(std::shared_ptr slice); 17 | 18 | void save(); 19 | 20 | SliceCollection* load(); 21 | 22 | private: 23 | SliceCollection* _collection; 24 | std::string _dbname; 25 | std::string _root; 26 | }; 27 | 28 | #endif //_DATABASE_H_ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | Debug/ 3 | Release/ 4 | CMakeFiles/ 5 | .idea/ 6 | *.suo 7 | *.sdf 8 | *.opensdf 9 | *.diagsession 10 | *.vspx 11 | *.a 12 | 13 | # auto generated files in jpeg folder 14 | vendor/jpeg-9a/.deps/ 15 | vendor/jpeg-9a/.libs/ 16 | vendor/jpeg-9a/config.log 17 | vendor/jpeg-9a/config.status 18 | vendor/jpeg-9a/jconfig.h 19 | vendor/jpeg-9a/libtool 20 | vendor/jpeg-9a/Makefile 21 | vendor/jpeg-9a/stamp-h1 22 | vendor/jpeg-9a/*.o 23 | vendor/jpeg-9a/*.lo 24 | vendor/jpeg-9a/cjpeg 25 | vendor/jpeg-9a/djpeg 26 | vendor/jpeg-9a/jpegtran 27 | vendor/jpeg-9a/libjpeg.la 28 | vendor/jpeg-9a/rdjpgcom 29 | vendor/jpeg-9a/wrjpgcom 30 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/include/parser/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * parser error 3 | * (c) Copyright 2015 Micooz 4 | * 5 | * Released under the Apache License. 6 | * See the LICENSE file or 7 | * http://www.apache.org/licenses/LICENSE-2.0.txt for more information. 8 | */ 9 | #ifndef PARSER_ERROR_H_ 10 | #define PARSER_ERROR_H_ 11 | 12 | #include 13 | 14 | namespace program_options { 15 | 16 | class ParseError : public std::exception { 17 | public: 18 | explicit ParseError(const std::string& msg); 19 | 20 | const char* what() const throw(); 21 | 22 | ~ParseError() throw(); 23 | 24 | private: 25 | std::string _msg; 26 | }; 27 | 28 | } 29 | 30 | #endif // PARSER_ERROR_H_ -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.4) 2 | project(antivcode) 3 | 4 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 5 | 6 | include_directories(include) 7 | include_directories(vendor/ProgramOptions/include) 8 | include_directories(vendor/jpeg-9a) 9 | 10 | aux_source_directory(src SOURCE_FILES) 11 | add_subdirectory(vendor/ProgramOptions) 12 | 13 | find_package(Boost COMPONENTS filesystem system REQUIRED) 14 | find_library(JPEG_LIBRARY 15 | NAMES jpeg 16 | HINTS "vendor/jpeg-9a/.libs" 17 | ) 18 | 19 | add_executable(antivcode ${SOURCE_FILES}) 20 | target_link_libraries(antivcode 21 | program_options 22 | ${Boost_LIBRARIES} 23 | ${JPEG_LIBRARY} 24 | ) 25 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /src/Study.cpp: -------------------------------------------------------------------------------- 1 | #include "Study.h" 2 | #include "Database.h" 3 | 4 | Study::Study(const std::string& dbpath) 5 | : _db(nullptr) { 6 | 7 | std::string root; 8 | std::string dbname; 9 | 10 | if (dbpath.find('/')) { 11 | int pos = dbpath.find_last_of('/'); 12 | root = dbpath.substr(0, pos + 1); 13 | dbname = dbpath.substr(pos + 1); 14 | } else { 15 | root = "./"; 16 | } 17 | _db = new Database(root, dbname); 18 | } 19 | 20 | void Study::confirm(std::shared_ptr slice, char symbol) { 21 | slice->setSymbol(symbol); 22 | _db->add(slice); 23 | } 24 | 25 | void Study::finish() { 26 | _db->save(); 27 | } 28 | 29 | Study::~Study() { 30 | if (_db) { 31 | delete _db; 32 | _db = nullptr; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /include/Jpeg.h: -------------------------------------------------------------------------------- 1 | #ifndef _JPEG_H_ 2 | #define _JPEG_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "IImage.h" 8 | 9 | class Jpeg : 10 | public IImage { 11 | public: 12 | Jpeg(const std::string& file); 13 | 14 | ~Jpeg(); 15 | 16 | Color getPixel(const uint32_t x, const uint32_t y); 17 | 18 | void setPixel(const uint32_t x, const uint32_t y, const Color& color); 19 | 20 | void binaryZate(); 21 | 22 | void makeGray(); 23 | 24 | std::shared_ptr cut(); 25 | 26 | // AttributeCode getCode(); 27 | 28 | void saveTo(const std::string& file); 29 | 30 | uint32_t getWidth() const; 31 | 32 | uint32_t getHeight() const; 33 | 34 | private: 35 | FILE* _pf; 36 | jpeg_decompress_struct _info; 37 | jpeg_error_mgr _jerr; 38 | // byte* _raw; 39 | }; 40 | 41 | #endif //_JPEG_H_ -------------------------------------------------------------------------------- /vendor/ProgramOptions/include/parser/item.h: -------------------------------------------------------------------------------- 1 | /* 2 | * parser item 3 | * (c) Copyright 2015 Micooz 4 | * 5 | * Released under the Apache License. 6 | * See the LICENSE file or 7 | * http://www.apache.org/licenses/LICENSE-2.0.txt for more information. 8 | */ 9 | #ifndef PARSER_ITEM_H_ 10 | #define PARSER_ITEM_H_ 11 | 12 | #include 13 | 14 | namespace program_options { 15 | 16 | class ParseItem { 17 | public: 18 | ParseItem(const std::string& value); 19 | 20 | /* 21 | * dynamic type cast, support base data types including std::string 22 | */ 23 | template 24 | T as() { 25 | T r; 26 | std::stringstream buf; 27 | buf << value_; 28 | buf >> r; 29 | return r; 30 | } 31 | 32 | /* 33 | * alias of as() 34 | */ 35 | inline std::string val() const { return value_; } 36 | 37 | private: 38 | std::string value_; 39 | }; 40 | } 41 | 42 | #endif // PARSER_ITEM_H_ -------------------------------------------------------------------------------- /include/IImage.h: -------------------------------------------------------------------------------- 1 | #ifndef _IIMAGE_H_ 2 | #define _IIMAGE_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "Color.h" 8 | #include "Slice.h" 9 | 10 | typedef std::vector > SliceCollection; 11 | 12 | class IImage { 13 | public: 14 | IImage(); 15 | 16 | virtual ~IImage(); 17 | 18 | virtual Color getPixel(const uint32_t x, const uint32_t y) = 0; 19 | 20 | virtual void setPixel(const uint32_t x, const uint32_t y, 21 | const Color& color) = 0; 22 | 23 | virtual void binaryZate() = 0; 24 | 25 | virtual void makeGray() = 0; 26 | 27 | virtual std::shared_ptr cut() = 0; 28 | 29 | virtual void saveTo(const std::string& file) = 0; 30 | 31 | virtual uint32_t getWidth() const = 0; 32 | 33 | virtual uint32_t getHeight() const = 0; 34 | 35 | //getter 36 | bool* getLattice() const; 37 | 38 | byte* getData() const; 39 | 40 | protected: 41 | byte* _data; 42 | bool* _lattice; 43 | }; 44 | 45 | #endif //_IIMAGE_H_ -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.4) 2 | project(program_options) 3 | 4 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 5 | 6 | include_directories(include/) 7 | 8 | # library sources 9 | set(SOURCE_FILES 10 | src/parser/parser.cc 11 | src/parser/error.cc 12 | src/parser/item.cc 13 | src/generator/generator.cc 14 | src/generator/subroutine.cc 15 | src/generator/row.cc 16 | ) 17 | 18 | # create a static link library 19 | add_library(program_options STATIC ${SOURCE_FILES}) 20 | 21 | # gtest 22 | add_subdirectory(googletest) 23 | include_directories(googletest/include/) 24 | enable_testing() 25 | 26 | # create executables linked with libparser.a 27 | add_executable(parser_test test/parser_test.cc) 28 | add_executable(generator_test test/generator_test.cc) 29 | add_executable(combination_test test/combination_test.cc) 30 | 31 | target_link_libraries(parser_test program_options gtest) 32 | target_link_libraries(generator_test program_options gtest) 33 | target_link_libraries(combination_test program_options gtest) -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.vms: -------------------------------------------------------------------------------- 1 | /* jconfig.vms --- jconfig.h for use on Digital VMS. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #endif /* JPEG_INTERNALS */ 23 | 24 | #ifdef JPEG_CJPEG_DJPEG 25 | 26 | #define BMP_SUPPORTED /* BMP image file format */ 27 | #define GIF_SUPPORTED /* GIF image file format */ 28 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 29 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 30 | #define TARGA_SUPPORTED /* Targa image file format */ 31 | 32 | #define TWO_FILE_COMMANDLINE /* Needed on VMS */ 33 | #undef NEED_SIGNAL_CATCHER 34 | #undef DONT_USE_B_MODE 35 | #undef PROGRESS_REPORT /* optional */ 36 | 37 | #endif /* JPEG_CJPEG_DJPEG */ 38 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /include/Bitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef _BITMAP_H_ 2 | #define _BITMAP_H_ 3 | 4 | #include 5 | #include "typedef.h" 6 | 7 | #pragma pack(2) 8 | struct bmp_fileheader { 9 | unsigned short bfType; 10 | unsigned long bfSize; 11 | unsigned short bfReverved1; 12 | unsigned short bfReverved2; 13 | unsigned long bfOffBits; 14 | }; 15 | #pragma pack() 16 | 17 | struct bmp_infoheader { 18 | unsigned long biSize; 19 | unsigned long biWidth; 20 | unsigned long biHeight; 21 | unsigned short biPlanes; 22 | unsigned short biBitCount; 23 | unsigned long biCompression; 24 | unsigned long biSizeImage; 25 | unsigned long biXPelsPerMeter; 26 | unsigned long biYpelsPerMeter; 27 | unsigned long biClrUsed; 28 | unsigned long biClrImportant; 29 | }; 30 | 31 | class Bitmap { 32 | public: 33 | Bitmap(); 34 | 35 | ~Bitmap(); 36 | 37 | void save(const std::string& file, byte* data, 38 | unsigned long width, unsigned long height, uint16_t depth); 39 | 40 | private: 41 | void write_bmp_header(); 42 | 43 | void write_bmp_data(); 44 | 45 | FILE* _pFile; 46 | byte* _data; 47 | unsigned long _width; 48 | unsigned long _height; 49 | uint16_t _depth; 50 | }; 51 | 52 | #endif // _BITMAP_H_ -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.wat: -------------------------------------------------------------------------------- 1 | /* jconfig.wat --- jconfig.h for Watcom C/C++ on MS-DOS or OS/2. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #define CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* Watcom uses flat 32-bit addressing */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #endif /* JPEG_INTERNALS */ 23 | 24 | #ifdef JPEG_CJPEG_DJPEG 25 | 26 | #define BMP_SUPPORTED /* BMP image file format */ 27 | #define GIF_SUPPORTED /* GIF image file format */ 28 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 29 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 30 | #define TARGA_SUPPORTED /* Targa image file format */ 31 | 32 | #undef TWO_FILE_COMMANDLINE /* optional */ 33 | #define USE_SETMODE /* Needed to make one-file style work in Watcom */ 34 | #undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */ 35 | #undef DONT_USE_B_MODE 36 | #undef PROGRESS_REPORT /* optional */ 37 | 38 | #endif /* JPEG_CJPEG_DJPEG */ 39 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.dj: -------------------------------------------------------------------------------- 1 | /* jconfig.dj --- jconfig.h for DJGPP (Delorie's GNU C port) on MS-DOS. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* DJGPP uses flat 32-bit addressing */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #endif /* JPEG_INTERNALS */ 23 | 24 | #ifdef JPEG_CJPEG_DJPEG 25 | 26 | #define BMP_SUPPORTED /* BMP image file format */ 27 | #define GIF_SUPPORTED /* GIF image file format */ 28 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 29 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 30 | #define TARGA_SUPPORTED /* Targa image file format */ 31 | 32 | #undef TWO_FILE_COMMANDLINE /* optional */ 33 | #define USE_SETMODE /* Needed to make one-file style work in DJGPP */ 34 | #undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */ 35 | #undef DONT_USE_B_MODE 36 | #undef PROGRESS_REPORT /* optional */ 37 | 38 | #endif /* JPEG_CJPEG_DJPEG */ 39 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.sas: -------------------------------------------------------------------------------- 1 | /* jconfig.sas --- jconfig.h for Amiga systems using SAS C 6.0 and up. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */ 23 | 24 | #define NO_MKTEMP /* SAS C doesn't have mktemp() */ 25 | 26 | #define SHORTxSHORT_32 /* produces better DCT code with SAS C */ 27 | 28 | #endif /* JPEG_INTERNALS */ 29 | 30 | #ifdef JPEG_CJPEG_DJPEG 31 | 32 | #define BMP_SUPPORTED /* BMP image file format */ 33 | #define GIF_SUPPORTED /* GIF image file format */ 34 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 35 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 36 | #define TARGA_SUPPORTED /* Targa image file format */ 37 | 38 | #define TWO_FILE_COMMANDLINE 39 | #define NEED_SIGNAL_CATCHER 40 | #undef DONT_USE_B_MODE 41 | #undef PROGRESS_REPORT /* optional */ 42 | 43 | #endif /* JPEG_CJPEG_DJPEG */ 44 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/maktjpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. 5 | ; 6 | ; To use this file, rename it to jpegtran.prj. 7 | ; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." 8 | ; Read installation instructions before trying to make the program! 9 | ; 10 | ; 11 | ; * * * Output file * * * 12 | jpegtran.ttp 13 | ; 14 | ; * * * COMPILER OPTIONS * * * 15 | .C[-P] ; absolute calls 16 | .C[-M] ; and no string merging, folks 17 | .C[-w-cln] ; no "constant is long" warnings 18 | .C[-w-par] ; no "parameter xxxx unused" 19 | .C[-w-rch] ; no "unreachable code" 20 | .C[-wsig] ; warn if significant digits may be lost 21 | = 22 | ; * * * * List of modules * * * * 23 | pcstart.o 24 | jpegtran.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,transupp.h,jversion.h) 25 | cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 26 | rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 27 | transupp.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,transupp.h) 28 | libjpeg.lib ; built by libjpeg.prj 29 | pcstdlib.lib ; standard library 30 | pcextlib.lib ; extended library 31 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.mac: -------------------------------------------------------------------------------- 1 | /* jconfig.mac --- jconfig.h for CodeWarrior on Apple Macintosh */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define USE_MAC_MEMMGR /* Define this if you use jmemmac.c */ 23 | 24 | #define ALIGN_TYPE long /* Needed for 680x0 Macs */ 25 | 26 | #endif /* JPEG_INTERNALS */ 27 | 28 | #ifdef JPEG_CJPEG_DJPEG 29 | 30 | #define BMP_SUPPORTED /* BMP image file format */ 31 | #define GIF_SUPPORTED /* GIF image file format */ 32 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 33 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 34 | #define TARGA_SUPPORTED /* Targa image file format */ 35 | 36 | #define USE_CCOMMAND /* Command line reader for Macintosh */ 37 | #define TWO_FILE_COMMANDLINE /* Binary I/O thru stdin/stdout doesn't work */ 38 | 39 | #undef NEED_SIGNAL_CATCHER 40 | #undef DONT_USE_B_MODE 41 | #undef PROGRESS_REPORT /* optional */ 42 | 43 | #endif /* JPEG_CJPEG_DJPEG */ 44 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.manx: -------------------------------------------------------------------------------- 1 | /* jconfig.manx --- jconfig.h for Amiga systems using Manx Aztec C ver 5.x. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */ 23 | 24 | #define SHORTxSHORT_32 /* produces better DCT code with Aztec C */ 25 | 26 | #endif /* JPEG_INTERNALS */ 27 | 28 | #ifdef JPEG_CJPEG_DJPEG 29 | 30 | #define BMP_SUPPORTED /* BMP image file format */ 31 | #define GIF_SUPPORTED /* GIF image file format */ 32 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 33 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 34 | #define TARGA_SUPPORTED /* Targa image file format */ 35 | 36 | #define TWO_FILE_COMMANDLINE 37 | #define NEED_SIGNAL_CATCHER 38 | #undef DONT_USE_B_MODE 39 | #undef PROGRESS_REPORT /* optional */ 40 | 41 | #define signal_catcher _abort /* hack for Aztec C naming requirements */ 42 | 43 | #endif /* JPEG_CJPEG_DJPEG */ 44 | -------------------------------------------------------------------------------- /include/Slice.h: -------------------------------------------------------------------------------- 1 | #ifndef _SLICE_H_ 2 | #define _SLICE_H_ 3 | 4 | #include 5 | #include 6 | #include "typedef.h" 7 | 8 | class IImage; 9 | 10 | typedef std::vector AttributeCode; 11 | 12 | class Slice { 13 | public: 14 | Slice(); 15 | 16 | Slice(IImage* base, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2); 17 | 18 | //, bool copied = false); 19 | Slice(const Slice& slice); 20 | 21 | ~Slice(); 22 | 23 | //getter 24 | uint32_t getX1() const; 25 | 26 | uint32_t getX2() const; 27 | 28 | uint32_t getY1() const; 29 | 30 | uint32_t getY2() const; 31 | 32 | uint32_t getWidth() const; 33 | 34 | uint32_t getHeight() const; 35 | 36 | char getSymbol() const; 37 | 38 | //setter 39 | void setCode(const AttributeCode& code); 40 | 41 | void setSymbol(char symbol); 42 | 43 | //[Bug]save the slice as bmp file 44 | void save(const std::string& file); 45 | 46 | //return an attribute code 47 | AttributeCode getCode() const; 48 | 49 | //compare similar rate with another slice, relative to parameter [slice] 50 | float similarTo(Slice& slice); 51 | 52 | //output AttributeCode as a string 53 | friend std::ostream& operator<<(std::ostream& out, const AttributeCode& code); 54 | 55 | private: 56 | AttributeCode _code; 57 | uint32_t _x1, _x2; 58 | uint32_t _y1, _y2; 59 | byte* _data; 60 | char _symbol; 61 | }; 62 | 63 | #endif //_SLICE_H_ 64 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /BOOST_LICENSE.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/rdgif.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rdgif.c 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains routines to read input images in GIF format. 9 | * 10 | ***************************************************************************** 11 | * NOTE: to avoid entanglements with Unisys' patent on LZW compression, * 12 | * the ability to read GIF files has been removed from the IJG distribution. * 13 | * Sorry about that. * 14 | ***************************************************************************** 15 | * 16 | * We are required to state that 17 | * "The Graphics Interchange Format(c) is the Copyright property of 18 | * CompuServe Incorporated. GIF(sm) is a Service Mark property of 19 | * CompuServe Incorporated." 20 | */ 21 | 22 | #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ 23 | 24 | #ifdef GIF_SUPPORTED 25 | 26 | /* 27 | * The module selection routine for GIF format input. 28 | */ 29 | 30 | GLOBAL(cjpeg_source_ptr) 31 | jinit_read_gif (j_compress_ptr cinfo) 32 | { 33 | fprintf(stderr, "GIF input is unsupported for legal reasons. Sorry.\n"); 34 | exit(EXIT_FAILURE); 35 | return NULL; /* keep compiler happy */ 36 | } 37 | 38 | #endif /* GIF_SUPPORTED */ 39 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.st: -------------------------------------------------------------------------------- 1 | /* jconfig.st --- jconfig.h for Atari ST/STE/TT using Pure C or Turbo C. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #define INCOMPLETE_TYPES_BROKEN /* suppress undefined-structure warnings */ 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define ALIGN_TYPE long /* apparently double is a weird size? */ 23 | 24 | #endif /* JPEG_INTERNALS */ 25 | 26 | #ifdef JPEG_CJPEG_DJPEG 27 | 28 | #define BMP_SUPPORTED /* BMP image file format */ 29 | #define GIF_SUPPORTED /* GIF image file format */ 30 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 31 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 32 | #define TARGA_SUPPORTED /* Targa image file format */ 33 | 34 | #define TWO_FILE_COMMANDLINE /* optional -- undef if you like Unix style */ 35 | /* Note: if you undef TWO_FILE_COMMANDLINE, you may need to define 36 | * USE_SETMODE. Some Atari compilers require it, some do not. 37 | */ 38 | #define NEED_SIGNAL_CATCHER /* needed if you use jmemname.c */ 39 | #undef DONT_USE_B_MODE 40 | #undef PROGRESS_REPORT /* optional */ 41 | 42 | #endif /* JPEG_CJPEG_DJPEG */ 43 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/include/generator/row.h: -------------------------------------------------------------------------------- 1 | /* 2 | * row 3 | * (c) Copyright 2015 Micooz 4 | * 5 | * Released under the Apache License. 6 | * See the LICENSE file or 7 | * http://www.apache.org/licenses/LICENSE-2.0.txt for more information. 8 | */ 9 | #ifndef GENERATOR_ROW_H_ 10 | #define GENERATOR_ROW_H_ 11 | 12 | #include 13 | 14 | namespace program_options { 15 | class Row { 16 | public: 17 | Row(); 18 | 19 | enum Field { kShort, kLong, kDefault, kDescription }; 20 | 21 | typedef std::initializer_list Order; 22 | 23 | // getter 24 | 25 | inline std::string oshort() const { return option_short; } 26 | 27 | inline std::string olong() const { return option_long; } 28 | 29 | inline std::string value() const { return default_value; } 30 | 31 | inline std::string desc() const { return description; } 32 | 33 | inline bool required() const { return require_value; } 34 | 35 | // setter 36 | 37 | inline void oshort(const std::string& oshort) { option_short = oshort; } 38 | 39 | inline void olong(const std::string& olong) { option_long = olong; } 40 | 41 | inline void value(const std::string& value) { default_value = value; } 42 | 43 | inline void desc(const std::string& desc) { description = desc; } 44 | 45 | inline void required(bool required) { require_value = required; } 46 | 47 | private: 48 | bool require_value; 49 | std::string option_short; 50 | std::string option_long; 51 | std::string default_value; 52 | std::string description; 53 | }; 54 | } 55 | 56 | #endif // GENERATOR_ROW_H_ -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/LICENSE: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.bcc: -------------------------------------------------------------------------------- 1 | /* jconfig.bcc --- jconfig.h for Borland C (Turbo C) on MS-DOS or OS/2. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #ifdef __MSDOS__ 15 | #define NEED_FAR_POINTERS /* for small or medium memory model */ 16 | #endif 17 | #undef NEED_SHORT_EXTERNAL_NAMES 18 | #undef INCOMPLETE_TYPES_BROKEN /* this assumes you have -w-stu in CFLAGS */ 19 | 20 | #ifdef JPEG_INTERNALS 21 | 22 | #undef RIGHT_SHIFT_IS_UNSIGNED 23 | 24 | #ifdef __MSDOS__ 25 | #define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */ 26 | #define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */ 27 | #define USE_FMEM /* Borland has _fmemcpy() and _fmemset() */ 28 | #endif 29 | 30 | #endif /* JPEG_INTERNALS */ 31 | 32 | #ifdef JPEG_CJPEG_DJPEG 33 | 34 | #define BMP_SUPPORTED /* BMP image file format */ 35 | #define GIF_SUPPORTED /* GIF image file format */ 36 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 37 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 38 | #define TARGA_SUPPORTED /* Targa image file format */ 39 | 40 | #define TWO_FILE_COMMANDLINE 41 | #define USE_SETMODE /* Borland has setmode() */ 42 | #ifdef __MSDOS__ 43 | #define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */ 44 | #endif 45 | #undef DONT_USE_B_MODE 46 | #undef PROGRESS_REPORT /* optional */ 47 | 48 | #endif /* JPEG_CJPEG_DJPEG */ 49 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/test/combination_test.cc: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "generator/generator.h" 3 | #include "parser/parser.h" 4 | 5 | using namespace program_options; 6 | 7 | TEST(TestConbination, combination){ 8 | Generator gen; 9 | gen.make_usage("Usage:") 10 | .add_subroutine("make") 11 | ("h,help", "show this information") 12 | ("a,alpha", "0", "alpha") 13 | ("r,", "255", "color red") 14 | ("g,green", "color green") 15 | (",blue", "1", "color blue"); 16 | EXPECT_STREQ(gen("make").to_string().c_str(), " -h [ --help ] show this information\n -a [ --alpha ] arg = 0 alpha\n -r arg = 255 color red\n -g [ --green ] color green\n --blue arg = 1 color blue\n"); 17 | 18 | gen.add_subroutine("create").make_template("-% --% %", 19 | {Row::kShort, Row::kLong, Row::kDescription}) 20 | ("h,help", "show this information") 21 | ("n,name", "", "name you want to create"); 22 | EXPECT_STREQ(gen("create").to_string().c_str(), "-h --help show this information\n-n --name name you want to create\n"); 23 | 24 | Parser* parser = gen.make_parser(); 25 | parser->parse("path/to/this make -h -ra 10 --green=0"); 26 | 27 | EXPECT_STREQ(parser->get_subroutine_name().c_str(), "make"); 28 | EXPECT_TRUE(parser->has("a")); 29 | EXPECT_TRUE(parser->has("green")); 30 | EXPECT_EQ(parser->has("a"), parser->has("alpha")); 31 | EXPECT_EQ(parser->get("a")->as(), 10); 32 | EXPECT_EQ(parser->get("blue")->as(), 1); 33 | } 34 | 35 | int main(int argc, char* argv[]) { 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.vc: -------------------------------------------------------------------------------- 1 | /* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | /* Define "boolean" as unsigned char, not enum, per Windows custom */ 19 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 20 | typedef unsigned char boolean; 21 | #endif 22 | #ifndef FALSE /* in case these macros already exist */ 23 | #define FALSE 0 /* values of boolean */ 24 | #endif 25 | #ifndef TRUE 26 | #define TRUE 1 27 | #endif 28 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 29 | 30 | 31 | #ifdef JPEG_INTERNALS 32 | 33 | #undef RIGHT_SHIFT_IS_UNSIGNED 34 | 35 | #endif /* JPEG_INTERNALS */ 36 | 37 | #ifdef JPEG_CJPEG_DJPEG 38 | 39 | #define BMP_SUPPORTED /* BMP image file format */ 40 | #define GIF_SUPPORTED /* GIF image file format */ 41 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 42 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 43 | #define TARGA_SUPPORTED /* Targa image file format */ 44 | 45 | #define TWO_FILE_COMMANDLINE /* optional */ 46 | #define USE_SETMODE /* Microsoft has setmode() */ 47 | #undef NEED_SIGNAL_CATCHER 48 | #undef DONT_USE_B_MODE 49 | #undef PROGRESS_REPORT /* optional */ 50 | 51 | #endif /* JPEG_CJPEG_DJPEG */ 52 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/makcjpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. 5 | ; 6 | ; To use this file, rename it to cjpeg.prj. 7 | ; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." 8 | ; Read installation instructions before trying to make the program! 9 | ; 10 | ; 11 | ; * * * Output file * * * 12 | cjpeg.ttp 13 | ; 14 | ; * * * COMPILER OPTIONS * * * 15 | .C[-P] ; absolute calls 16 | .C[-M] ; and no string merging, folks 17 | .C[-w-cln] ; no "constant is long" warnings 18 | .C[-w-par] ; no "parameter xxxx unused" 19 | .C[-w-rch] ; no "unreachable code" 20 | .C[-wsig] ; warn if significant digits may be lost 21 | = 22 | ; * * * * List of modules * * * * 23 | pcstart.o 24 | cjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h) 25 | cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 26 | rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 27 | rdppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 28 | rdgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 29 | rdtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 30 | rdbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 31 | rdrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 32 | libjpeg.lib ; built by libjpeg.prj 33 | pcfltlib.lib ; floating point library 34 | ; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED 35 | pcstdlib.lib ; standard library 36 | pcextlib.lib ; extended library 37 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/makdjpeg.st: -------------------------------------------------------------------------------- 1 | ; Project file for Independent JPEG Group's software 2 | ; 3 | ; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. 4 | ; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. 5 | ; 6 | ; To use this file, rename it to djpeg.prj. 7 | ; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." 8 | ; Read installation instructions before trying to make the program! 9 | ; 10 | ; 11 | ; * * * Output file * * * 12 | djpeg.ttp 13 | ; 14 | ; * * * COMPILER OPTIONS * * * 15 | .C[-P] ; absolute calls 16 | .C[-M] ; and no string merging, folks 17 | .C[-w-cln] ; no "constant is long" warnings 18 | .C[-w-par] ; no "parameter xxxx unused" 19 | .C[-w-rch] ; no "unreachable code" 20 | .C[-wsig] ; warn if significant digits may be lost 21 | = 22 | ; * * * * List of modules * * * * 23 | pcstart.o 24 | djpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h) 25 | cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 26 | rdcolmap.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 27 | wrppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 28 | wrgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 29 | wrtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 30 | wrbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 31 | wrrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) 32 | libjpeg.lib ; built by libjpeg.prj 33 | pcfltlib.lib ; floating point library 34 | ; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED 35 | pcstdlib.lib ; standard library 36 | pcextlib.lib ; extended library 37 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.cfg: -------------------------------------------------------------------------------- 1 | /* jconfig.cfg --- source file edited by configure script */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #undef HAVE_PROTOTYPES 5 | #undef HAVE_UNSIGNED_CHAR 6 | #undef HAVE_UNSIGNED_SHORT 7 | #undef void 8 | #undef const 9 | #undef CHAR_IS_UNSIGNED 10 | #undef HAVE_STDDEF_H 11 | #undef HAVE_STDLIB_H 12 | #undef HAVE_LOCALE_H 13 | #undef NEED_BSD_STRINGS 14 | #undef NEED_SYS_TYPES_H 15 | #undef NEED_FAR_POINTERS 16 | #undef NEED_SHORT_EXTERNAL_NAMES 17 | /* Define this if you get warnings about undefined structures. */ 18 | #undef INCOMPLETE_TYPES_BROKEN 19 | 20 | /* Define "boolean" as unsigned char, not enum, on Windows systems. */ 21 | #ifdef _WIN32 22 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 23 | typedef unsigned char boolean; 24 | #endif 25 | #ifndef FALSE /* in case these macros already exist */ 26 | #define FALSE 0 /* values of boolean */ 27 | #endif 28 | #ifndef TRUE 29 | #define TRUE 1 30 | #endif 31 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 32 | #endif 33 | 34 | #ifdef JPEG_INTERNALS 35 | 36 | #undef RIGHT_SHIFT_IS_UNSIGNED 37 | #undef INLINE 38 | /* These are for configuring the JPEG memory manager. */ 39 | #undef DEFAULT_MAX_MEM 40 | #undef NO_MKTEMP 41 | 42 | #endif /* JPEG_INTERNALS */ 43 | 44 | #ifdef JPEG_CJPEG_DJPEG 45 | 46 | #define BMP_SUPPORTED /* BMP image file format */ 47 | #define GIF_SUPPORTED /* GIF image file format */ 48 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 49 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 50 | #define TARGA_SUPPORTED /* Targa image file format */ 51 | 52 | #undef TWO_FILE_COMMANDLINE 53 | #undef NEED_SIGNAL_CATCHER 54 | #undef DONT_USE_B_MODE 55 | 56 | /* Define this if you want percent-done progress reports from cjpeg/djpeg. */ 57 | #undef PROGRESS_REPORT 58 | 59 | #endif /* JPEG_CJPEG_DJPEG */ 60 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jconfig.mc6: -------------------------------------------------------------------------------- 1 | /* jconfig.mc6 --- jconfig.h for Microsoft C on MS-DOS, version 6.00A & up. */ 2 | /* see jconfig.txt for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #define NEED_FAR_POINTERS /* for small or medium memory model */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #ifdef JPEG_INTERNALS 19 | 20 | #undef RIGHT_SHIFT_IS_UNSIGNED 21 | 22 | #define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */ 23 | 24 | #define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */ 25 | 26 | #define USE_FMEM /* Microsoft has _fmemcpy() and _fmemset() */ 27 | 28 | #define NEED_FHEAPMIN /* far heap management routines are broken */ 29 | 30 | #define SHORTxLCONST_32 /* enable compiler-specific DCT optimization */ 31 | /* Note: the above define is known to improve the code with Microsoft C 6.00A. 32 | * I do not know whether it is good for later compiler versions. 33 | * Please report any info on this point to jpeg-info@jpegclub.org. 34 | */ 35 | 36 | #endif /* JPEG_INTERNALS */ 37 | 38 | #ifdef JPEG_CJPEG_DJPEG 39 | 40 | #define BMP_SUPPORTED /* BMP image file format */ 41 | #define GIF_SUPPORTED /* GIF image file format */ 42 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 43 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 44 | #define TARGA_SUPPORTED /* Targa image file format */ 45 | 46 | #define TWO_FILE_COMMANDLINE 47 | #define USE_SETMODE /* Microsoft has setmode() */ 48 | #define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */ 49 | #undef DONT_USE_B_MODE 50 | #undef PROGRESS_REPORT /* optional */ 51 | 52 | #endif /* JPEG_CJPEG_DJPEG */ 53 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Antivcode 2 | 3 | An identification code validation procedures implement by C++ with boost and libjpeg. 4 | 5 | Note: For **personal use** at present. 6 | 7 | ## Dependence 8 | 9 | * jpeglib v9(**included** in the project) http://www.ijg.org/files/ 10 | 11 | ## Compile 12 | 13 | CMake building system makes it very easy to compile and run, The simplest way is use the default option of cmake: 14 | 15 | ```bash 16 | cmake ./ 17 | make 18 | ./antivcode -h 19 | ``` 20 | 21 | # Usage 22 | 23 | First you should let the program study and generate attribute code database. 24 | 25 | To get help information: 26 | 27 | ``` 28 | >> antivcode -h 29 | Or 30 | >> antivcode --help 31 | ``` 32 | 33 | To study by filenames from ./folder and create a new database named "db" in ./database: 34 | 35 | ``` 36 | >> antivcode -syn -d ./folder/ -b ./database/db 37 | Or 38 | >> antivcode -s -y -n -d ./folder/ -b ./database/db 39 | ``` 40 | 41 | To study sigle file and append to database by default(./db): 42 | 43 | ``` 44 | >> antivcode -s -f simples/studied.jpg 45 | ``` 46 | 47 | if you want to see binaryzated image, just add -v option. 48 | 49 | When finish studying, you can run a test or recognition. 50 | 51 | To test a single file: 52 | 53 | ``` 54 | >> antivcode -t -f simples/tested.jpg 55 | ``` 56 | 57 | To test a series of images: 58 | 59 | ``` 60 | >> antivcode -t -d test/ 61 | ``` 62 | Note: test procedure require that file named with a right name. 63 | 64 | To recognite a single file: 65 | 66 | ``` 67 | >> antivcode -f simples/recognited.jpg 68 | ``` 69 | 70 | To recognite a series of files: 71 | 72 | ``` 73 | >> antivcode -d simples/ 74 | ``` 75 | 76 | # Author 77 | 78 | Micooz 79 | 80 | November 30, 2014 in Chengdu University of Technology. 81 | 82 | Last Update: May 15, 2015. 83 | 84 | Contact me by e-mail: **micooz@hotmail.com** -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/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 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/rdjpgcom.1: -------------------------------------------------------------------------------- 1 | .TH RDJPGCOM 1 "13 September 2013" 2 | .SH NAME 3 | rdjpgcom \- display text comments from a JPEG file 4 | .SH SYNOPSIS 5 | .B rdjpgcom 6 | [ 7 | .B \-raw 8 | ] 9 | [ 10 | .B \-verbose 11 | ] 12 | [ 13 | .I filename 14 | ] 15 | .LP 16 | .SH DESCRIPTION 17 | .LP 18 | .B rdjpgcom 19 | reads the named JPEG/JFIF file, or the standard input if no file is named, 20 | and prints any text comments found in the file on the standard output. 21 | .PP 22 | The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. 23 | Although the standard doesn't actually define what COM blocks are for, they 24 | are widely used to hold user-supplied text strings. This lets you add 25 | annotations, titles, index terms, etc to your JPEG files, and later retrieve 26 | them as text. COM blocks do not interfere with the image stored in the JPEG 27 | file. The maximum size of a COM block is 64K, but you can have as many of 28 | them as you like in one JPEG file. 29 | .SH OPTIONS 30 | .TP 31 | .B \-raw 32 | Normally 33 | .B rdjpgcom 34 | escapes non-printable characters in comments, for security reasons. 35 | This option avoids that. 36 | .PP 37 | .B \-verbose 38 | Causes 39 | .B rdjpgcom 40 | to also display the JPEG image dimensions. 41 | .PP 42 | Switch names may be abbreviated, and are not case sensitive. 43 | .SH HINTS 44 | .B rdjpgcom 45 | does not depend on the IJG JPEG library. Its source code is intended as an 46 | illustration of the minimum amount of code required to parse a JPEG file 47 | header correctly. 48 | .PP 49 | In 50 | .B \-verbose 51 | mode, 52 | .B rdjpgcom 53 | will also attempt to print the contents of any "APP12" markers as text. 54 | Some digital cameras produce APP12 markers containing useful textual 55 | information. If you like, you can modify the source code to print 56 | other APPn marker types as well. 57 | .SH SEE ALSO 58 | .BR cjpeg (1), 59 | .BR djpeg (1), 60 | .BR jpegtran (1), 61 | .BR wrjpgcom (1) 62 | .SH AUTHOR 63 | Independent JPEG Group 64 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/codegear/gtest_all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, 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: Josh Kelley (joshkel@gmail.com) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // C++Builder's IDE cannot build a static library from files with hyphens 35 | // in their name. See http://qc.codegear.com/wc/qcmain.aspx?d=70977 . 36 | // This file serves as a workaround. 37 | 38 | #include "src/gtest-all.cc" 39 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/scripts/test/Makefile: -------------------------------------------------------------------------------- 1 | # A Makefile for fusing Google Test and building a sample test against it. 2 | # 3 | # SYNOPSIS: 4 | # 5 | # make [all] - makes everything. 6 | # make TARGET - makes the given target. 7 | # make check - makes everything and runs the built sample test. 8 | # make clean - removes all files generated by make. 9 | 10 | # Points to the root of fused Google Test, relative to where this file is. 11 | FUSED_GTEST_DIR = output 12 | 13 | # Paths to the fused gtest files. 14 | FUSED_GTEST_H = $(FUSED_GTEST_DIR)/gtest/gtest.h 15 | FUSED_GTEST_ALL_CC = $(FUSED_GTEST_DIR)/gtest/gtest-all.cc 16 | 17 | # Where to find the sample test. 18 | SAMPLE_DIR = ../../samples 19 | 20 | # Where to find gtest_main.cc. 21 | GTEST_MAIN_CC = ../../src/gtest_main.cc 22 | 23 | # Flags passed to the preprocessor. 24 | # We have no idea here whether pthreads is available in the system, so 25 | # disable its use. 26 | CPPFLAGS += -I$(FUSED_GTEST_DIR) -DGTEST_HAS_PTHREAD=0 27 | 28 | # Flags passed to the C++ compiler. 29 | CXXFLAGS += -g 30 | 31 | all : sample1_unittest 32 | 33 | check : all 34 | ./sample1_unittest 35 | 36 | clean : 37 | rm -rf $(FUSED_GTEST_DIR) sample1_unittest *.o 38 | 39 | $(FUSED_GTEST_H) : 40 | ../fuse_gtest_files.py $(FUSED_GTEST_DIR) 41 | 42 | $(FUSED_GTEST_ALL_CC) : 43 | ../fuse_gtest_files.py $(FUSED_GTEST_DIR) 44 | 45 | gtest-all.o : $(FUSED_GTEST_H) $(FUSED_GTEST_ALL_CC) 46 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(FUSED_GTEST_DIR)/gtest/gtest-all.cc 47 | 48 | gtest_main.o : $(FUSED_GTEST_H) $(GTEST_MAIN_CC) 49 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_MAIN_CC) 50 | 51 | sample1.o : $(SAMPLE_DIR)/sample1.cc $(SAMPLE_DIR)/sample1.h 52 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1.cc 53 | 54 | sample1_unittest.o : $(SAMPLE_DIR)/sample1_unittest.cc \ 55 | $(SAMPLE_DIR)/sample1.h $(FUSED_GTEST_H) 56 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1_unittest.cc 57 | 58 | sample1_unittest : sample1.o sample1_unittest.o gtest-all.o gtest_main.o 59 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ 60 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_main_unittest.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 | #include "gtest/gtest.h" 33 | 34 | // Tests that we don't have to define main() when we link to 35 | // gtest_main instead of gtest. 36 | 37 | namespace { 38 | 39 | TEST(GTestMainTest, ShouldSucceed) { 40 | } 41 | 42 | } // namespace 43 | 44 | // We are using the main() function defined in src/gtest_main.cc, so 45 | // we don't define it here. 46 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/samples/sample4_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | #include "gtest/gtest.h" 33 | #include "sample4.h" 34 | 35 | // Tests the Increment() method. 36 | TEST(Counter, Increment) { 37 | Counter c; 38 | 39 | // EXPECT_EQ() evaluates its arguments exactly once, so they 40 | // can have side effects. 41 | 42 | EXPECT_EQ(0, c.Increment()); 43 | EXPECT_EQ(1, c.Increment()); 44 | EXPECT_EQ(2, c.Increment()); 45 | } 46 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/samples/sample1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #ifndef GTEST_SAMPLES_SAMPLE1_H_ 35 | #define GTEST_SAMPLES_SAMPLE1_H_ 36 | 37 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 38 | int Factorial(int n); 39 | 40 | // Returns true iff n is a prime number. 41 | bool IsPrime(int n); 42 | 43 | #endif // GTEST_SAMPLES_SAMPLE1_H_ 44 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_uninitialized_test_.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | 34 | TEST(DummyTest, Dummy) { 35 | // This test doesn't verify anything. We just need it to create a 36 | // realistic stage for testing the behavior of Google Test when 37 | // RUN_ALL_TESTS() is called without testing::InitGoogleTest() being 38 | // called first. 39 | } 40 | 41 | int main() { 42 | return RUN_ALL_TESTS(); 43 | } 44 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/samples/sample4.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #include 35 | 36 | #include "sample4.h" 37 | 38 | // Returns the current counter value, and increments it. 39 | int Counter::Increment() { 40 | return counter_++; 41 | } 42 | 43 | // Prints the current counter value to STDOUT. 44 | void Counter::Print() const { 45 | printf("%d", counter_); 46 | } 47 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/build-aux/config.h.in: -------------------------------------------------------------------------------- 1 | /* build-aux/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_MEMORY_H 11 | 12 | /* Define if you have POSIX threads libraries and header files. */ 13 | #undef HAVE_PTHREAD 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDINT_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STDLIB_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRINGS_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STRING_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_STAT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_TYPES_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_UNISTD_H 35 | 36 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 37 | */ 38 | #undef LT_OBJDIR 39 | 40 | /* Name of package */ 41 | #undef PACKAGE 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #undef PACKAGE_BUGREPORT 45 | 46 | /* Define to the full name of this package. */ 47 | #undef PACKAGE_NAME 48 | 49 | /* Define to the full name and version of this package. */ 50 | #undef PACKAGE_STRING 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #undef PACKAGE_TARNAME 54 | 55 | /* Define to the home page for this package. */ 56 | #undef PACKAGE_URL 57 | 58 | /* Define to the version of this package. */ 59 | #undef PACKAGE_VERSION 60 | 61 | /* Define to necessary symbol if this constant uses a non-standard name on 62 | your system. */ 63 | #undef PTHREAD_CREATE_JOINABLE 64 | 65 | /* Define to 1 if you have the ANSI C header files. */ 66 | #undef STDC_HEADERS 67 | 68 | /* Version number of package */ 69 | #undef VERSION 70 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/codegear/gtest_link.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, 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: Josh Kelley (joshkel@gmail.com) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Links gtest.lib and gtest_main.lib into the current project in C++Builder. 35 | // This means that these libraries can't be renamed, but it's the only way to 36 | // ensure that Debug versus Release test builds are linked against the 37 | // appropriate Debug or Release build of the libraries. 38 | 39 | #pragma link "gtest.lib" 40 | #pragma link "gtest_main.lib" 41 | -------------------------------------------------------------------------------- /src/Decoder.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Decoder.h" 3 | #include "IImage.h" 4 | #include "Jpeg.h" 5 | #include "Database.h" 6 | 7 | Decoder::Decoder(const std::string& dbpath) 8 | : _db(nullptr) { 9 | 10 | std::string root; 11 | std::string dbname; 12 | 13 | if (dbpath.find('/')) { 14 | int pos = dbpath.find_last_of('/'); 15 | root = dbpath.substr(0, pos + 1); 16 | dbname = dbpath.substr(pos + 1); 17 | } else { 18 | root = "./"; 19 | } 20 | 21 | _db = new Database(root, dbname); 22 | } 23 | 24 | CharSet 25 | Decoder::decode(const std::string& file) { 26 | SliceCollection* col = _db->load(); 27 | 28 | if (col->empty()) { 29 | throw std::logic_error("database empty"); 30 | } 31 | 32 | std::shared_ptr target(new Jpeg(file)); 33 | CharSet result; 34 | 35 | result.reserve(10); 36 | target->makeGray(); 37 | target->binaryZate(); 38 | 39 | auto tcol = target->cut(); 40 | size_t len = tcol->size(); 41 | 42 | //iterate target slices 43 | for (size_t i = 0; i < len; i++) { 44 | auto tsc = tcol->at(i); 45 | 46 | std::shared_ptr max = col->at(0); 47 | 48 | float lastr = 0.0f; 49 | float maxr = 0.0f;// tsc->similarTo(*max); 50 | 51 | size_t dblen = col->size(); 52 | //iterate database 53 | for (size_t k = 0; k < dblen; ++k) { 54 | lastr = tsc->similarTo(*col->at(k)); 55 | if (lastr > maxr) { 56 | maxr = lastr; 57 | max = col->at(k); 58 | } 59 | //#ifdef _DEBUG 60 | // std::cout << "compared with " << col->at(k)->getSymbol() << " in db, rate = " << lastr << std::endl; 61 | //#endif 62 | } 63 | //#ifdef _DEBUG 64 | // std::cout << "\nhit at " << max->getSymbol() << " " << maxr << std::endl; 65 | // std::cout << "tc " << tsc->getCode() << std::endl; 66 | // std::cout << "sc(" << max->getSymbol() << ") " << max->getCode() << std::endl; 67 | // std::cout << std::endl; 68 | //#endif 69 | 70 | result.push_back(max->getSymbol()); 71 | } 72 | return result; 73 | } 74 | 75 | Decoder::~Decoder() { 76 | if (_db) { 77 | delete _db; 78 | _db = nullptr; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/test/generator_test.cc: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "generator/generator.h" 3 | 4 | using namespace program_options; 5 | 6 | TEST(TestGenerator, generating) { 7 | Generator gen; 8 | gen.make_usage(""); 9 | EXPECT_STREQ(gen.to_string().c_str(), ""); 10 | 11 | gen.make_usage("this is an usage information"); 12 | EXPECT_STREQ(gen.to_string().c_str(), "this is an usage information"); 13 | 14 | gen.make_usage("usage of subroutine_1:") 15 | .add_subroutine 16 | ("subroutine_1", "description of subroutine_1") 17 | ("a,", "option with a short-form") 18 | (",long", "option with a long-form") 19 | ("option", "this option will be ignored") 20 | ("o,option", "option with both short and long form"); 21 | EXPECT_STREQ(gen("subroutine_1").to_string().c_str(), " -a option with a short-form\n --long option with a long-form\n -o [ --option ] option with both short and long form\n"); 22 | 23 | gen.add_subroutine 24 | ("subroutine_2", "description of subroutine_2") 25 | ("o,option", "", "option require a value") 26 | ("p,person", "micooz", "option with default value"); 27 | EXPECT_STREQ(gen("subroutine_2").to_string().c_str(), " -o [ --option ] arg option require a value\n -p [ --person ] arg = micooz option with default value\n"); 28 | 29 | auto kv = gen.get_subroutine_list(); 30 | std::stringstream ss; 31 | for(auto sub : kv) { 32 | ss << "\t" << sub.first << "\t" << sub.second << std::endl; 33 | } 34 | EXPECT_STREQ(ss.str().c_str(), "\tsubroutine_1\tdescription of subroutine_1\n\tsubroutine_2\tdescription of subroutine_2\n"); 35 | } 36 | 37 | TEST(TestGenerator, templatizing){ 38 | Generator gen; 39 | gen.make_template("% - % = % [%]", 40 | {Row::kShort, Row::kLong, Row::kDefault, Row::kDescription}); 41 | gen.make_usage("the program usage:") 42 | ("o,option", "value", "description"); 43 | EXPECT_STREQ(gen(Subroutine::get_default_name()).to_string().c_str(), 44 | "o - option = value [description]\n"); 45 | } 46 | 47 | int main(int argc, char* argv[]) { 48 | testing::InitGoogleTest(&argc, argv); 49 | return RUN_ALL_TESTS(); 50 | } 51 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_xml_outfile1_test_.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: keith.ray@gmail.com (Keith Ray) 31 | // 32 | // gtest_xml_outfile1_test_ writes some xml via TestProperty used by 33 | // gtest_xml_outfiles_test.py 34 | 35 | #include "gtest/gtest.h" 36 | 37 | class PropertyOne : public testing::Test { 38 | protected: 39 | virtual void SetUp() { 40 | RecordProperty("SetUpProp", 1); 41 | } 42 | virtual void TearDown() { 43 | RecordProperty("TearDownProp", 1); 44 | } 45 | }; 46 | 47 | TEST_F(PropertyOne, TestSomeProperties) { 48 | RecordProperty("TestSomeProperty", 1); 49 | } 50 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_xml_outfile2_test_.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: keith.ray@gmail.com (Keith Ray) 31 | // 32 | // gtest_xml_outfile2_test_ writes some xml via TestProperty used by 33 | // gtest_xml_outfiles_test.py 34 | 35 | #include "gtest/gtest.h" 36 | 37 | class PropertyTwo : public testing::Test { 38 | protected: 39 | virtual void SetUp() { 40 | RecordProperty("SetUpProp", 2); 41 | } 42 | virtual void TearDown() { 43 | RecordProperty("TearDownProp", 2); 44 | } 45 | }; 46 | 47 | TEST_F(PropertyTwo, TestSomeProperties) { 48 | RecordProperty("TestSomeProperty", 2); 49 | } 50 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/codegear/gtest.groupproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {c1d923e0-6cba-4332-9b6f-3420acbf5091} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Default.Personality 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest-typed-test2_test.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include 33 | 34 | #include "test/gtest-typed-test_test.h" 35 | #include "gtest/gtest.h" 36 | 37 | #if GTEST_HAS_TYPED_TEST_P 38 | 39 | // Tests that the same type-parameterized test case can be 40 | // instantiated in different translation units linked together. 41 | // (ContainerTest is also instantiated in gtest-typed-test_test.cc.) 42 | INSTANTIATE_TYPED_TEST_CASE_P(Vector, ContainerTest, 43 | testing::Types >); 44 | 45 | #endif // GTEST_HAS_TYPED_TEST_P 46 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/samples/sample4.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #ifndef GTEST_SAMPLES_SAMPLE4_H_ 35 | #define GTEST_SAMPLES_SAMPLE4_H_ 36 | 37 | // A simple monotonic counter. 38 | class Counter { 39 | private: 40 | int counter_; 41 | 42 | public: 43 | // Creates a counter that starts at 0. 44 | Counter() : counter_(0) {} 45 | 46 | // Returns the current counter value, and increments it. 47 | int Increment(); 48 | 49 | // Prints the current counter value to STDOUT. 50 | void Print() const; 51 | }; 52 | 53 | #endif // GTEST_SAMPLES_SAMPLE4_H_ 54 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_help_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, 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 program is meant to be run by gtest_help_test.py. Do not run 33 | // it directly. 34 | 35 | #include "gtest/gtest.h" 36 | 37 | // When a help flag is specified, this program should skip the tests 38 | // and exit with 0; otherwise the following test will be executed, 39 | // causing this program to exit with a non-zero code. 40 | TEST(HelpFlagTest, ShouldNotBeRun) { 41 | ASSERT_TRUE(false) << "Tests shouldn't be run when --help is specified."; 42 | } 43 | 44 | #if GTEST_HAS_DEATH_TEST 45 | TEST(DeathTest, UsedByPythonScriptToDetectSupportForDeathTestsInThisBinary) {} 46 | #endif 47 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/src/gtest-all.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: mheule@google.com (Markus Heule) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build Google Test by compiling a single file. 35 | // This file serves this purpose. 36 | 37 | // This line ensures that gtest.h can be compiled on its own, even 38 | // when it's fused. 39 | #include "gtest/gtest.h" 40 | 41 | // The following lines pull in the real gtest *.cc files. 42 | #include "src/gtest.cc" 43 | #include "src/gtest-death-test.cc" 44 | #include "src/gtest-filepath.cc" 45 | #include "src/gtest-port.cc" 46 | #include "src/gtest-printers.cc" 47 | #include "src/gtest-test-part.cc" 48 | #include "src/gtest-typed-test.cc" 49 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/production.h: -------------------------------------------------------------------------------- 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 | #ifndef GTEST_TEST_PRODUCTION_H_ 35 | #define GTEST_TEST_PRODUCTION_H_ 36 | 37 | #include "gtest/gtest_prod.h" 38 | 39 | class PrivateCode { 40 | public: 41 | // Declares a friend test that does not use a fixture. 42 | FRIEND_TEST(PrivateCodeTest, CanAccessPrivateMembers); 43 | 44 | // Declares a friend test that uses a fixture. 45 | FRIEND_TEST(PrivateCodeFixtureTest, CanAccessPrivateMembers); 46 | 47 | PrivateCode(); 48 | 49 | int x() const { return x_; } 50 | private: 51 | void set_x(int an_x) { x_ = an_x; } 52 | int x_; 53 | }; 54 | 55 | #endif // GTEST_TEST_PRODUCTION_H_ 56 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_all_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, 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 | // Tests for Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build most of Google Test's own tests 35 | // by compiling a single file. This file serves this purpose. 36 | #include "test/gtest-filepath_test.cc" 37 | #include "test/gtest-linked_ptr_test.cc" 38 | #include "test/gtest-message_test.cc" 39 | #include "test/gtest-options_test.cc" 40 | #include "test/gtest-port_test.cc" 41 | #include "test/gtest_pred_impl_unittest.cc" 42 | #include "test/gtest_prod_test.cc" 43 | #include "test/gtest-test-part_test.cc" 44 | #include "test/gtest-typed-test_test.cc" 45 | #include "test/gtest-typed-test2_test.cc" 46 | #include "test/gtest_unittest.cc" 47 | #include "test/production.cc" 48 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_prod_test.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 | // Unit test for include/gtest/gtest_prod.h. 33 | 34 | #include "gtest/gtest.h" 35 | #include "test/production.h" 36 | 37 | // Tests that private members can be accessed from a TEST declared as 38 | // a friend of the class. 39 | TEST(PrivateCodeTest, CanAccessPrivateMembers) { 40 | PrivateCode a; 41 | EXPECT_EQ(0, a.x_); 42 | 43 | a.set_x(1); 44 | EXPECT_EQ(1, a.x_); 45 | } 46 | 47 | typedef testing::Test PrivateCodeFixtureTest; 48 | 49 | // Tests that private members can be accessed from a TEST_F declared 50 | // as a friend of the class. 51 | TEST_F(PrivateCodeFixtureTest, CanAccessPrivateMembers) { 52 | PrivateCode a; 53 | EXPECT_EQ(0, a.x_); 54 | 55 | a.set_x(2); 56 | EXPECT_EQ(2, a.x_); 57 | } 58 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_sole_header_test.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: mheule@google.com (Markus Heule) 31 | // 32 | // This test verifies that it's possible to use Google Test by including 33 | // the gtest.h header file alone. 34 | 35 | #include "gtest/gtest.h" 36 | 37 | namespace { 38 | 39 | void Subroutine() { 40 | EXPECT_EQ(42, 42); 41 | } 42 | 43 | TEST(NoFatalFailureTest, ExpectNoFatalFailure) { 44 | EXPECT_NO_FATAL_FAILURE(;); 45 | EXPECT_NO_FATAL_FAILURE(SUCCEED()); 46 | EXPECT_NO_FATAL_FAILURE(Subroutine()); 47 | EXPECT_NO_FATAL_FAILURE({ SUCCEED(); }); 48 | } 49 | 50 | TEST(NoFatalFailureTest, AssertNoFatalFailure) { 51 | ASSERT_NO_FATAL_FAILURE(;); 52 | ASSERT_NO_FATAL_FAILURE(SUCCEED()); 53 | ASSERT_NO_FATAL_FAILURE(Subroutine()); 54 | ASSERT_NO_FATAL_FAILURE({ SUCCEED(); }); 55 | } 56 | 57 | } // namespace 58 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/include/generator/subroutine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * subroutine 3 | * (c) Copyright 2015 Micooz 4 | * 5 | * Released under the Apache License. 6 | * See the LICENSE file or 7 | * http://www.apache.org/licenses/LICENSE-2.0.txt for more information. 8 | */ 9 | #ifndef GENERATOR_SUBROUTINE_H_ 10 | #define GENERATOR_SUBROUTINE_H_ 11 | 12 | #include 13 | #include 14 | #include 15 | #include "row.h" 16 | 17 | namespace program_options { 18 | 19 | class Subroutine { 20 | public: 21 | typedef std::vector Usages; 22 | typedef std::initializer_list TemplateValue; 23 | typedef std::vector TemplateValues; 24 | 25 | Subroutine(); 26 | 27 | Subroutine(const char* name, const char* description); 28 | 29 | inline void add_usage_line(const Row& row) { usages_.push_back(row); } 30 | 31 | inline void add_usage_line(const TemplateValue& row) { 32 | templates_.push_back(row); 33 | } 34 | 35 | inline void set_first_line(const char* line) { first_line_ = line; } 36 | 37 | inline void set_description(const char* desc) { description_ = desc; } 38 | 39 | inline void set_template(const char* tstr, const Row::Order& order) { 40 | template_str_ = tstr; 41 | order_ = order; 42 | } 43 | 44 | // getters 45 | 46 | inline std::string to_string() { 47 | std::stringstream ss; 48 | ss << *this; 49 | return std::move(ss.str()); 50 | } 51 | 52 | inline std::string get_name() const { return name_; } 53 | 54 | inline const char* get_description() const { return description_; } 55 | 56 | inline const char* get_first_line() const { return first_line_; } 57 | 58 | inline Usages::iterator begin() { return usages_.begin(); } 59 | 60 | inline Usages::iterator end() { return usages_.end(); } 61 | 62 | inline size_t size() { return usages_.size(); } 63 | 64 | inline Row& at(size_t i) { return usages_.at(i); } 65 | 66 | inline const Usages& get_usage() const { return usages_; } 67 | 68 | inline static const char* get_default_name() { return "EmptySubroutine"; } 69 | 70 | private: 71 | friend std::ostream& operator<<(std::ostream& out, Subroutine& subroutine); 72 | 73 | void print_with_row(std::ostream& out); 74 | 75 | void print_with_template(std::ostream& out); 76 | 77 | Usages usages_; 78 | TemplateValues templates_; 79 | const char* first_line_; 80 | const char* description_; 81 | std::string name_; 82 | std::string template_str_; 83 | Row::Order order_; 84 | }; 85 | } 86 | #endif // GENERATOR_SUBROUTINE_H_ -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/samples/sample2.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #include "sample2.h" 35 | 36 | #include 37 | 38 | // Clones a 0-terminated C string, allocating memory using new. 39 | const char* MyString::CloneCString(const char* a_c_string) { 40 | if (a_c_string == NULL) return NULL; 41 | 42 | const size_t len = strlen(a_c_string); 43 | char* const clone = new char[ len + 1 ]; 44 | memcpy(clone, a_c_string, len + 1); 45 | 46 | return clone; 47 | } 48 | 49 | // Sets the 0-terminated C string this MyString object 50 | // represents. 51 | void MyString::Set(const char* a_c_string) { 52 | // Makes sure this works when c_string == c_string_ 53 | const char* const temp = MyString::CloneCString(a_c_string); 54 | delete[] c_string_; 55 | c_string_ = temp; 56 | } 57 | -------------------------------------------------------------------------------- /src/Database.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "Database.h" 5 | 6 | std::ofstream& 7 | operator<<(std::ofstream& out, Slice* item) { 8 | AttributeCode code = item->getCode(); 9 | char symbol = item->getSymbol(); 10 | size_t len = code.size(); 11 | 12 | out.write((&symbol), sizeof(char)); 13 | 14 | out.write((char*) &(len), sizeof(size_t)); 15 | 16 | out.write(std::string(code.begin(), code.end()).c_str(), code.size()); 17 | 18 | return out; 19 | } 20 | 21 | std::ifstream& 22 | operator>>(std::ifstream& in, Slice* item) { 23 | char symbol; 24 | size_t len; 25 | 26 | if (!in.read(&(symbol), sizeof(char))) { 27 | return in; 28 | } 29 | 30 | in.read((char*) &len, sizeof(size_t)); 31 | 32 | char* buffer = new char[len]; 33 | 34 | in.read(buffer, len); 35 | 36 | item->setSymbol(symbol); 37 | item->setCode(AttributeCode(buffer, buffer + len)); 38 | 39 | delete[] buffer; 40 | buffer = nullptr; 41 | 42 | return in; 43 | } 44 | 45 | Database::Database(const std::string& root, const std::string& dbname) 46 | : _collection(nullptr), _root(root), _dbname(dbname) { 47 | 48 | _collection = new SliceCollection; 49 | } 50 | 51 | void 52 | Database::add(std::shared_ptr slice) { 53 | _collection->push_back(slice); 54 | } 55 | 56 | SliceCollection* 57 | Database::load() { 58 | if (_collection) { 59 | if (!_collection->empty()) 60 | // save(); 61 | return _collection; 62 | } else { 63 | _collection = new SliceCollection; 64 | } 65 | _collection->reserve(30); 66 | // 67 | std::string file = _root + _dbname; 68 | std::ifstream stream(file, std::ios::in | std::ios::binary); 69 | 70 | while (true) { 71 | std::shared_ptr it(new Slice()); 72 | 73 | if (!stream.eof() && stream >> it.get()) { 74 | _collection->push_back(it); 75 | } else { 76 | break; 77 | } 78 | } 79 | 80 | stream.close(); 81 | return _collection; 82 | } 83 | 84 | void 85 | Database::save() { 86 | auto file = _root + _dbname; 87 | std::ofstream stream(file, std::ios::binary | std::ios::out | std::ios::app); 88 | for (std::shared_ptr slice : *_collection) { 89 | stream << slice.get(); 90 | } 91 | stream.flush(); 92 | stream.close(); 93 | 94 | _collection->clear(); 95 | } 96 | 97 | Database::~Database() { 98 | if (_collection) { 99 | delete _collection; 100 | _collection = nullptr; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/xcode/Samples/FrameworkSample/widget.h: -------------------------------------------------------------------------------- 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 | // 30 | // Author: preston.a.jackson@gmail.com (Preston Jackson) 31 | // 32 | // Google Test - FrameworkSample 33 | // widget.h 34 | // 35 | 36 | // Widget is a very simple class used for demonstrating the use of gtest. It 37 | // simply stores two values a string and an integer, which are returned via 38 | // public accessors in multiple forms. 39 | 40 | #import 41 | 42 | class Widget { 43 | public: 44 | Widget(int number, const std::string& name); 45 | ~Widget(); 46 | 47 | // Public accessors to number data 48 | float GetFloatValue() const; 49 | int GetIntValue() const; 50 | 51 | // Public accessors to the string data 52 | std::string GetStringValue() const; 53 | void GetCharPtrValue(char* buffer, size_t max_size) const; 54 | 55 | private: 56 | // Data members 57 | float number_; 58 | std::string name_; 59 | }; 60 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/include/gtest/gtest_prod.h: -------------------------------------------------------------------------------- 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 | // Google C++ Testing Framework definitions useful in production code. 33 | 34 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 35 | #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 36 | 37 | // When you need to test the private or protected members of a class, 38 | // use the FRIEND_TEST macro to declare your tests as friends of the 39 | // class. For example: 40 | // 41 | // class MyClass { 42 | // private: 43 | // void MyMethod(); 44 | // FRIEND_TEST(MyClassTest, MyMethod); 45 | // }; 46 | // 47 | // class MyClassTest : public testing::Test { 48 | // // ... 49 | // }; 50 | // 51 | // TEST_F(MyClassTest, MyMethod) { 52 | // // Can call MyClass::MyMethod() here. 53 | // } 54 | 55 | #define FRIEND_TEST(test_case_name, test_name)\ 56 | friend class test_case_name##_##test_name##_Test 57 | 58 | #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 59 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest-param-test_test.h: -------------------------------------------------------------------------------- 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 | // 30 | // Authors: vladl@google.com (Vlad Losev) 31 | // 32 | // The Google C++ Testing Framework (Google Test) 33 | // 34 | // This header file provides classes and functions used internally 35 | // for testing Google Test itself. 36 | 37 | #ifndef GTEST_TEST_GTEST_PARAM_TEST_TEST_H_ 38 | #define GTEST_TEST_GTEST_PARAM_TEST_TEST_H_ 39 | 40 | #include "gtest/gtest.h" 41 | 42 | #if GTEST_HAS_PARAM_TEST 43 | 44 | // Test fixture for testing definition and instantiation of a test 45 | // in separate translation units. 46 | class ExternalInstantiationTest : public ::testing::TestWithParam { 47 | }; 48 | 49 | // Test fixture for testing instantiation of a test in multiple 50 | // translation units. 51 | class InstantiationInMultipleTranslaionUnitsTest 52 | : public ::testing::TestWithParam { 53 | }; 54 | 55 | #endif // GTEST_HAS_PARAM_TEST 56 | 57 | #endif // GTEST_TEST_GTEST_PARAM_TEST_TEST_H_ 58 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/xcode/Samples/FrameworkSample/widget.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: preston.a.jackson@gmail.com (Preston Jackson) 31 | // 32 | // Google Test - FrameworkSample 33 | // widget.cc 34 | // 35 | 36 | // Widget is a very simple class used for demonstrating the use of gtest 37 | 38 | #include "widget.h" 39 | 40 | Widget::Widget(int number, const std::string& name) 41 | : number_(number), 42 | name_(name) {} 43 | 44 | Widget::~Widget() {} 45 | 46 | float Widget::GetFloatValue() const { 47 | return number_; 48 | } 49 | 50 | int Widget::GetIntValue() const { 51 | return static_cast(number_); 52 | } 53 | 54 | std::string Widget::GetStringValue() const { 55 | return name_; 56 | } 57 | 58 | void Widget::GetCharPtrValue(char* buffer, size_t max_size) const { 59 | // Copy the char* representation of name_ into buffer, up to max_size. 60 | strncpy(buffer, name_.c_str(), max_size-1); 61 | buffer[max_size-1] = '\0'; 62 | return; 63 | } 64 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/msvc/gtest.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "gtest.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_main", "gtest_main.vcproj", "{3AF54C8A-10BF-4332-9147-F68ED9862032}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | EndProjectSection 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_unittest", "gtest_unittest.vcproj", "{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}" 11 | ProjectSection(ProjectDependencies) = postProject 12 | EndProjectSection 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_prod_test", "gtest_prod_test.vcproj", "{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}" 15 | ProjectSection(ProjectDependencies) = postProject 16 | EndProjectSection 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfiguration) = preSolution 20 | Debug = Debug 21 | Release = Release 22 | EndGlobalSection 23 | GlobalSection(ProjectConfiguration) = postSolution 24 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.ActiveCfg = Debug|Win32 25 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.Build.0 = Debug|Win32 26 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.ActiveCfg = Release|Win32 27 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.Build.0 = Release|Win32 28 | {3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.ActiveCfg = Debug|Win32 29 | {3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.Build.0 = Debug|Win32 30 | {3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.ActiveCfg = Release|Win32 31 | {3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.Build.0 = Release|Win32 32 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.ActiveCfg = Debug|Win32 33 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.Build.0 = Debug|Win32 34 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.ActiveCfg = Release|Win32 35 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.Build.0 = Release|Win32 36 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.ActiveCfg = Debug|Win32 37 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.Build.0 = Debug|Win32 38 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.ActiveCfg = Release|Win32 39 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.Build.0 = Release|Win32 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | EndGlobalSection 43 | GlobalSection(ExtensibilityAddIns) = postSolution 44 | EndGlobalSection 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/msvc/gtest-md.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-md", "gtest-md.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_main-md", "gtest_main-md.vcproj", "{3AF54C8A-10BF-4332-9147-F68ED9862033}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | EndProjectSection 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_prod_test-md", "gtest_prod_test-md.vcproj", "{24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}" 11 | ProjectSection(ProjectDependencies) = postProject 12 | EndProjectSection 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_unittest-md", "gtest_unittest-md.vcproj", "{4D9FDFB5-986A-4139-823C-F4EE0ED481A2}" 15 | ProjectSection(ProjectDependencies) = postProject 16 | EndProjectSection 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfiguration) = preSolution 20 | Debug = Debug 21 | Release = Release 22 | EndGlobalSection 23 | GlobalSection(ProjectConfiguration) = postSolution 24 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug.ActiveCfg = Debug|Win32 25 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug.Build.0 = Debug|Win32 26 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release.ActiveCfg = Release|Win32 27 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release.Build.0 = Release|Win32 28 | {3AF54C8A-10BF-4332-9147-F68ED9862033}.Debug.ActiveCfg = Debug|Win32 29 | {3AF54C8A-10BF-4332-9147-F68ED9862033}.Debug.Build.0 = Debug|Win32 30 | {3AF54C8A-10BF-4332-9147-F68ED9862033}.Release.ActiveCfg = Release|Win32 31 | {3AF54C8A-10BF-4332-9147-F68ED9862033}.Release.Build.0 = Release|Win32 32 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}.Debug.ActiveCfg = Debug|Win32 33 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}.Debug.Build.0 = Debug|Win32 34 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}.Release.ActiveCfg = Release|Win32 35 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}.Release.Build.0 = Release|Win32 36 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A2}.Debug.ActiveCfg = Debug|Win32 37 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A2}.Debug.Build.0 = Debug|Win32 38 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A2}.Release.ActiveCfg = Release|Win32 39 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A2}.Release.Build.0 = Release|Win32 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | EndGlobalSection 43 | GlobalSection(ExtensibilityAddIns) = postSolution 44 | EndGlobalSection 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/xcode/Samples/FrameworkSample/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2008, Google Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | # Executes the samples and tests for the Google Test Framework. 33 | 34 | # Help the dynamic linker find the path to the libraries. 35 | export DYLD_FRAMEWORK_PATH=$BUILT_PRODUCTS_DIR 36 | export DYLD_LIBRARY_PATH=$BUILT_PRODUCTS_DIR 37 | 38 | # Create some executables. 39 | test_executables=$@ 40 | 41 | # Now execute each one in turn keeping track of how many succeeded and failed. 42 | succeeded=0 43 | failed=0 44 | failed_list=() 45 | for test in ${test_executables[*]}; do 46 | "$test" 47 | result=$? 48 | if [ $result -eq 0 ]; then 49 | succeeded=$(( $succeeded + 1 )) 50 | else 51 | failed=$(( failed + 1 )) 52 | failed_list="$failed_list $test" 53 | fi 54 | done 55 | 56 | # Report the successes and failures to the console. 57 | echo "Tests complete with $succeeded successes and $failed failures." 58 | if [ $failed -ne 0 ]; then 59 | echo "The following tests failed:" 60 | echo $failed_list 61 | fi 62 | exit $failed 63 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_no_test_unittest.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 | // Tests that a Google Test program that has no test defined can run 31 | // successfully. 32 | // 33 | // Author: wan@google.com (Zhanyong Wan) 34 | 35 | #include "gtest/gtest.h" 36 | 37 | int main(int argc, char **argv) { 38 | testing::InitGoogleTest(&argc, argv); 39 | 40 | // An ad-hoc assertion outside of all tests. 41 | // 42 | // This serves three purposes: 43 | // 44 | // 1. It verifies that an ad-hoc assertion can be executed even if 45 | // no test is defined. 46 | // 2. It verifies that a failed ad-hoc assertion causes the test 47 | // program to fail. 48 | // 3. We had a bug where the XML output won't be generated if an 49 | // assertion is executed before RUN_ALL_TESTS() is called, even 50 | // though --gtest_output=xml is specified. This makes sure the 51 | // bug is fixed and doesn't regress. 52 | EXPECT_EQ(1, 2); 53 | 54 | // The above EXPECT_EQ() should cause RUN_ALL_TESTS() to return non-zero. 55 | return RUN_ALL_TESTS() ? 0 : 1; 56 | } 57 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest-typed-test_test.h: -------------------------------------------------------------------------------- 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 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #ifndef GTEST_TEST_GTEST_TYPED_TEST_TEST_H_ 33 | #define GTEST_TEST_GTEST_TYPED_TEST_TEST_H_ 34 | 35 | #include "gtest/gtest.h" 36 | 37 | #if GTEST_HAS_TYPED_TEST_P 38 | 39 | using testing::Test; 40 | 41 | // For testing that the same type-parameterized test case can be 42 | // instantiated in different translation units linked together. 43 | // ContainerTest will be instantiated in both gtest-typed-test_test.cc 44 | // and gtest-typed-test2_test.cc. 45 | 46 | template 47 | class ContainerTest : public Test { 48 | }; 49 | 50 | TYPED_TEST_CASE_P(ContainerTest); 51 | 52 | TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed) { 53 | TypeParam container; 54 | } 55 | 56 | TYPED_TEST_P(ContainerTest, InitialSizeIsZero) { 57 | TypeParam container; 58 | EXPECT_EQ(0U, container.size()); 59 | } 60 | 61 | REGISTER_TYPED_TEST_CASE_P(ContainerTest, 62 | CanBeDefaultConstructed, InitialSizeIsZero); 63 | 64 | #endif // GTEST_HAS_TYPED_TEST_P 65 | 66 | #endif // GTEST_TEST_GTEST_TYPED_TEST_TEST_H_ 67 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/samples/sample1.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #include "sample1.h" 35 | 36 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 37 | int Factorial(int n) { 38 | int result = 1; 39 | for (int i = 1; i <= n; i++) { 40 | result *= i; 41 | } 42 | 43 | return result; 44 | } 45 | 46 | // Returns true iff n is a prime number. 47 | bool IsPrime(int n) { 48 | // Trivial case 1: small numbers 49 | if (n <= 1) return false; 50 | 51 | // Trivial case 2: even numbers 52 | if (n % 2 == 0) return n == 2; 53 | 54 | // Now, we have that n is odd and n >= 3. 55 | 56 | // Try to divide n by every odd number i, starting from 3 57 | for (int i = 3; ; i += 2) { 58 | // We only have to try i up to the squre root of n 59 | if (i > n/i) break; 60 | 61 | // Now, we have i <= n/i < n. 62 | // If n is divisible by i, n is not prime. 63 | if (n % i == 0) return false; 64 | } 65 | 66 | // n has no integer factor in the range (1, n), and thus is prime. 67 | return true; 68 | } 69 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_uninitialized_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2008, Google Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | """Verifies that Google Test warns the user when not initialized properly.""" 33 | 34 | __author__ = 'wan@google.com (Zhanyong Wan)' 35 | 36 | import gtest_test_utils 37 | 38 | 39 | COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_') 40 | 41 | 42 | def Assert(condition): 43 | if not condition: 44 | raise AssertionError 45 | 46 | 47 | def AssertEq(expected, actual): 48 | if expected != actual: 49 | print 'Expected: %s' % (expected,) 50 | print ' Actual: %s' % (actual,) 51 | raise AssertionError 52 | 53 | 54 | def TestExitCodeAndOutput(command): 55 | """Runs the given command and verifies its exit code and output.""" 56 | 57 | # Verifies that 'command' exits with code 1. 58 | p = gtest_test_utils.Subprocess(command) 59 | Assert(p.exited) 60 | AssertEq(1, p.exit_code) 61 | Assert('InitGoogleTest' in p.output) 62 | 63 | 64 | class GTestUninitializedTest(gtest_test_utils.TestCase): 65 | def testExitCodeAndOutput(self): 66 | TestExitCodeAndOutput(COMMAND) 67 | 68 | 69 | if __name__ == '__main__': 70 | gtest_test_utils.Main() 71 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/configure.ac: -------------------------------------------------------------------------------- 1 | m4_include(m4/acx_pthread.m4) 2 | 3 | # At this point, the Xcode project assumes the version string will be three 4 | # integers separated by periods and surrounded by square brackets (e.g. 5 | # "[1.0.1]"). It also asumes that there won't be any closing parenthesis 6 | # between "AC_INIT(" and the closing ")" including comments and strings. 7 | AC_INIT([Google C++ Testing Framework], 8 | [1.7.0], 9 | [googletestframework@googlegroups.com], 10 | [gtest]) 11 | 12 | # Provide various options to initialize the Autoconf and configure processes. 13 | AC_PREREQ([2.59]) 14 | AC_CONFIG_SRCDIR([./LICENSE]) 15 | AC_CONFIG_MACRO_DIR([m4]) 16 | AC_CONFIG_AUX_DIR([build-aux]) 17 | AC_CONFIG_HEADERS([build-aux/config.h]) 18 | AC_CONFIG_FILES([Makefile]) 19 | AC_CONFIG_FILES([scripts/gtest-config], [chmod +x scripts/gtest-config]) 20 | 21 | # Initialize Automake with various options. We require at least v1.9, prevent 22 | # pedantic complaints about package files, and enable various distribution 23 | # targets. 24 | AM_INIT_AUTOMAKE([1.9 dist-bzip2 dist-zip foreign subdir-objects]) 25 | 26 | # Check for programs used in building Google Test. 27 | AC_PROG_CC 28 | AC_PROG_CXX 29 | AC_LANG([C++]) 30 | AC_PROG_LIBTOOL 31 | 32 | # TODO(chandlerc@google.com): Currently we aren't running the Python tests 33 | # against the interpreter detected by AM_PATH_PYTHON, and so we condition 34 | # HAVE_PYTHON by requiring "python" to be in the PATH, and that interpreter's 35 | # version to be >= 2.3. This will allow the scripts to use a "/usr/bin/env" 36 | # hashbang. 37 | PYTHON= # We *do not* allow the user to specify a python interpreter 38 | AC_PATH_PROG([PYTHON],[python],[:]) 39 | AS_IF([test "$PYTHON" != ":"], 40 | [AM_PYTHON_CHECK_VERSION([$PYTHON],[2.3],[:],[PYTHON=":"])]) 41 | AM_CONDITIONAL([HAVE_PYTHON],[test "$PYTHON" != ":"]) 42 | 43 | # Configure pthreads. 44 | AC_ARG_WITH([pthreads], 45 | [AS_HELP_STRING([--with-pthreads], 46 | [use pthreads (default is yes)])], 47 | [with_pthreads=$withval], 48 | [with_pthreads=check]) 49 | 50 | have_pthreads=no 51 | AS_IF([test "x$with_pthreads" != "xno"], 52 | [ACX_PTHREAD( 53 | [], 54 | [AS_IF([test "x$with_pthreads" != "xcheck"], 55 | [AC_MSG_FAILURE( 56 | [--with-pthreads was specified, but unable to be used])])]) 57 | have_pthreads="$acx_pthread_ok"]) 58 | AM_CONDITIONAL([HAVE_PTHREADS],[test "x$have_pthreads" = "xyes"]) 59 | AC_SUBST(PTHREAD_CFLAGS) 60 | AC_SUBST(PTHREAD_LIBS) 61 | 62 | # TODO(chandlerc@google.com) Check for the necessary system headers. 63 | 64 | # TODO(chandlerc@google.com) Check the types, structures, and other compiler 65 | # and architecture characteristics. 66 | 67 | # Output the generated files. No further autoconf macros may be used. 68 | AC_OUTPUT 69 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/xcode/Scripts/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2008, Google Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | # Executes the samples and tests for the Google Test Framework. 33 | 34 | # Help the dynamic linker find the path to the libraries. 35 | export DYLD_FRAMEWORK_PATH=$BUILT_PRODUCTS_DIR 36 | export DYLD_LIBRARY_PATH=$BUILT_PRODUCTS_DIR 37 | 38 | # Create some executables. 39 | test_executables=("$BUILT_PRODUCTS_DIR/gtest_unittest-framework" 40 | "$BUILT_PRODUCTS_DIR/gtest_unittest" 41 | "$BUILT_PRODUCTS_DIR/sample1_unittest-framework" 42 | "$BUILT_PRODUCTS_DIR/sample1_unittest-static") 43 | 44 | # Now execute each one in turn keeping track of how many succeeded and failed. 45 | succeeded=0 46 | failed=0 47 | failed_list=() 48 | for test in ${test_executables[*]}; do 49 | "$test" 50 | result=$? 51 | if [ $result -eq 0 ]; then 52 | succeeded=$(( $succeeded + 1 )) 53 | else 54 | failed=$(( failed + 1 )) 55 | failed_list="$failed_list $test" 56 | fi 57 | done 58 | 59 | # Report the successes and failures to the console. 60 | echo "Tests complete with $succeeded successes and $failed failures." 61 | if [ $failed -ne 0 ]; then 62 | echo "The following tests failed:" 63 | echo $failed_list 64 | fi 65 | exit $failed 66 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/xcode/Samples/FrameworkSample/widget_test.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: preston.a.jackson@gmail.com (Preston Jackson) 31 | // 32 | // Google Test - FrameworkSample 33 | // widget_test.cc 34 | // 35 | 36 | // This is a simple test file for the Widget class in the Widget.framework 37 | 38 | #include 39 | #include "gtest/gtest.h" 40 | 41 | #include 42 | 43 | // This test verifies that the constructor sets the internal state of the 44 | // Widget class correctly. 45 | TEST(WidgetInitializerTest, TestConstructor) { 46 | Widget widget(1.0f, "name"); 47 | EXPECT_FLOAT_EQ(1.0f, widget.GetFloatValue()); 48 | EXPECT_EQ(std::string("name"), widget.GetStringValue()); 49 | } 50 | 51 | // This test verifies the conversion of the float and string values to int and 52 | // char*, respectively. 53 | TEST(WidgetInitializerTest, TestConversion) { 54 | Widget widget(1.0f, "name"); 55 | EXPECT_EQ(1, widget.GetIntValue()); 56 | 57 | size_t max_size = 128; 58 | char buffer[max_size]; 59 | widget.GetCharPtrValue(buffer, max_size); 60 | EXPECT_STREQ("name", buffer); 61 | } 62 | 63 | // Use the Google Test main that is linked into the framework. It does something 64 | // like this: 65 | // int main(int argc, char** argv) { 66 | // testing::InitGoogleTest(&argc, argv); 67 | // return RUN_ALL_TESTS(); 68 | // } 69 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/make/Makefile: -------------------------------------------------------------------------------- 1 | # A sample Makefile for building Google Test and using it in user 2 | # tests. Please tweak it to suit your environment and project. You 3 | # may want to move it to your project's root directory. 4 | # 5 | # SYNOPSIS: 6 | # 7 | # make [all] - makes everything. 8 | # make TARGET - makes the given target. 9 | # make clean - removes all files generated by make. 10 | 11 | # Please tweak the following variable definitions as needed by your 12 | # project, except GTEST_HEADERS, which you can use in your own targets 13 | # but shouldn't modify. 14 | 15 | # Points to the root of Google Test, relative to where this file is. 16 | # Remember to tweak this if you move this file. 17 | GTEST_DIR = .. 18 | 19 | # Where to find user code. 20 | USER_DIR = ../samples 21 | 22 | # Flags passed to the preprocessor. 23 | # Set Google Test's header directory as a system directory, such that 24 | # the compiler doesn't generate warnings in Google Test headers. 25 | CPPFLAGS += -isystem $(GTEST_DIR)/include 26 | 27 | # Flags passed to the C++ compiler. 28 | CXXFLAGS += -g -Wall -Wextra -pthread 29 | 30 | # All tests produced by this Makefile. Remember to add new tests you 31 | # created to the list. 32 | TESTS = sample1_unittest 33 | 34 | # All Google Test headers. Usually you shouldn't change this 35 | # definition. 36 | GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \ 37 | $(GTEST_DIR)/include/gtest/internal/*.h 38 | 39 | # House-keeping build targets. 40 | 41 | all : $(TESTS) 42 | 43 | clean : 44 | rm -f $(TESTS) gtest.a gtest_main.a *.o 45 | 46 | # Builds gtest.a and gtest_main.a. 47 | 48 | # Usually you shouldn't tweak such internal variables, indicated by a 49 | # trailing _. 50 | GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS) 51 | 52 | # For simplicity and to avoid depending on Google Test's 53 | # implementation details, the dependencies specified below are 54 | # conservative and not optimized. This is fine as Google Test 55 | # compiles fast and for ordinary users its source rarely changes. 56 | gtest-all.o : $(GTEST_SRCS_) 57 | $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \ 58 | $(GTEST_DIR)/src/gtest-all.cc 59 | 60 | gtest_main.o : $(GTEST_SRCS_) 61 | $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \ 62 | $(GTEST_DIR)/src/gtest_main.cc 63 | 64 | gtest.a : gtest-all.o 65 | $(AR) $(ARFLAGS) $@ $^ 66 | 67 | gtest_main.a : gtest-all.o gtest_main.o 68 | $(AR) $(ARFLAGS) $@ $^ 69 | 70 | # Builds a sample test. A test should link with either gtest.a or 71 | # gtest_main.a, depending on whether it defines its own main() 72 | # function. 73 | 74 | sample1.o : $(USER_DIR)/sample1.cc $(USER_DIR)/sample1.h $(GTEST_HEADERS) 75 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/sample1.cc 76 | 77 | sample1_unittest.o : $(USER_DIR)/sample1_unittest.cc \ 78 | $(USER_DIR)/sample1.h $(GTEST_HEADERS) 79 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/sample1_unittest.cc 80 | 81 | sample1_unittest : sample1.o sample1_unittest.o gtest_main.a 82 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ 83 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest-param-test2_test.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: vladl@google.com (Vlad Losev) 31 | // 32 | // Tests for Google Test itself. This verifies that the basic constructs of 33 | // Google Test work. 34 | 35 | #include "gtest/gtest.h" 36 | 37 | #include "test/gtest-param-test_test.h" 38 | 39 | #if GTEST_HAS_PARAM_TEST 40 | 41 | using ::testing::Values; 42 | using ::testing::internal::ParamGenerator; 43 | 44 | // Tests that generators defined in a different translation unit 45 | // are functional. The test using extern_gen is defined 46 | // in gtest-param-test_test.cc. 47 | ParamGenerator extern_gen = Values(33); 48 | 49 | // Tests that a parameterized test case can be defined in one translation unit 50 | // and instantiated in another. The test is defined in gtest-param-test_test.cc 51 | // and ExternalInstantiationTest fixture class is defined in 52 | // gtest-param-test_test.h. 53 | INSTANTIATE_TEST_CASE_P(MultiplesOf33, 54 | ExternalInstantiationTest, 55 | Values(33, 66)); 56 | 57 | // Tests that a parameterized test case can be instantiated 58 | // in multiple translation units. Another instantiation is defined 59 | // in gtest-param-test_test.cc and InstantiationInMultipleTranslaionUnitsTest 60 | // fixture is defined in gtest-param-test_test.h 61 | INSTANTIATE_TEST_CASE_P(Sequence2, 62 | InstantiationInMultipleTranslaionUnitsTest, 63 | Values(42*3, 42*4, 42*5)); 64 | 65 | #endif // GTEST_HAS_PARAM_TEST 66 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/wrjpgcom.1: -------------------------------------------------------------------------------- 1 | .TH WRJPGCOM 1 "15 June 1995" 2 | .SH NAME 3 | wrjpgcom \- insert text comments into a JPEG file 4 | .SH SYNOPSIS 5 | .B wrjpgcom 6 | [ 7 | .B \-replace 8 | ] 9 | [ 10 | .BI \-comment " text" 11 | ] 12 | [ 13 | .BI \-cfile " name" 14 | ] 15 | [ 16 | .I filename 17 | ] 18 | .LP 19 | .SH DESCRIPTION 20 | .LP 21 | .B wrjpgcom 22 | reads the named JPEG/JFIF file, or the standard input if no file is named, 23 | and generates a new JPEG/JFIF file on standard output. A comment block is 24 | added to the file. 25 | .PP 26 | The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. 27 | Although the standard doesn't actually define what COM blocks are for, they 28 | are widely used to hold user-supplied text strings. This lets you add 29 | annotations, titles, index terms, etc to your JPEG files, and later retrieve 30 | them as text. COM blocks do not interfere with the image stored in the JPEG 31 | file. The maximum size of a COM block is 64K, but you can have as many of 32 | them as you like in one JPEG file. 33 | .PP 34 | .B wrjpgcom 35 | adds a COM block, containing text you provide, to a JPEG file. 36 | Ordinarily, the COM block is added after any existing COM blocks; but you 37 | can delete the old COM blocks if you wish. 38 | .SH OPTIONS 39 | Switch names may be abbreviated, and are not case sensitive. 40 | .TP 41 | .B \-replace 42 | Delete any existing COM blocks from the file. 43 | .TP 44 | .BI \-comment " text" 45 | Supply text for new COM block on command line. 46 | .TP 47 | .BI \-cfile " name" 48 | Read text for new COM block from named file. 49 | .PP 50 | If you have only one line of comment text to add, you can provide it on the 51 | command line with 52 | .BR \-comment . 53 | The comment text must be surrounded with quotes so that it is treated as a 54 | single argument. Longer comments can be read from a text file. 55 | .PP 56 | If you give neither 57 | .B \-comment 58 | nor 59 | .BR \-cfile , 60 | then 61 | .B wrjpgcom 62 | will read the comment text from standard input. (In this case an input image 63 | file name MUST be supplied, so that the source JPEG file comes from somewhere 64 | else.) You can enter multiple lines, up to 64KB worth. Type an end-of-file 65 | indicator (usually control-D) to terminate the comment text entry. 66 | .PP 67 | .B wrjpgcom 68 | will not add a COM block if the provided comment string is empty. Therefore 69 | \fB\-replace \-comment ""\fR can be used to delete all COM blocks from a file. 70 | .SH EXAMPLES 71 | .LP 72 | Add a short comment to in.jpg, producing out.jpg: 73 | .IP 74 | .B wrjpgcom \-c 75 | \fI"View of my back yard" in.jpg 76 | .B > 77 | .I out.jpg 78 | .PP 79 | Attach a long comment previously stored in comment.txt: 80 | .IP 81 | .B wrjpgcom 82 | .I in.jpg 83 | .B < 84 | .I comment.txt 85 | .B > 86 | .I out.jpg 87 | .PP 88 | or equivalently 89 | .IP 90 | .B wrjpgcom 91 | .B -cfile 92 | .I comment.txt 93 | .B < 94 | .I in.jpg 95 | .B > 96 | .I out.jpg 97 | .SH SEE ALSO 98 | .BR cjpeg (1), 99 | .BR djpeg (1), 100 | .BR jpegtran (1), 101 | .BR rdjpgcom (1) 102 | .SH AUTHOR 103 | Independent JPEG Group 104 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/test/parser_test.cc: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "parser/parser.h" 3 | #include "parser/error.h" 4 | 5 | using namespace program_options; 6 | 7 | TEST(TestParser, Parsing) { 8 | Parser parser; 9 | EXPECT_THROW(parser.parse("path/to/program -"), ParseError); 10 | EXPECT_THROW(parser.parse("path/to/program --"), ParseError); 11 | EXPECT_THROW(parser.parse("path/to/program -="), ParseError); 12 | EXPECT_THROW(parser.parse("path/to/program -o -"), ParseError); 13 | EXPECT_THROW(parser.parse("path/to/program -o --"), ParseError); 14 | EXPECT_THROW(parser.parse("path/to/program abc def"), ParseError); 15 | 16 | EXPECT_NO_THROW(parser.parse("path/to/program -g")); 17 | EXPECT_NO_THROW(parser.parse("path/to/program --g")); 18 | EXPECT_NO_THROW(parser.parse("path/to/program -a -b -c")); 19 | EXPECT_NO_THROW(parser.parse("path/to/program -abc")); 20 | EXPECT_NO_THROW(parser.parse("path/to/program -g-")); 21 | EXPECT_NO_THROW(parser.parse("path/to/program --g-")); 22 | EXPECT_NO_THROW(parser.parse("path/to/program -g,.%!")); 23 | EXPECT_NO_THROW(parser.parse("path/to/program -o=")); 24 | } 25 | 26 | TEST(TestParser, Checking) { 27 | Parser parser; 28 | parser.parse("path/to/program -o --option -a -xyz"); 29 | EXPECT_TRUE(parser.has("o")); 30 | EXPECT_TRUE(parser.has("option")); 31 | EXPECT_TRUE(parser.has("-oa")); 32 | EXPECT_TRUE(parser.has("y")); 33 | EXPECT_TRUE(parser.has("z")); 34 | EXPECT_TRUE(parser.has("-zy")); 35 | EXPECT_TRUE(parser.has_and({"o", "a"})); 36 | EXPECT_TRUE(parser.has_and({"o", "option"})); 37 | EXPECT_TRUE(parser.has_or({"o", "k"})); 38 | 39 | EXPECT_FALSE(parser.has("")); 40 | EXPECT_FALSE(parser.has("k")); 41 | EXPECT_FALSE(parser.has("ok")); 42 | EXPECT_FALSE(parser.has_and({"-ao", "k"})); 43 | EXPECT_FALSE(parser.has_and({})); 44 | EXPECT_FALSE(parser.has_or({})); 45 | } 46 | 47 | TEST(TestParser, Accessing) { 48 | Parser parser; 49 | parser.parse( 50 | "path/to/program -o 1 --option 2.3 -p=micooz --person=micooz -xyz 30"); 51 | EXPECT_NE(parser.get("o"), nullptr); 52 | EXPECT_NE(parser.get("option"), nullptr); 53 | EXPECT_NE(parser.get("p"), nullptr); 54 | EXPECT_NE(parser.get("person"), nullptr); 55 | 56 | EXPECT_EQ(parser.get("k"), nullptr); 57 | EXPECT_EQ(parser.get("o")->as(), 1); 58 | EXPECT_EQ(parser.get("z")->as(), 30); 59 | EXPECT_EQ(parser.get("p")->val(), parser.get("person")->as()); 60 | 61 | EXPECT_DOUBLE_EQ(parser.get("option")->as(), 2.3); 62 | EXPECT_STREQ(parser.get("p")->val().c_str(), "micooz"); 63 | } 64 | 65 | TEST(TestParser, Overwriting) { 66 | Parser parser; 67 | parser.parse("path/to/program -o hello -o world"); 68 | EXPECT_STREQ(parser.get("o")->val().c_str(), "world"); 69 | } 70 | 71 | TEST(TestParser, Subroutine) { 72 | Parser parser; 73 | parser.parse("path/to/program subroutine -o 1 -p=q"); 74 | EXPECT_EQ(parser.get("o")->as(), 1); 75 | EXPECT_STREQ(parser.get_subroutine_name().c_str(), "subroutine"); 76 | EXPECT_STREQ(parser.get("p")->val().c_str(), "q"); 77 | } 78 | 79 | int main(int argc, char *argv[]) { 80 | testing::InitGoogleTest(&argc, argv); 81 | return RUN_ALL_TESTS(); 82 | } 83 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_color_test_.cc: -------------------------------------------------------------------------------- 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 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | // A helper program for testing how Google Test determines whether to use 33 | // colors in the output. It prints "YES" and returns 1 if Google Test 34 | // decides to use colors, and prints "NO" and returns 0 otherwise. 35 | 36 | #include 37 | 38 | #include "gtest/gtest.h" 39 | 40 | // Indicates that this translation unit is part of Google Test's 41 | // implementation. It must come before gtest-internal-inl.h is 42 | // included, or there will be a compiler error. This trick is to 43 | // prevent a user from accidentally including gtest-internal-inl.h in 44 | // his code. 45 | #define GTEST_IMPLEMENTATION_ 1 46 | #include "src/gtest-internal-inl.h" 47 | #undef GTEST_IMPLEMENTATION_ 48 | 49 | using testing::internal::ShouldUseColor; 50 | 51 | // The purpose of this is to ensure that the UnitTest singleton is 52 | // created before main() is entered, and thus that ShouldUseColor() 53 | // works the same way as in a real Google-Test-based test. We don't actual 54 | // run the TEST itself. 55 | TEST(GTestColorTest, Dummy) { 56 | } 57 | 58 | int main(int argc, char** argv) { 59 | testing::InitGoogleTest(&argc, argv); 60 | 61 | if (ShouldUseColor(true)) { 62 | // Google Test decides to use colors in the output (assuming it 63 | // goes to a TTY). 64 | printf("YES\n"); 65 | return 1; 66 | } else { 67 | // Google Test decides not to use colors in the output. 68 | printf("NO\n"); 69 | return 0; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jcinit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jcinit.c 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * Modified 2003-2013 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file contains initialization logic for the JPEG compressor. 10 | * This routine is in charge of selecting the modules to be executed and 11 | * making an initialization call to each one. 12 | * 13 | * Logically, this code belongs in jcmaster.c. It's split out because 14 | * linking this routine implies linking the entire compression library. 15 | * For a transcoding-only application, we want to be able to use jcmaster.c 16 | * without linking in the whole library. 17 | */ 18 | 19 | #define JPEG_INTERNALS 20 | #include "jinclude.h" 21 | #include "jpeglib.h" 22 | 23 | 24 | /* 25 | * Master selection of compression modules. 26 | * This is done once at the start of processing an image. We determine 27 | * which modules will be used and give them appropriate initialization calls. 28 | */ 29 | 30 | GLOBAL(void) 31 | jinit_compress_master (j_compress_ptr cinfo) 32 | { 33 | long samplesperrow; 34 | JDIMENSION jd_samplesperrow; 35 | 36 | /* For now, precision must match compiled-in value... */ 37 | if (cinfo->data_precision != BITS_IN_JSAMPLE) 38 | ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); 39 | 40 | /* Sanity check on image dimensions */ 41 | if (cinfo->image_height <= 0 || cinfo->image_width <= 0 || 42 | cinfo->input_components <= 0) 43 | ERREXIT(cinfo, JERR_EMPTY_IMAGE); 44 | 45 | /* Width of an input scanline must be representable as JDIMENSION. */ 46 | samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components; 47 | jd_samplesperrow = (JDIMENSION) samplesperrow; 48 | if ((long) jd_samplesperrow != samplesperrow) 49 | ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); 50 | 51 | /* Initialize master control (includes parameter checking/processing) */ 52 | jinit_c_master_control(cinfo, FALSE /* full compression */); 53 | 54 | /* Preprocessing */ 55 | if (! cinfo->raw_data_in) { 56 | jinit_color_converter(cinfo); 57 | jinit_downsampler(cinfo); 58 | jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); 59 | } 60 | /* Forward DCT */ 61 | jinit_forward_dct(cinfo); 62 | /* Entropy encoding: either Huffman or arithmetic coding. */ 63 | if (cinfo->arith_code) 64 | jinit_arith_encoder(cinfo); 65 | else { 66 | jinit_huff_encoder(cinfo); 67 | } 68 | 69 | /* Need a full-image coefficient buffer in any multi-pass mode. */ 70 | jinit_c_coef_controller(cinfo, 71 | (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding)); 72 | jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); 73 | 74 | jinit_marker_writer(cinfo); 75 | 76 | /* We can now tell the memory manager to allocate virtual arrays. */ 77 | (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); 78 | 79 | /* Write the datastream header (SOI) immediately. 80 | * Frame and scan headers are postponed till later. 81 | * This lets application insert special markers after the SOI. 82 | */ 83 | (*cinfo->marker->write_file_header) (cinfo); 84 | } 85 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/src/generator/generator.cc: -------------------------------------------------------------------------------- 1 | #include "generator/generator.h" 2 | #include "parser/parser.h" 3 | 4 | namespace program_options { 5 | 6 | Generator::Generator() : parser_(nullptr) { 7 | current_subroutine_ = Subroutine::get_default_name(); 8 | add_subroutine(current_subroutine_.c_str()); 9 | } 10 | 11 | Generator::~Generator() { 12 | if (parser_) { 13 | delete parser_; 14 | parser_ = nullptr; 15 | } 16 | for (auto it = subroutines_.begin(); it != subroutines_.end(); ++it) { 17 | if (it->second) { 18 | delete it->second; 19 | it->second = nullptr; 20 | } 21 | } 22 | } 23 | 24 | Generator& Generator::make_usage(const char* first_line) { 25 | get_subroutine()->set_first_line(first_line); 26 | return *this; 27 | } 28 | 29 | Parser* Generator::make_parser() { 30 | if (parser_) delete parser_; 31 | parser_ = new Parser; 32 | parser_->set_usage_subroutines(&subroutines_); 33 | return parser_; 34 | } 35 | 36 | Generator& Generator::add_subroutine(const char* name) { 37 | add_subroutine(name, ""); 38 | return *this; 39 | } 40 | 41 | Generator& Generator::add_subroutine(const char* name, 42 | const char* description) { 43 | if (subroutines_.find(name) == subroutines_.end()) { 44 | // a new subroutine 45 | current_subroutine_ = name; 46 | Subroutine* routine = new Subroutine(name, description); 47 | subroutines_.insert({current_subroutine_, routine}); 48 | } 49 | return *this; 50 | } 51 | 52 | std::map Generator::get_subroutine_list() { 53 | std::map kv; 54 | for (auto pr : subroutines_) { 55 | Subroutine* subroutine = pr.second; 56 | if (subroutine->get_name() != Subroutine::get_default_name()) 57 | kv[subroutine->get_name()] = subroutine->get_description(); 58 | } 59 | return std::move(kv); 60 | } 61 | 62 | bool Generator::add_usage_line(const char* option, const char* default_value, 63 | const char* description) { 64 | std::string option_str(option); 65 | auto delimiter_pos = option_str.find(kDelimiter); 66 | 67 | std::string option_short; 68 | std::string option_long; 69 | 70 | if (delimiter_pos != std::string::npos) { 71 | option_short.assign(std::move(option_str.substr(0, delimiter_pos))); 72 | option_long.assign(std::move(option_str.substr(delimiter_pos + 1))); 73 | 74 | Row row; 75 | row.oshort(option_short); 76 | row.olong(option_long); 77 | row.value(default_value); 78 | row.desc(description); 79 | 80 | get_subroutine()->add_usage_line(row); 81 | return true; 82 | } 83 | return false; 84 | } 85 | 86 | std::ostream& operator<<(std::ostream& out, Generator& generator) { 87 | for (auto pr : generator.subroutines_) { 88 | Subroutine* subroutine = pr.second; 89 | if (subroutine->get_name() != Subroutine::get_default_name()) { 90 | out << subroutine->get_name() << "\t"; 91 | } 92 | out << subroutine->get_description(); 93 | if (!subroutine->get_usage().empty()) { 94 | out << std::endl; 95 | } 96 | out << *subroutine; 97 | } 98 | return out; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/Bitmap.cpp: -------------------------------------------------------------------------------- 1 | #include "Bitmap.h" 2 | 3 | Bitmap::Bitmap() 4 | : _pFile(nullptr), _data(nullptr), _width(0), _height(0), _depth(0) { 5 | 6 | } 7 | 8 | void 9 | Bitmap::save(const std::string& file, byte* data, 10 | unsigned long width, unsigned long height, 11 | uint16_t depth) { 12 | if (_pFile) { 13 | fclose(_pFile); 14 | } 15 | _data = data; 16 | _height = height; 17 | _width = width; 18 | _depth = depth; 19 | 20 | _pFile = fopen(file.c_str(), "wb"); 21 | write_bmp_header(); 22 | write_bmp_data(); 23 | fclose(_pFile); 24 | } 25 | 26 | void 27 | Bitmap::write_bmp_header() { 28 | bmp_fileheader bfh; 29 | bmp_infoheader bih; 30 | 31 | unsigned long width; 32 | unsigned long height; 33 | unsigned short depth; 34 | unsigned long headersize; 35 | unsigned long filesize; 36 | 37 | width = _width; 38 | height = _height; 39 | depth = _depth; 40 | 41 | if (depth == 1) { 42 | headersize = 14 + 40 + 256 * 4; 43 | filesize = headersize + width * height; 44 | } 45 | 46 | if (depth == 3) { 47 | headersize = 14 + 40; 48 | filesize = headersize + width * height * depth; 49 | } 50 | 51 | memset(&bfh, 0, sizeof(bmp_fileheader)); 52 | memset(&bih, 0, sizeof(bmp_infoheader)); 53 | 54 | bfh.bfType = 0x4D42; 55 | bfh.bfSize = filesize; 56 | bfh.bfOffBits = headersize; 57 | 58 | bih.biSize = 40; 59 | bih.biWidth = width; 60 | bih.biHeight = height; 61 | bih.biPlanes = 1; 62 | bih.biBitCount = (unsigned short) depth * 8; 63 | bih.biSizeImage = width * height * depth; 64 | 65 | fwrite(&bfh, sizeof(struct bmp_fileheader), 1, _pFile); 66 | fwrite(&bih, sizeof(struct bmp_infoheader), 1, _pFile); 67 | 68 | if (depth == 1) { 69 | byte* platte; 70 | platte = new byte[256 * 4]; 71 | byte j = 0; 72 | for (int i = 0; i < 1024; i += 4) { 73 | platte[i] = j; 74 | platte[i + 1] = j; 75 | platte[i + 2] = j; 76 | platte[i + 3] = 0; 77 | j++; 78 | } 79 | fwrite(platte, sizeof(byte) * 1024, 1, _pFile); 80 | delete[] platte; 81 | } 82 | } 83 | 84 | void 85 | Bitmap::write_bmp_data() { 86 | byte* dst_width_buff; 87 | byte* point; 88 | 89 | unsigned long width; 90 | unsigned long height; 91 | unsigned short depth; 92 | 93 | width = _width; 94 | height = _height; 95 | depth = _depth; 96 | 97 | dst_width_buff = new byte[width * depth]; 98 | memset(dst_width_buff, 0, sizeof(byte) * width * depth); 99 | 100 | point = _data + width * depth * (height - 1); 101 | for (unsigned long i = 0; i < height; i++) { 102 | for (unsigned long j = 0; j < width * depth; j += depth) { 103 | if (depth == 1) { 104 | dst_width_buff[j] = point[j]; 105 | } 106 | if (depth == 3) { 107 | dst_width_buff[j + 2] = point[j + 0]; 108 | dst_width_buff[j + 1] = point[j + 1]; 109 | dst_width_buff[j + 0] = point[j + 2]; 110 | } 111 | } 112 | point -= width * depth; 113 | fwrite(dst_width_buff, sizeof(byte) * width * depth, 1, _pFile); 114 | } 115 | } 116 | 117 | Bitmap::~Bitmap() { 118 | if (_pFile) { 119 | fclose(_pFile); 120 | _pFile = nullptr; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/include/generator/generator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * generator 3 | * (c) Copyright 2015 Micooz 4 | * 5 | * Released under the Apache License. 6 | * See the LICENSE file or 7 | * http://www.apache.org/licenses/LICENSE-2.0.txt for more information. 8 | */ 9 | #ifndef GENERATOR_GENERATOR_H_ 10 | #define GENERATOR_GENERATOR_H_ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include "subroutine.h" 18 | 19 | namespace program_options { 20 | 21 | class Parser; 22 | 23 | class Generator { 24 | public: 25 | typedef std::map SubroutineCollection; 26 | 27 | Generator(); 28 | 29 | ~Generator(); 30 | 31 | // begin a new usage generate process and 32 | // create the first line that you will see in the result. 33 | // if you don't want to create the first line, 34 | // it's ok to create your usage lines without calling make_usage() first. 35 | Generator& make_usage(const char* first_line); 36 | 37 | Parser* make_parser(); 38 | 39 | // generate usage lines for a subroutine. 40 | Generator& add_subroutine(const char* name); 41 | 42 | Generator& add_subroutine(const char* name, const char* description); 43 | 44 | // get pairs of subroutine name and its description. 45 | std::map get_subroutine_list(); 46 | 47 | // generate and return the result as std::string 48 | inline std::string to_string() { 49 | std::stringstream ss; 50 | ss << *this; 51 | return std::move(ss.str()); 52 | } 53 | 54 | // add an usage line, it doesn't require a value 55 | inline Generator& operator()(const char* option, const char* description) { 56 | this->add_usage_line(option, "", description); 57 | (get_subroutine()->end() - 1)->required(false); 58 | return *this; 59 | } 60 | 61 | // add an usage line, it requires a value(may has a default value) 62 | inline Generator& operator()(const char* option, const char* default_value, 63 | const char* description) { 64 | this->add_usage_line(option, default_value, description); 65 | return *this; 66 | } 67 | 68 | // this method is for subroutine usage printing. 69 | // e.g., cout << generator("subroutine_name"); 70 | inline Subroutine& operator()(const char* name) { 71 | return *subroutines_.at(name); 72 | } 73 | 74 | inline Generator& make_template(const char* template_str, 75 | const Row::Order& order) { 76 | get_subroutine()->set_template(template_str, order); 77 | return *this; 78 | } 79 | 80 | private: 81 | inline Subroutine* get_subroutine() { 82 | return subroutines_.at(current_subroutine_); 83 | } 84 | 85 | friend std::ostream& operator<<(std::ostream& out, Generator& generator); 86 | 87 | // add a usage line. 88 | // if delimiter doesn't exist, return false 89 | bool add_usage_line(const char* option, const char* default_value, 90 | const char* description); 91 | 92 | const char kDelimiter = ','; 93 | SubroutineCollection subroutines_; 94 | std::string current_subroutine_; 95 | Parser* parser_; 96 | }; 97 | } 98 | 99 | #endif // GENERATOR_GENERATOR_H_ 100 | -------------------------------------------------------------------------------- /vendor/jpeg-9a/jmemnobs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jmemnobs.c 3 | * 4 | * Copyright (C) 1992-1996, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file provides a really simple implementation of the system- 9 | * dependent portion of the JPEG memory manager. This implementation 10 | * assumes that no backing-store files are needed: all required space 11 | * can be obtained from malloc(). 12 | * This is very portable in the sense that it'll compile on almost anything, 13 | * but you'd better have lots of main memory (or virtual memory) if you want 14 | * to process big images. 15 | * Note that the max_memory_to_use option is ignored by this implementation. 16 | */ 17 | 18 | #define JPEG_INTERNALS 19 | #include "jinclude.h" 20 | #include "jpeglib.h" 21 | #include "jmemsys.h" /* import the system-dependent declarations */ 22 | 23 | #ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ 24 | extern void * malloc JPP((size_t size)); 25 | extern void free JPP((void *ptr)); 26 | #endif 27 | 28 | 29 | /* 30 | * Memory allocation and freeing are controlled by the regular library 31 | * routines malloc() and free(). 32 | */ 33 | 34 | GLOBAL(void *) 35 | jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) 36 | { 37 | return (void *) malloc(sizeofobject); 38 | } 39 | 40 | GLOBAL(void) 41 | jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) 42 | { 43 | free(object); 44 | } 45 | 46 | 47 | /* 48 | * "Large" objects are treated the same as "small" ones. 49 | * NB: although we include FAR keywords in the routine declarations, 50 | * this file won't actually work in 80x86 small/medium model; at least, 51 | * you probably won't be able to process useful-size images in only 64KB. 52 | */ 53 | 54 | GLOBAL(void FAR *) 55 | jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) 56 | { 57 | return (void FAR *) malloc(sizeofobject); 58 | } 59 | 60 | GLOBAL(void) 61 | jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) 62 | { 63 | free(object); 64 | } 65 | 66 | 67 | /* 68 | * This routine computes the total memory space available for allocation. 69 | * Here we always say, "we got all you want bud!" 70 | */ 71 | 72 | GLOBAL(long) 73 | jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, 74 | long max_bytes_needed, long already_allocated) 75 | { 76 | return max_bytes_needed; 77 | } 78 | 79 | 80 | /* 81 | * Backing store (temporary file) management. 82 | * Since jpeg_mem_available always promised the moon, 83 | * this should never be called and we can just error out. 84 | */ 85 | 86 | GLOBAL(void) 87 | jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, 88 | long total_bytes_needed) 89 | { 90 | ERREXIT(cinfo, JERR_NO_BACKING_STORE); 91 | } 92 | 93 | 94 | /* 95 | * These routines take care of any system-dependent initialization and 96 | * cleanup required. Here, there isn't any. 97 | */ 98 | 99 | GLOBAL(long) 100 | jpeg_mem_init (j_common_ptr cinfo) 101 | { 102 | return 0; /* just set max_memory_to_use to 0 */ 103 | } 104 | 105 | GLOBAL(void) 106 | jpeg_mem_term (j_common_ptr cinfo) 107 | { 108 | /* no work */ 109 | } 110 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/samples/sample2.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, 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 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #ifndef GTEST_SAMPLES_SAMPLE2_H_ 35 | #define GTEST_SAMPLES_SAMPLE2_H_ 36 | 37 | #include 38 | 39 | 40 | // A simple string class. 41 | class MyString { 42 | private: 43 | const char* c_string_; 44 | const MyString& operator=(const MyString& rhs); 45 | 46 | public: 47 | // Clones a 0-terminated C string, allocating memory using new. 48 | static const char* CloneCString(const char* a_c_string); 49 | 50 | //////////////////////////////////////////////////////////// 51 | // 52 | // C'tors 53 | 54 | // The default c'tor constructs a NULL string. 55 | MyString() : c_string_(NULL) {} 56 | 57 | // Constructs a MyString by cloning a 0-terminated C string. 58 | explicit MyString(const char* a_c_string) : c_string_(NULL) { 59 | Set(a_c_string); 60 | } 61 | 62 | // Copy c'tor 63 | MyString(const MyString& string) : c_string_(NULL) { 64 | Set(string.c_string_); 65 | } 66 | 67 | //////////////////////////////////////////////////////////// 68 | // 69 | // D'tor. MyString is intended to be a final class, so the d'tor 70 | // doesn't need to be virtual. 71 | ~MyString() { delete[] c_string_; } 72 | 73 | // Gets the 0-terminated C string this MyString object represents. 74 | const char* c_string() const { return c_string_; } 75 | 76 | size_t Length() const { 77 | return c_string_ == NULL ? 0 : strlen(c_string_); 78 | } 79 | 80 | // Sets the 0-terminated C string this MyString object represents. 81 | void Set(const char* c_string); 82 | }; 83 | 84 | 85 | #endif // GTEST_SAMPLES_SAMPLE2_H_ 86 | -------------------------------------------------------------------------------- /src/Slice.cpp: -------------------------------------------------------------------------------- 1 | #include "Slice.h" 2 | #include "IImage.h" 3 | #include "Bitmap.h" 4 | 5 | Slice::Slice() 6 | : _x1(0), _x2(0), _y1(0), _y2(0), _data(nullptr), _symbol(0) { 7 | } 8 | 9 | Slice::Slice(IImage* base, uint32_t x1, uint32_t y1, uint32_t x2, 10 | uint32_t y2)//,bool copied) 11 | : _x1(x1), _x2(x2), _y1(y1), _y2(y2), _data(nullptr), _symbol(0) { 12 | 13 | uint32_t width = base->getWidth(); 14 | bool* pLattice = base->getLattice(); 15 | byte* pData = base->getData(); 16 | size_t pixels = (_x2 - _x1) * (_y2 - _y1); 17 | 18 | _code.reserve(pixels); 19 | 20 | //if (copied) { 21 | _data = new byte[pixels * 3]; 22 | //} 23 | byte* pDst = _data; 24 | for (size_t y = _y1; y < _y2; ++y) { 25 | for (size_t x = _x1; x < _x2; ++x) { 26 | _code.push_back(pLattice[y * width + x]); 27 | //copied data 28 | //if (copied) { 29 | byte* pSrc = pData + (y * width + x) * 3; 30 | 31 | pDst[0] = pSrc[0]; 32 | pDst[1] = pSrc[1]; 33 | pDst[2] = pSrc[2]; 34 | 35 | pDst += 3; 36 | //} 37 | } 38 | } 39 | } 40 | 41 | Slice::Slice(const Slice& slice) { 42 | _code = slice._code; 43 | _symbol = slice._symbol; 44 | _x1 = slice._x1; 45 | _x2 = slice._x2; 46 | _y1 = slice._y1; 47 | _y2 = slice._y2; 48 | 49 | size_t pixels = (_x2 - _x1) * (_y2 - _y1); 50 | 51 | _data = new byte[pixels * 3]; 52 | //make deep copy 53 | memcpy(_data, slice._data, pixels * 3); 54 | } 55 | 56 | uint32_t Slice::getX1() const { 57 | return _x1; 58 | } 59 | 60 | uint32_t Slice::getX2() const { 61 | return _x2; 62 | } 63 | 64 | uint32_t Slice::getY1() const { 65 | return _y1; 66 | } 67 | 68 | uint32_t Slice::getY2() const { 69 | return _y2; 70 | } 71 | 72 | char Slice::getSymbol() const { 73 | return _symbol; 74 | } 75 | 76 | uint32_t Slice::getWidth() const { 77 | return _x2 - _x1; 78 | } 79 | 80 | uint32_t Slice::getHeight() const { 81 | return _y2 - _y1; 82 | } 83 | 84 | AttributeCode Slice::getCode() const { 85 | return _code; 86 | } 87 | 88 | void Slice::setCode(const AttributeCode& code) { 89 | _code = code; 90 | } 91 | 92 | void Slice::setSymbol(char symbol) { 93 | _symbol = symbol; 94 | } 95 | 96 | float Slice::similarTo(Slice& slice) { 97 | AttributeCode sc = slice.getCode(); 98 | AttributeCode tc = this->getCode(); 99 | size_t slen = sc.size(); 100 | size_t tlen = tc.size(); 101 | int eq_true = 0; 102 | size_t total = slen; 103 | 104 | for (size_t i = 0; i < total; ++i) { 105 | //to prevent cross-border 106 | if (i >= tlen) 107 | break; 108 | if (sc.at(i)) { 109 | if (sc.at(i) == tc.at(i)) 110 | ++eq_true; 111 | } 112 | } 113 | return (float) eq_true / 114 | ((slen < tlen) ? tlen : slen);// std::fmin(slen, tlen); 115 | } 116 | 117 | void Slice::save(const std::string& file) { 118 | if (_data) { 119 | Bitmap bmp; 120 | bmp.save(file, _data, getWidth(), getHeight(), 3); 121 | } 122 | } 123 | 124 | Slice::~Slice() { 125 | if (_data) { 126 | delete[] _data; 127 | _data = nullptr; 128 | } 129 | //std::cout << "Slice Destroy." << std::endl; 130 | } 131 | 132 | std::ostream& operator<<(std::ostream& out, const AttributeCode& code) { 133 | for (auto c : code) 134 | out << c; 135 | out << std::endl; 136 | return out; 137 | } 138 | -------------------------------------------------------------------------------- /vendor/ProgramOptions/googletest/test/gtest_throw_on_failure_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, 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 | // Tests Google Test's throw-on-failure mode with exceptions disabled. 33 | // 34 | // This program must be compiled with exceptions disabled. It will be 35 | // invoked by gtest_throw_on_failure_test.py, and is expected to exit 36 | // with non-zero in the throw-on-failure mode or 0 otherwise. 37 | 38 | #include "gtest/gtest.h" 39 | 40 | #include // for fflush, fprintf, NULL, etc. 41 | #include // for exit 42 | #include // for set_terminate 43 | 44 | // This terminate handler aborts the program using exit() rather than abort(). 45 | // This avoids showing pop-ups on Windows systems and core dumps on Unix-like 46 | // ones. 47 | void TerminateHandler() { 48 | fprintf(stderr, "%s\n", "Unhandled C++ exception terminating the program."); 49 | fflush(NULL); 50 | exit(1); 51 | } 52 | 53 | int main(int argc, char** argv) { 54 | #if GTEST_HAS_EXCEPTIONS 55 | std::set_terminate(&TerminateHandler); 56 | #endif 57 | testing::InitGoogleTest(&argc, argv); 58 | 59 | // We want to ensure that people can use Google Test assertions in 60 | // other testing frameworks, as long as they initialize Google Test 61 | // properly and set the throw-on-failure mode. Therefore, we don't 62 | // use Google Test's constructs for defining and running tests 63 | // (e.g. TEST and RUN_ALL_TESTS) here. 64 | 65 | // In the throw-on-failure mode with exceptions disabled, this 66 | // assertion will cause the program to exit with a non-zero code. 67 | EXPECT_EQ(2, 3); 68 | 69 | // When not in the throw-on-failure mode, the control will reach 70 | // here. 71 | return 0; 72 | } 73 | --------------------------------------------------------------------------------