├── .gitignore ├── .gitmodules ├── Doxyfile ├── README.md ├── bin ├── nets │ ├── bypassAuthentication.net │ ├── dataAccess.net │ ├── dataModification.net │ ├── denialOfService.net │ ├── fingerprinting.net │ └── schema.net └── sqlassie.conf ├── license.txt └── src ├── AlwaysSomethingNode.cpp ├── AlwaysSomethingNode.hpp ├── AstNode.cpp ├── AstNode.hpp ├── AttackProbabilities.cpp ├── AttackProbabilities.hpp ├── AutoPtrWithOperatorParens.hpp ├── BayesException.hpp ├── ComparisonNode.cpp ├── ComparisonNode.hpp ├── ConditionalListNode.cpp ├── ConditionalListNode.hpp ├── ConditionalNode.cpp ├── ConditionalNode.hpp ├── DescribedException.hpp ├── DlibProbabilities.cpp ├── DlibProbabilities.hpp ├── ExpressionNode.cpp ├── ExpressionNode.hpp ├── InSubselectNode.cpp ├── InSubselectNode.hpp ├── InValuesListNode.cpp ├── InValuesListNode.hpp ├── ListenSocket.cpp ├── ListenSocket.hpp ├── Logger.cpp ├── Logger.hpp ├── LruCache.hpp ├── Makefile.clang ├── Makefile.common ├── Makefile.dependencies ├── Makefile.gcc ├── MessageHandler.cpp ├── MessageHandler.hpp ├── MySqlConstants.cpp ├── MySqlConstants.hpp ├── MySqlErrorMessageBlocker.cpp ├── MySqlErrorMessageBlocker.hpp ├── MySqlGuard.cpp ├── MySqlGuard.hpp ├── MySqlGuardListenSocket.cpp ├── MySqlGuardListenSocket.hpp ├── MySqlGuardObjectContainer.cpp ├── MySqlGuardObjectContainer.hpp ├── MySqlLogger.cpp ├── MySqlLogger.hpp ├── MySqlLoggerListenSocket.cpp ├── MySqlLoggerListenSocket.hpp ├── MySqlLoginCheck.cpp ├── MySqlLoginCheck.hpp ├── MySqlPrinter.cpp ├── MySqlPrinter.hpp ├── MySqlSocket.cpp ├── MySqlSocket.hpp ├── NegationNode.cpp ├── NegationNode.hpp ├── ParserInterface.cpp ├── ParserInterface.hpp ├── Proxy.cpp ├── Proxy.hpp ├── ProxyHalf.cpp ├── ProxyHalf.hpp ├── ProxyListenSocket.cpp ├── ProxyListenSocket.hpp ├── QueryRisk.cpp ├── QueryRisk.hpp ├── QueryWhitelist.cpp ├── QueryWhitelist.hpp ├── ScannerContext.cpp ├── ScannerContext.hpp ├── SensitiveNameChecker.cpp ├── SensitiveNameChecker.hpp ├── SimpleProxy.cpp ├── SimpleProxy.hpp ├── Socket.cpp ├── Socket.hpp ├── SocketException.hpp ├── accumulator.hpp ├── clearStack.hpp ├── csvParse.hpp ├── demo.cpp ├── dependencies.py ├── dlib ├── dlib │ ├── CMakeLists.txt │ ├── LICENSE.txt │ ├── README.txt │ ├── algs.h │ ├── all │ │ └── source.cpp │ ├── all_console.cpp │ ├── all_gui.cpp │ ├── any.h │ ├── any │ │ ├── any.h │ │ └── any_abstract.h │ ├── array.h │ ├── array │ │ ├── array_expand_1.h │ │ ├── array_expand_abstract.h │ │ ├── array_expand_c.h │ │ ├── array_kernel_1.h │ │ ├── array_kernel_2.h │ │ ├── array_kernel_abstract.h │ │ ├── array_kernel_c.h │ │ ├── array_sort_1.h │ │ ├── array_sort_2.h │ │ └── array_sort_abstract.h │ ├── array2d.h │ ├── array2d │ │ ├── array2d_kernel_1.h │ │ ├── array2d_kernel_abstract.h │ │ └── array2d_kernel_c.h │ ├── assert.h │ ├── base64.h │ ├── base64 │ │ ├── base64_kernel_1.cpp │ │ ├── base64_kernel_1.h │ │ └── base64_kernel_abstract.h │ ├── bayes_utils.h │ ├── bayes_utils │ │ ├── bayes_utils.h │ │ └── bayes_utils_abstract.h │ ├── bigint.h │ ├── bigint │ │ ├── bigint_kernel_1.cpp │ │ ├── bigint_kernel_1.h │ │ ├── bigint_kernel_2.cpp │ │ ├── bigint_kernel_2.h │ │ ├── bigint_kernel_abstract.h │ │ └── bigint_kernel_c.h │ ├── binary_search_tree.h │ ├── binary_search_tree │ │ ├── binary_search_tree_kernel_1.h │ │ ├── binary_search_tree_kernel_2.h │ │ ├── binary_search_tree_kernel_abstract.h │ │ └── binary_search_tree_kernel_c.h │ ├── bit_stream.h │ ├── bit_stream │ │ ├── bit_stream_kernel_1.cpp │ │ ├── bit_stream_kernel_1.h │ │ ├── bit_stream_kernel_abstract.h │ │ ├── bit_stream_kernel_c.h │ │ ├── bit_stream_multi_1.h │ │ ├── bit_stream_multi_abstract.h │ │ └── bit_stream_multi_c.h │ ├── bound_function_pointer.h │ ├── bound_function_pointer │ │ ├── bound_function_pointer_kernel_1.h │ │ ├── bound_function_pointer_kernel_abstract.h │ │ └── bound_function_pointer_kernel_c.h │ ├── byte_orderer.h │ ├── byte_orderer │ │ ├── byte_orderer_kernel_1.h │ │ └── byte_orderer_kernel_abstract.h │ ├── cassert │ ├── cmake_find_blas.txt │ ├── cmd_line_parser.h │ ├── cmd_line_parser │ │ ├── cmd_line_parser_check_1.h │ │ ├── cmd_line_parser_check_abstract.h │ │ ├── cmd_line_parser_check_c.h │ │ ├── cmd_line_parser_kernel_1.h │ │ ├── cmd_line_parser_kernel_abstract.h │ │ ├── cmd_line_parser_kernel_c.h │ │ ├── cmd_line_parser_print_1.h │ │ └── cmd_line_parser_print_abstract.h │ ├── compress_stream.h │ ├── compress_stream │ │ ├── compress_stream_kernel_1.h │ │ ├── compress_stream_kernel_2.h │ │ ├── compress_stream_kernel_3.h │ │ └── compress_stream_kernel_abstract.h │ ├── conditioning_class.h │ ├── conditioning_class │ │ ├── conditioning_class_kernel_1.h │ │ ├── conditioning_class_kernel_2.h │ │ ├── conditioning_class_kernel_3.h │ │ ├── conditioning_class_kernel_4.h │ │ ├── conditioning_class_kernel_abstract.h │ │ └── conditioning_class_kernel_c.h │ ├── config_reader.h │ ├── config_reader │ │ ├── config_reader_kernel_1.h │ │ ├── config_reader_kernel_abstract.h │ │ ├── config_reader_thread_safe_1.h │ │ └── config_reader_thread_safe_abstract.h │ ├── console_progress_indicator.h │ ├── cpp_pretty_printer.h │ ├── cpp_pretty_printer │ │ ├── cpp_pretty_printer_kernel_1.h │ │ ├── cpp_pretty_printer_kernel_2.h │ │ └── cpp_pretty_printer_kernel_abstract.h │ ├── cpp_tokenizer.h │ ├── cpp_tokenizer │ │ ├── cpp_tokenizer_kernel_1.h │ │ ├── cpp_tokenizer_kernel_abstract.h │ │ └── cpp_tokenizer_kernel_c.h │ ├── crc32.h │ ├── crc32 │ │ ├── crc32_kernel_1.h │ │ └── crc32_kernel_abstract.h │ ├── cstring │ ├── data_io.h │ ├── data_io │ │ ├── libsvm_io.h │ │ └── libsvm_io_abstract.h │ ├── dir_nav.h │ ├── dir_nav │ │ ├── dir_nav_extensions.cpp │ │ ├── dir_nav_extensions.h │ │ ├── dir_nav_extensions_abstract.h │ │ ├── dir_nav_kernel_1.cpp │ │ ├── dir_nav_kernel_1.h │ │ ├── dir_nav_kernel_2.cpp │ │ ├── dir_nav_kernel_2.h │ │ ├── dir_nav_kernel_abstract.h │ │ ├── posix.h │ │ └── windows.h │ ├── directed_graph.h │ ├── directed_graph │ │ ├── directed_graph_kernel_1.h │ │ └── directed_graph_kernel_abstract.h │ ├── dlib_include_path_tutorial.txt │ ├── enable_if.h │ ├── entropy_decoder.h │ ├── entropy_decoder │ │ ├── entropy_decoder_kernel_1.cpp │ │ ├── entropy_decoder_kernel_1.h │ │ ├── entropy_decoder_kernel_2.cpp │ │ ├── entropy_decoder_kernel_2.h │ │ ├── entropy_decoder_kernel_abstract.h │ │ └── entropy_decoder_kernel_c.h │ ├── entropy_decoder_model.h │ ├── entropy_decoder_model │ │ ├── entropy_decoder_model_kernel_1.h │ │ ├── entropy_decoder_model_kernel_2.h │ │ ├── entropy_decoder_model_kernel_3.h │ │ ├── entropy_decoder_model_kernel_4.h │ │ ├── entropy_decoder_model_kernel_5.h │ │ ├── entropy_decoder_model_kernel_6.h │ │ └── entropy_decoder_model_kernel_abstract.h │ ├── entropy_encoder.h │ ├── entropy_encoder │ │ ├── entropy_encoder_kernel_1.cpp │ │ ├── entropy_encoder_kernel_1.h │ │ ├── entropy_encoder_kernel_2.cpp │ │ ├── entropy_encoder_kernel_2.h │ │ ├── entropy_encoder_kernel_abstract.h │ │ └── entropy_encoder_kernel_c.h │ ├── entropy_encoder_model.h │ ├── entropy_encoder_model │ │ ├── entropy_encoder_model_kernel_1.h │ │ ├── entropy_encoder_model_kernel_2.h │ │ ├── entropy_encoder_model_kernel_3.h │ │ ├── entropy_encoder_model_kernel_4.h │ │ ├── entropy_encoder_model_kernel_5.h │ │ ├── entropy_encoder_model_kernel_6.h │ │ ├── entropy_encoder_model_kernel_abstract.h │ │ └── entropy_encoder_model_kernel_c.h │ ├── error.h │ ├── fstream │ ├── general_hash │ │ └── general_hash.h │ ├── geometry.h │ ├── geometry │ │ ├── rectangle.h │ │ ├── rectangle_abstract.h │ │ ├── vector.h │ │ └── vector_abstract.h │ ├── graph.h │ ├── graph │ │ ├── graph_kernel_1.h │ │ └── graph_kernel_abstract.h │ ├── graph_utils.h │ ├── graph_utils │ │ ├── graph_utils.h │ │ └── graph_utils_abstract.h │ ├── gui_core.h │ ├── gui_core │ │ ├── gui_core_kernel_1.cpp │ │ ├── gui_core_kernel_1.h │ │ ├── gui_core_kernel_2.cpp │ │ ├── gui_core_kernel_2.h │ │ ├── gui_core_kernel_abstract.h │ │ ├── windows.h │ │ └── xlib.h │ ├── gui_widgets.h │ ├── gui_widgets │ │ ├── base_widgets.cpp │ │ ├── base_widgets.h │ │ ├── base_widgets_abstract.h │ │ ├── canvas_drawing.cpp │ │ ├── canvas_drawing.h │ │ ├── canvas_drawing_abstract.h │ │ ├── drawable.cpp │ │ ├── drawable.h │ │ ├── drawable_abstract.h │ │ ├── fonts.cpp │ │ ├── fonts.h │ │ ├── fonts_abstract.h │ │ ├── nativefont.h │ │ ├── style.cpp │ │ ├── style.h │ │ ├── style_abstract.h │ │ ├── widgets.cpp │ │ ├── widgets.h │ │ └── widgets_abstract.h │ ├── hash_map.h │ ├── hash_map │ │ ├── hash_map_kernel_1.h │ │ ├── hash_map_kernel_abstract.h │ │ └── hash_map_kernel_c.h │ ├── hash_set.h │ ├── hash_set │ │ ├── hash_set_kernel_1.h │ │ ├── hash_set_kernel_abstract.h │ │ └── hash_set_kernel_c.h │ ├── hash_table.h │ ├── hash_table │ │ ├── hash_table_kernel_1.h │ │ ├── hash_table_kernel_2.h │ │ ├── hash_table_kernel_abstract.h │ │ └── hash_table_kernel_c.h │ ├── http_client │ │ ├── http_client.cpp │ │ ├── http_client.h │ │ └── http_client_abstract.h │ ├── image_io.h │ ├── image_keypoint.h │ ├── image_keypoint │ │ ├── hessian_pyramid.h │ │ ├── hessian_pyramid_abstract.h │ │ ├── hog.h │ │ ├── hog_abstract.h │ │ ├── surf.h │ │ └── surf_abstract.h │ ├── image_loader │ │ ├── image_loader.h │ │ ├── image_loader_abstract.h │ │ ├── jpeg_loader.cpp │ │ ├── jpeg_loader.h │ │ ├── jpeg_loader_abstract.h │ │ ├── png_loader.cpp │ │ ├── png_loader.h │ │ └── png_loader_abstract.h │ ├── image_saver │ │ ├── dng_shared.h │ │ ├── image_saver.h │ │ └── image_saver_abstract.h │ ├── image_transforms.h │ ├── image_transforms │ │ ├── assign_image.h │ │ ├── assign_image_abstract.h │ │ ├── draw.h │ │ ├── draw_abstract.h │ │ ├── edge_detector.h │ │ ├── edge_detector_abstract.h │ │ ├── equalize_histogram.h │ │ ├── equalize_histogram_abstract.h │ │ ├── image_pyramid.h │ │ ├── image_pyramid_abstract.h │ │ ├── integral_image.h │ │ ├── integral_image_abstract.h │ │ ├── morphological_operations.h │ │ ├── morphological_operations_abstract.h │ │ ├── spatial_filtering.h │ │ ├── spatial_filtering_abstract.h │ │ ├── thresholding.h │ │ └── thresholding_abstract.h │ ├── interfaces │ │ ├── cmd_line_parser_option.h │ │ ├── enumerable.h │ │ ├── map_pair.h │ │ └── remover.h │ ├── iomanip │ ├── iosfwd │ ├── iostream │ ├── is_kind.h │ ├── istream │ ├── linker.h │ ├── linker │ │ ├── linker_kernel_1.cpp │ │ ├── linker_kernel_1.h │ │ ├── linker_kernel_abstract.h │ │ └── linker_kernel_c.h │ ├── locale │ ├── logger.h │ ├── lz77_buffer.h │ ├── lz77_buffer │ │ ├── lz77_buffer_kernel_1.h │ │ ├── lz77_buffer_kernel_2.h │ │ ├── lz77_buffer_kernel_abstract.h │ │ └── lz77_buffer_kernel_c.h │ ├── lzp_buffer.h │ ├── lzp_buffer │ │ ├── lzp_buffer_kernel_1.h │ │ ├── lzp_buffer_kernel_2.h │ │ ├── lzp_buffer_kernel_abstract.h │ │ └── lzp_buffer_kernel_c.h │ ├── manifold_regularization.h │ ├── manifold_regularization │ │ ├── function_objects.h │ │ ├── function_objects_abstract.h │ │ ├── graph_creation.h │ │ ├── graph_creation_abstract.h │ │ ├── linear_manifold_regularizer.h │ │ ├── linear_manifold_regularizer_abstract.h │ │ ├── sample_pair.h │ │ └── sample_pair_abstract.h │ ├── map.h │ ├── map │ │ ├── map_kernel_1.h │ │ ├── map_kernel_abstract.h │ │ └── map_kernel_c.h │ ├── matrix.h │ ├── matrix │ │ ├── cblas_constants.h │ │ ├── lapack │ │ │ ├── fortran_id.h │ │ │ ├── gees.h │ │ │ ├── geev.h │ │ │ ├── geqrf.h │ │ │ ├── gesdd.h │ │ │ ├── gesvd.h │ │ │ ├── getrf.h │ │ │ ├── ormqr.h │ │ │ ├── potrf.h │ │ │ ├── syev.h │ │ │ └── syevr.h │ │ ├── matrix.h │ │ ├── matrix_abstract.h │ │ ├── matrix_assign.h │ │ ├── matrix_assign_fwd.h │ │ ├── matrix_blas_bindings.h │ │ ├── matrix_cholesky.h │ │ ├── matrix_conj_trans.h │ │ ├── matrix_data_layout.h │ │ ├── matrix_data_layout_abstract.h │ │ ├── matrix_default_mul.h │ │ ├── matrix_eigenvalue.h │ │ ├── matrix_exp.h │ │ ├── matrix_exp_abstract.h │ │ ├── matrix_expressions.h │ │ ├── matrix_fwd.h │ │ ├── matrix_la.h │ │ ├── matrix_la_abstract.h │ │ ├── matrix_lu.h │ │ ├── matrix_math_functions.h │ │ ├── matrix_math_functions_abstract.h │ │ ├── matrix_op.h │ │ ├── matrix_qr.h │ │ ├── matrix_subexp.h │ │ ├── matrix_subexp_abstract.h │ │ ├── matrix_trsm.h │ │ ├── matrix_utilities.h │ │ └── matrix_utilities_abstract.h │ ├── md5.h │ ├── md5 │ │ ├── md5_kernel_1.cpp │ │ ├── md5_kernel_1.h │ │ └── md5_kernel_abstract.h │ ├── member_function_pointer.h │ ├── member_function_pointer │ │ ├── member_function_pointer_kernel_1.h │ │ ├── member_function_pointer_kernel_abstract.h │ │ └── member_function_pointer_kernel_c.h │ ├── memory_manager.h │ ├── memory_manager │ │ ├── memory_manager_kernel_1.h │ │ ├── memory_manager_kernel_2.h │ │ ├── memory_manager_kernel_3.h │ │ └── memory_manager_kernel_abstract.h │ ├── memory_manager_global.h │ ├── memory_manager_global │ │ ├── memory_manager_global_kernel_1.h │ │ └── memory_manager_global_kernel_abstract.h │ ├── memory_manager_stateless.h │ ├── memory_manager_stateless │ │ ├── memory_manager_stateless_kernel_1.h │ │ ├── memory_manager_stateless_kernel_2.h │ │ └── memory_manager_stateless_kernel_abstract.h │ ├── misc_api.h │ ├── misc_api │ │ ├── misc_api_kernel_1.cpp │ │ ├── misc_api_kernel_1.h │ │ ├── misc_api_kernel_2.cpp │ │ ├── misc_api_kernel_2.h │ │ ├── misc_api_kernel_abstract.h │ │ ├── posix.h │ │ └── windows.h │ ├── mlp.h │ ├── mlp │ │ ├── mlp_kernel_1.h │ │ ├── mlp_kernel_abstract.h │ │ └── mlp_kernel_c.h │ ├── noncopyable.h │ ├── opencv.h │ ├── opencv │ │ ├── cv_image.h │ │ └── cv_image_abstract.h │ ├── optimization.h │ ├── optimization │ │ ├── optimization.h │ │ ├── optimization_abstract.h │ │ ├── optimization_bobyqa.h │ │ ├── optimization_bobyqa_abstract.h │ │ ├── optimization_least_squares.h │ │ ├── optimization_least_squares_abstract.h │ │ ├── optimization_line_search.h │ │ ├── optimization_line_search_abstract.h │ │ ├── optimization_oca.h │ │ ├── optimization_oca_abstract.h │ │ ├── optimization_search_strategies.h │ │ ├── optimization_search_strategies_abstract.h │ │ ├── optimization_solve_qp_using_smo.h │ │ ├── optimization_solve_qp_using_smo_abstract.h │ │ ├── optimization_stop_strategies.h │ │ ├── optimization_stop_strategies_abstract.h │ │ ├── optimization_trust_region.h │ │ └── optimization_trust_region_abstract.h │ ├── ostream │ ├── pipe.h │ ├── pipe │ │ ├── pipe_kernel_1.h │ │ └── pipe_kernel_abstract.h │ ├── pixel.h │ ├── platform.h │ ├── quantum_computing.h │ ├── quantum_computing │ │ ├── quantum_computing.h │ │ └── quantum_computing_abstract.h │ ├── queue.h │ ├── queue │ │ ├── queue_kernel_1.h │ │ ├── queue_kernel_2.h │ │ ├── queue_kernel_abstract.h │ │ ├── queue_kernel_c.h │ │ ├── queue_sort_1.h │ │ └── queue_sort_abstract.h │ ├── rand.h │ ├── rand │ │ ├── mersenne_twister.h │ │ ├── rand_float_1.h │ │ ├── rand_float_abstract.h │ │ ├── rand_kernel_1.h │ │ └── rand_kernel_abstract.h │ ├── ref.h │ ├── reference_counter.h │ ├── reference_counter │ │ ├── reference_counter_kernel_1.h │ │ └── reference_counter_kernel_abstract.h │ ├── sequence.h │ ├── sequence │ │ ├── sequence_compare_1.h │ │ ├── sequence_compare_abstract.h │ │ ├── sequence_kernel_1.h │ │ ├── sequence_kernel_2.h │ │ ├── sequence_kernel_abstract.h │ │ ├── sequence_kernel_c.h │ │ ├── sequence_sort_1.h │ │ ├── sequence_sort_2.h │ │ └── sequence_sort_abstract.h │ ├── serialize.h │ ├── server.h │ ├── server │ │ ├── server_http_1.h │ │ ├── server_http_abstract.h │ │ ├── server_iostream_1.h │ │ ├── server_iostream_abstract.h │ │ ├── server_kernel_1.h │ │ ├── server_kernel_abstract.h │ │ └── server_kernel_c.h │ ├── set.h │ ├── set │ │ ├── set_compare_1.h │ │ ├── set_compare_abstract.h │ │ ├── set_kernel_1.h │ │ ├── set_kernel_abstract.h │ │ └── set_kernel_c.h │ ├── set_utils.h │ ├── set_utils │ │ ├── set_utils.h │ │ └── set_utils_abstract.h │ ├── sliding_buffer.h │ ├── sliding_buffer │ │ ├── sliding_buffer_kernel_1.h │ │ ├── sliding_buffer_kernel_abstract.h │ │ └── sliding_buffer_kernel_c.h │ ├── smart_pointers.h │ ├── smart_pointers │ │ ├── scoped_ptr.h │ │ ├── scoped_ptr_abstract.h │ │ ├── shared_ptr.h │ │ ├── shared_ptr_abstract.h │ │ ├── shared_ptr_thread_safe.h │ │ ├── shared_ptr_thread_safe_abstract.h │ │ ├── weak_ptr.h │ │ └── weak_ptr_abstract.h │ ├── smart_pointers_thread_safe.h │ ├── sockets.h │ ├── sockets │ │ ├── posix.h │ │ ├── sockets_extensions.cpp │ │ ├── sockets_extensions.h │ │ ├── sockets_extensions_abstract.h │ │ ├── sockets_kernel_1.cpp │ │ ├── sockets_kernel_1.h │ │ ├── sockets_kernel_2.cpp │ │ ├── sockets_kernel_2.h │ │ ├── sockets_kernel_abstract.h │ │ └── windows.h │ ├── sockstreambuf.h │ ├── sockstreambuf │ │ ├── sockstreambuf_kernel_1.cpp │ │ ├── sockstreambuf_kernel_1.h │ │ ├── sockstreambuf_kernel_2.cpp │ │ ├── sockstreambuf_kernel_2.h │ │ └── sockstreambuf_kernel_abstract.h │ ├── sort.h │ ├── sstream │ ├── stack.h │ ├── stack │ │ ├── stack_kernel_1.h │ │ ├── stack_kernel_abstract.h │ │ └── stack_kernel_c.h │ ├── stack_trace.cpp │ ├── stack_trace.h │ ├── static_map.h │ ├── static_map │ │ ├── static_map_kernel_1.h │ │ ├── static_map_kernel_abstract.h │ │ └── static_map_kernel_c.h │ ├── static_set.h │ ├── static_set │ │ ├── static_set_compare_1.h │ │ ├── static_set_compare_abstract.h │ │ ├── static_set_kernel_1.h │ │ ├── static_set_kernel_abstract.h │ │ └── static_set_kernel_c.h │ ├── statistics.h │ ├── statistics │ │ ├── dpca.h │ │ ├── dpca_abstract.h │ │ ├── random_subset_selector.h │ │ ├── random_subset_selector_abstract.h │ │ ├── statistics.h │ │ └── statistics_abstract.h │ ├── std_allocator.h │ ├── stl_checked.h │ ├── stl_checked │ │ ├── std_vector_c.h │ │ └── std_vector_c_abstract.h │ ├── string.h │ ├── string │ │ ├── cassert │ │ ├── iomanip │ │ ├── iosfwd │ │ ├── iostream │ │ ├── locale │ │ ├── string.h │ │ └── string_abstract.h │ ├── svm.h │ ├── svm │ │ ├── empirical_kernel_map.h │ │ ├── empirical_kernel_map_abstract.h │ │ ├── feature_ranking.h │ │ ├── feature_ranking_abstract.h │ │ ├── function.h │ │ ├── function_abstract.h │ │ ├── kcentroid.h │ │ ├── kcentroid_abstract.h │ │ ├── kcentroid_overloads.h │ │ ├── kernel.h │ │ ├── kernel_abstract.h │ │ ├── kernel_matrix.h │ │ ├── kernel_matrix_abstract.h │ │ ├── kkmeans.h │ │ ├── kkmeans_abstract.h │ │ ├── krls.h │ │ ├── krls_abstract.h │ │ ├── krr_trainer.h │ │ ├── krr_trainer_abstract.h │ │ ├── linearly_independent_subset_finder.h │ │ ├── linearly_independent_subset_finder_abstract.h │ │ ├── null_trainer.h │ │ ├── null_trainer_abstract.h │ │ ├── pegasos.h │ │ ├── pegasos_abstract.h │ │ ├── rbf_network.h │ │ ├── rbf_network_abstract.h │ │ ├── reduced.h │ │ ├── reduced_abstract.h │ │ ├── roc_trainer.h │ │ ├── roc_trainer_abstract.h │ │ ├── rvm.h │ │ ├── rvm_abstract.h │ │ ├── simplify_linear_decision_function.h │ │ ├── simplify_linear_decision_function_abstract.h │ │ ├── sort_basis_vectors.h │ │ ├── sort_basis_vectors_abstract.h │ │ ├── sparse_kernel.h │ │ ├── sparse_kernel_abstract.h │ │ ├── sparse_vector.h │ │ ├── sparse_vector_abstract.h │ │ ├── svm.h │ │ ├── svm_abstract.h │ │ ├── svm_c_ekm_trainer.h │ │ ├── svm_c_ekm_trainer_abstract.h │ │ ├── svm_c_linear_trainer.h │ │ ├── svm_c_linear_trainer_abstract.h │ │ ├── svm_threaded.h │ │ └── svm_threaded_abstract.h │ ├── svm_threaded.h │ ├── sync_extension.h │ ├── sync_extension │ │ ├── sync_extension_kernel_1.h │ │ └── sync_extension_kernel_abstract.h │ ├── threads.h │ ├── threads │ │ ├── auto_mutex_extension.h │ │ ├── auto_mutex_extension_abstract.h │ │ ├── auto_unlock_extension.h │ │ ├── auto_unlock_extension_abstract.h │ │ ├── create_new_thread_extension.h │ │ ├── create_new_thread_extension_abstract.h │ │ ├── multithreaded_object_extension.cpp │ │ ├── multithreaded_object_extension.h │ │ ├── multithreaded_object_extension_abstract.h │ │ ├── posix.h │ │ ├── read_write_mutex_extension.h │ │ ├── read_write_mutex_extension_abstract.h │ │ ├── rmutex_extension.h │ │ ├── rmutex_extension_abstract.h │ │ ├── rsignaler_extension.h │ │ ├── rsignaler_extension_abstract.h │ │ ├── thread_function_extension.h │ │ ├── thread_function_extension_abstract.h │ │ ├── thread_pool_extension.cpp │ │ ├── thread_pool_extension.h │ │ ├── thread_pool_extension_abstract.h │ │ ├── thread_specific_data_extension.h │ │ ├── thread_specific_data_extension_abstract.h │ │ ├── threaded_object_extension.cpp │ │ ├── threaded_object_extension.h │ │ ├── threaded_object_extension_abstract.h │ │ ├── threads_kernel.h │ │ ├── threads_kernel_1.cpp │ │ ├── threads_kernel_1.h │ │ ├── threads_kernel_2.cpp │ │ ├── threads_kernel_2.h │ │ ├── threads_kernel_abstract.h │ │ ├── threads_kernel_shared.cpp │ │ ├── threads_kernel_shared.h │ │ └── windows.h │ ├── time_this.h │ ├── timeout.h │ ├── timeout │ │ ├── timeout_kernel_1.h │ │ └── timeout_kernel_abstract.h │ ├── timer.h │ ├── timer │ │ ├── timer_kernel_1.h │ │ ├── timer_kernel_2.cpp │ │ ├── timer_kernel_2.h │ │ └── timer_kernel_abstract.h │ ├── tokenizer.h │ ├── tokenizer │ │ ├── tokenizer_kernel_1.cpp │ │ ├── tokenizer_kernel_1.h │ │ ├── tokenizer_kernel_abstract.h │ │ └── tokenizer_kernel_c.h │ ├── tuple.h │ ├── tuple │ │ ├── tuple.h │ │ └── tuple_abstract.h │ ├── type_safe_union.h │ ├── type_safe_union │ │ ├── type_safe_union_kernel.h │ │ └── type_safe_union_kernel_abstract.h │ ├── uintn.h │ ├── unicode.h │ ├── unicode │ │ ├── unicode.cpp │ │ ├── unicode.h │ │ └── unicode_abstract.h │ ├── windows_magic.h │ ├── xml_parser.h │ └── xml_parser │ │ ├── xml_parser_kernel_1.h │ │ ├── xml_parser_kernel_abstract.h │ │ ├── xml_parser_kernel_c.h │ │ └── xml_parser_kernel_interfaces.h ├── docs │ ├── .current_minor_release_number │ ├── .current_release_number │ ├── .logger_revnum │ ├── README.txt │ ├── docs │ │ ├── algorithms.xml │ │ ├── api.xml │ │ ├── bayes.xml │ │ ├── bigminus.gif │ │ ├── bigplus.gif │ │ ├── books.xml │ │ ├── boost.png │ │ ├── change_log.xml │ │ ├── chm │ │ │ ├── READ THE README. DO NOT EDIT THE TABLE OF CONTENTS FILE │ │ │ ├── READ THE README. DO NOT EDIT THE TABLE OF CONTENTS FILE2 │ │ │ ├── READ THE README. DO NOT EDIT THE TABLE OF CONTENTS FILE3 │ │ │ ├── README.txt │ │ │ ├── documentation.html │ │ │ ├── htmlhelp │ │ │ │ ├── hha.dll │ │ │ │ ├── hhc.exe │ │ │ │ ├── htmlhelp.reg │ │ │ │ ├── itcc.dll │ │ │ │ ├── itircl.dll │ │ │ │ ├── itss.dll │ │ │ │ └── setup_htmlhelp.sh │ │ │ ├── htmlhelp_stylesheet.xsl │ │ │ ├── lib.hhp │ │ │ └── toc.xml │ │ ├── compile.xml │ │ ├── compression.xml │ │ ├── containers.xml │ │ ├── down.gif │ │ ├── enable_if.html │ │ ├── howto_contribute.xml │ │ ├── imaging.xml │ │ ├── index.xml │ │ ├── intro.xml │ │ ├── kernel_1a.txt │ │ ├── kernel_1a.xml │ │ ├── kernel_1b.txt │ │ ├── kernel_1b.xml │ │ ├── kernel_1c.txt │ │ ├── kernel_1c.xml │ │ ├── kernel_1da.txt │ │ ├── kernel_1da.xml │ │ ├── kernel_1db.txt │ │ ├── kernel_1db.xml │ │ ├── kernel_1ea.txt │ │ ├── kernel_1ea.xml │ │ ├── kernel_1eb.txt │ │ ├── kernel_1eb.xml │ │ ├── kernel_1ec.txt │ │ ├── kernel_1ec.xml │ │ ├── kernel_2a.txt │ │ ├── kernel_2a.xml │ │ ├── kernel_3a.txt │ │ ├── kernel_3a.xml │ │ ├── kernel_3b.txt │ │ ├── kernel_3b.xml │ │ ├── license.xml │ │ ├── main_menu.xml │ │ ├── metaprogramming.xml │ │ ├── minus.gif │ │ ├── ml.xml │ │ ├── network.xml │ │ ├── old_change_log.xml │ │ ├── old_release_notes.xml │ │ ├── optimization.xml │ │ ├── other.xml │ │ ├── parsing.xml │ │ ├── plus.gif │ │ ├── release_notes.xml │ │ ├── right.gif │ │ ├── stylesheet.xsl │ │ └── term_index.xml │ ├── htmlify │ │ ├── CMakeLists.txt │ │ ├── htmlify.cpp │ │ ├── to_xml.cpp │ │ ├── to_xml.h │ │ └── to_xml_example │ │ │ ├── bigminus.gif │ │ │ ├── bigplus.gif │ │ │ ├── example.xml │ │ │ ├── minus.gif │ │ │ ├── output.xml │ │ │ ├── plus.gif │ │ │ ├── stylesheet.xsl │ │ │ └── test.cpp │ ├── makedocs │ ├── makerel │ ├── makesnapshot │ └── testenv └── examples │ ├── CMakeLists.txt │ ├── LICENSE_FOR_EXAMPLE_PROGRAMS.txt │ ├── bayes_net_ex.cpp │ ├── bayes_net_from_disk_ex.cpp │ ├── bayes_net_gui_ex.cpp │ ├── compress_stream_ex.cpp │ ├── config.txt │ ├── config_reader_ex.cpp │ ├── dir_nav_ex.cpp │ ├── empirical_kernel_map_ex.cpp │ ├── file_to_code_ex.cpp │ ├── gui_api_ex.cpp │ ├── image_ex.cpp │ ├── kcentroid_ex.cpp │ ├── kkmeans_ex.cpp │ ├── krls_ex.cpp │ ├── krls_filter_ex.cpp │ ├── krr_classification_ex.cpp │ ├── krr_regression_ex.cpp │ ├── least_squares_ex.cpp │ ├── linear_manifold_regularizer_ex.cpp │ ├── logger_ex.cpp │ ├── logger_ex_2.cpp │ ├── matrix_ex.cpp │ ├── matrix_expressions_ex.cpp │ ├── member_function_pointer_ex.cpp │ ├── mlp_ex.cpp │ ├── model_selection_ex.cpp │ ├── multithreaded_object_ex.cpp │ ├── optimization_ex.cpp │ ├── pipe_ex.cpp │ ├── pipe_ex_2.cpp │ ├── quantum_computing_ex.cpp │ ├── queue_ex.cpp │ ├── rank_features_ex.cpp │ ├── rvm_ex.cpp │ ├── rvm_regression_ex.cpp │ ├── server_http_ex.cpp │ ├── sockets_ex.cpp │ ├── sockets_ex_2.cpp │ ├── sockstreambuf_ex.cpp │ ├── std_allocator_ex.cpp │ ├── surf_ex.cpp │ ├── svm_ex.cpp │ ├── svm_pegasos_ex.cpp │ ├── svm_sparse_ex.cpp │ ├── thread_function_ex.cpp │ ├── thread_pool_ex.cpp │ ├── threaded_object_ex.cpp │ ├── threads_ex.cpp │ ├── timer_ex.cpp │ └── xml_parser_ex.cpp ├── getpass.h ├── huginParser.y ├── huginScanner.l ├── initializeSingletons.cpp ├── initializeSingletons.hpp ├── logger.cpp ├── nullptr.hpp ├── parser.cpp ├── parser.y ├── probabilities.cpp ├── queryStatistics.cpp ├── riskAnalyzer.cpp ├── scanner.cpp ├── scanner.l ├── sqlassie.cpp ├── tests ├── blockWhitelist.mysql ├── nightly │ ├── crawl_ccdc.py │ ├── mysqlMultiThreadedStress.sh │ ├── mysqlStress.sh │ └── nightly.sh ├── parseWhitelist.mysql ├── queries │ ├── phpbb2.sql │ └── wikidb.sql ├── test.cpp ├── testMySqlConstants.cpp ├── testMySqlConstants.hpp ├── testNode.cpp ├── testNode.hpp ├── testParser.cpp ├── testParser.hpp ├── testQueryWhitelist.cpp └── testQueryWhitelist.hpp ├── tunnel.cpp ├── version.h └── warnUnusedResult.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | 9 | # Compiled Static libraries 10 | *.lai 11 | *.la 12 | *.a 13 | 14 | # Vim swap files 15 | *.swp 16 | 17 | # Makefile is just a symlink 18 | Makefile 19 | 20 | # Custom Makefile options per system 21 | Makefile.custom 22 | 23 | # Binaries 24 | demo 25 | logger 26 | parser 27 | probabilities 28 | queryStatistics 29 | riskAnalyzer 30 | scanner 31 | sqlassie 32 | test 33 | tunnel 34 | 35 | # Flex and Bison output 36 | huginParser.output 37 | huginParser.tab.cpp 38 | huginParser.tab.hpp 39 | huginScanner.yy.cpp 40 | huginScanner.yy.hpp 41 | parser.output 42 | parser.tab.cpp 43 | parser.tab.hpp 44 | scanner.yy.cpp 45 | scanner.yy.hpp 46 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dlib"] 2 | path = src/dlib 3 | url = git@github.com:luispedro/dlib 4 | -------------------------------------------------------------------------------- /src/AlwaysSomethingNode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "ComparisonNode.hpp" 22 | #include "AlwaysSomethingNode.hpp" 23 | 24 | #include 25 | #include 26 | using std::string; 27 | using boost::regex; 28 | using boost::regex_match; 29 | 30 | AlwaysSomethingNode::AlwaysSomethingNode( 31 | const bool always, 32 | const string& compareType) : 33 | ComparisonNode(compareType), 34 | always_(always) 35 | { 36 | } 37 | 38 | 39 | AlwaysSomethingNode::~AlwaysSomethingNode() 40 | { 41 | } 42 | 43 | 44 | AstNode* AlwaysSomethingNode::copy() const 45 | { 46 | AlwaysSomethingNode* const temp = 47 | new AlwaysSomethingNode(always_, compareType_); 48 | AstNode::addCopyOfChildren(temp); 49 | return temp; 50 | } 51 | 52 | 53 | bool AlwaysSomethingNode::isAlwaysTrue() const 54 | { 55 | return always_; 56 | } 57 | 58 | 59 | bool AlwaysSomethingNode::anyIsAlwaysTrue() const 60 | { 61 | return AlwaysSomethingNode::isAlwaysTrue(); 62 | } 63 | -------------------------------------------------------------------------------- /src/AttackProbabilities.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "AttackProbabilities.hpp" 22 | 23 | AttackProbabilities::~AttackProbabilities() 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/AttackProbabilities.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_ATTACKPROBABILITIES_HPP_ 22 | #define SRC_ATTACKPROBABILITIES_HPP_ 23 | 24 | #include "QueryRisk.hpp" 25 | 26 | /** 27 | * Class interface with pure virtual methods to compute the probability of 28 | * attack given a particular query risk assessment. 29 | * @author Brandon Skari 30 | * @date January 5 2011 31 | */ 32 | 33 | class AttackProbabilities 34 | { 35 | public: 36 | /** 37 | * Returns the probability of a given type of attack. 38 | */ 39 | ///@{ 40 | virtual double getProbabilityOfAccessAttack(const QueryRisk& qr) = 0; 41 | virtual double getProbabilityOfBypassAttack(const QueryRisk& qr) = 0; 42 | virtual double getProbabilityOfModificationAttack(const QueryRisk& qr) = 0; 43 | virtual double getProbabilityOfFingerprintingAttack( 44 | const QueryRisk& qr 45 | ) = 0; 46 | virtual double getProbabilityOfSchemaAttack(const QueryRisk& qr) = 0; 47 | virtual double getProbabilityOfDenialAttack(const QueryRisk& qr) = 0; 48 | ///@} 49 | 50 | virtual ~AttackProbabilities(); 51 | }; 52 | #endif // SRC_ATTACKPROBABILITIES_HPP_ 53 | -------------------------------------------------------------------------------- /src/BayesException.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_BAYESEXCEPTION_HPP_ 22 | #define SRC_BAYESEXCEPTION_HPP_ 23 | 24 | #include "DescribedException.hpp" 25 | #include 26 | 27 | /** 28 | * Exception that's meant to be thrown by the AttackProbabilities class. 29 | * @author Brandon Skari 30 | * @date January 5 2010 31 | */ 32 | 33 | class BayesException : public DescribedException 34 | { 35 | public: 36 | /** 37 | * Normal constructor. 38 | */ 39 | BayesException() : DescribedException("BayesException") {} 40 | 41 | /** 42 | * Constructor with explicit description. 43 | * @param description The description to return from what. 44 | */ 45 | explicit BayesException(const std::string& description) : 46 | DescribedException("BayesException: " + description) 47 | { 48 | } 49 | }; 50 | 51 | #endif // SRC_BAYESEXCEPTION_HPP_ 52 | -------------------------------------------------------------------------------- /src/ConditionalNode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "AstNode.hpp" 22 | #include "ConditionalNode.hpp" 23 | 24 | #include 25 | #include 26 | using std::string; 27 | 28 | 29 | ConditionalNode::ConditionalNode(const string& name) : 30 | AstNode(name + "-ConditionalNode") 31 | { 32 | } 33 | 34 | 35 | ConditionalNode::~ConditionalNode() 36 | { 37 | } 38 | -------------------------------------------------------------------------------- /src/ConditionalNode.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_CONDITIONALNODE_HPP_ 22 | #define SRC_CONDITIONALNODE_HPP_ 23 | 24 | #include "AstNode.hpp" 25 | #include "QueryRisk.hpp" 26 | 27 | #include 28 | 29 | /** 30 | * Pure virtual parse tree node that represents some kind of conditional 31 | * statement. Derived classes must implement isAlwaysTrue(), anyIsAlwaysTrue(), 32 | * copy() and emptyPassword(). 33 | * @author Brandon Skari 34 | * @date December 9 2010 35 | */ 36 | 37 | class ConditionalNode : public AstNode 38 | { 39 | public: 40 | /** 41 | * Default constructor. 42 | * @param name What kind of ConditionalNode this is. 43 | */ 44 | explicit ConditionalNode(const std::string& name); 45 | 46 | virtual ~ConditionalNode(); 47 | 48 | /** 49 | * Overridden from AstNode. 50 | */ 51 | virtual AstNode* copy() const = 0; 52 | 53 | /** 54 | * Determines if the conditionals are always true. 55 | */ 56 | virtual bool isAlwaysTrue() const = 0; 57 | 58 | /** 59 | * Determines if any of its children have an always true comparison. 60 | */ 61 | virtual bool anyIsAlwaysTrue() const = 0; 62 | 63 | /** 64 | * Determines if the password is empty. 65 | */ 66 | virtual QueryRisk::EmptyPassword emptyPassword() const = 0; 67 | 68 | private: 69 | ConditionalNode(const ConditionalNode& rhs); 70 | ConditionalNode& operator=(const ConditionalNode& rhs); 71 | }; 72 | #endif // SRC_CONDITIONALNODE_HPP_ 73 | -------------------------------------------------------------------------------- /src/DescribedException.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_DESCRIBEDEXCEPTION_HPP_ 22 | #define SRC_DESCRIBEDEXCEPTION_HPP_ 23 | 24 | #include 25 | #include 26 | 27 | /** 28 | * Exception class that allows the description to be entered at 29 | * construction. 30 | * @author Brandon Skari 31 | * @date January 11 2011 32 | */ 33 | 34 | class DescribedException : public std::exception 35 | { 36 | public: 37 | /** 38 | * Constructor with explicit description. 39 | * @param description The description to return from what . 40 | */ 41 | explicit DescribedException(const std::string& description) : 42 | _description(description) {} 43 | 44 | /** 45 | * Constructor with explicit description. 46 | * @param description The description to return from what . 47 | */ 48 | //DescribedException(explicit const char* const description) : 49 | // _description(description) {} 50 | 51 | /** 52 | * Destructor. 53 | */ 54 | ~DescribedException() throw() {} 55 | 56 | /** 57 | * Returns a description of the exception. Overridden from 58 | * std::exception. 59 | * @return A description of the exception. 60 | */ 61 | virtual const char* what() const throw() 62 | { 63 | return _description.c_str(); 64 | } 65 | 66 | private: 67 | const std::string _description; 68 | }; 69 | 70 | #endif // SRC_DESCRIBEDEXCEPTION_HPP_ 71 | -------------------------------------------------------------------------------- /src/InSubselectNode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "InSubselectNode.hpp" 22 | #include "InValuesListNode.hpp" 23 | #include "QueryRisk.hpp" 24 | 25 | 26 | InSubselectNode::InSubselectNode(const ExpressionNode* const expression) : 27 | InValuesListNode(false, expression) 28 | { 29 | } 30 | 31 | 32 | InSubselectNode::~InSubselectNode() 33 | { 34 | } 35 | 36 | 37 | AstNode* InSubselectNode::copy() const 38 | { 39 | InSubselectNode* const temp = new InSubselectNode(expression_); 40 | AstNode::addCopyOfChildren(temp); 41 | return temp; 42 | } 43 | 44 | 45 | bool InSubselectNode::isAlwaysTrue() const 46 | { 47 | return false; 48 | } 49 | 50 | 51 | bool InSubselectNode::anyIsAlwaysTrue() const 52 | { 53 | return false; 54 | } 55 | -------------------------------------------------------------------------------- /src/ListenSocket.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_LISTENSOCKET_HPP_ 22 | #define SRC_LISTENSOCKET_HPP_ 23 | 24 | class Socket; 25 | class MessageHandlerFactory; 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | /** 32 | * Socket that listens for connections. 33 | * @author Brandon Skari 34 | * @date April 21 2010 35 | */ 36 | 37 | class ListenSocket 38 | { 39 | public: 40 | explicit ListenSocket(const uint16_t port); 41 | explicit ListenSocket(const std::string& domainSocket); 42 | virtual ~ListenSocket(); 43 | 44 | virtual void acceptClients() const; 45 | 46 | static const int MAX_CONNECTIONS = 5; 47 | 48 | 49 | protected: 50 | virtual void handleConnection(std::auto_ptr socket) const; 51 | 52 | const int socketFD_; 53 | }; 54 | 55 | #endif // SRC_LISTENSOCKET_HPP_ 56 | -------------------------------------------------------------------------------- /src/Makefile.clang: -------------------------------------------------------------------------------- 1 | # SQLassie - database firewall 2 | # Copyright (C) 2011 Brandon Skari 3 | # 4 | # This file is part of SQLassie. 5 | # 6 | # SQLassie is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # SQLassie is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with SQLassie. If not, see . 18 | 19 | # Default version; this is overridable on the command line by typing: 20 | # make VERSION=[RELEASE|DEBUG|PROFILE] 21 | VERSION = DEBUG 22 | WARNING_CXXFLAGS = -fcatch-undefined-behavior -Wall -Wextra 23 | DEBUG_CXXFLAGS = -g -ftrapv 24 | RELEASE_CXXFLAGS = -O3 -DNDEBUG -march=native 25 | 26 | # Use the LLVM compiler 27 | CXX = clang++ 28 | CC = clang 29 | 30 | include Makefile.common 31 | -------------------------------------------------------------------------------- /src/Makefile.gcc: -------------------------------------------------------------------------------- 1 | # SQLassie - database firewall 2 | # Copyright (C) 2011 Brandon Skari 3 | # 4 | # This file is part of SQLassie. 5 | # 6 | # SQLassie is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # SQLassie is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with SQLassie. If not, see . 18 | 19 | # Default version; this is overridable on the command line by typing: 20 | # make VERSION=[RELEASE|DEBUG|PROFILE] 21 | 22 | VERSION = DEBUG 23 | WARNING_CXXFLAGS = -Wall -Wextra -Weffc++ -Wfloat-equal -Wshadow\ 24 | -Wpointer-arith -Wcast-align -Wstrict-overflow=5\ 25 | -Wwrite-strings -Wswitch-default -Wswitch-enum -Wparentheses\ 26 | -Woverloaded-virtual -pedantic 27 | DEBUG_CXXFLAGS = -g -ftrapv $(CUSTOM_DEBUG_CXXFLAGS) 28 | PROFILE_CXXFLAGS = -pg -O3 -march=native -fexpensive-optimizations -pipe\ 29 | -DNDEBUG -ffast-math $(CUSTOM_PROFILE_CXXFLAGS) 30 | RELEASE_CXXFLAGS = -O3 -march=native -fexpensive-optimizations\ 31 | -fomit-frame-pointer -pipe -DNDEBUG -ffast-math $(CUSTOM_RELEASE_CXXFLAGS) 32 | 33 | # Use the GNU C/C++: 34 | CXX = g++ 35 | CC = gcc 36 | 37 | # Custom platform specific options 38 | -include Makefile.custom 39 | 40 | include Makefile.common 41 | -------------------------------------------------------------------------------- /src/MessageHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "Logger.hpp" 22 | #include "MessageHandler.hpp" 23 | #include "Socket.hpp" 24 | #include "SocketException.hpp" 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | using std::vector; 32 | using std::auto_ptr; 33 | using std::cerr; 34 | using std::endl; 35 | 36 | 37 | MessageHandler::MessageHandler(auto_ptr& socket) : _socket(socket) 38 | { 39 | } 40 | 41 | 42 | void MessageHandler::operator()() 43 | { 44 | while (true) 45 | { 46 | vector message; 47 | try 48 | { 49 | message = _socket->receive(); 50 | } 51 | catch (ClosedException& e) 52 | { 53 | Logger::log(Logger::DEBUG) << "Socket closed, rethrowing"; 54 | throw; 55 | } 56 | catch (SocketException& e) 57 | { 58 | Logger::log(Logger::ERROR) 59 | << "MessageHandler caught a SocketException: " 60 | << e.what(); 61 | break; 62 | } 63 | 64 | _socket->send(message.begin(), message.end()); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/MessageHandler.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_MESSAGEHANDLER_HPP_ 22 | #define SRC_MESSAGEHANDLER_HPP_ 23 | 24 | #include "Socket.hpp" 25 | 26 | #include 27 | 28 | /** 29 | * Interface for classes that handle messages received from a socket. 30 | * @author Brandon Skari 31 | * @date April 22 2010 32 | */ 33 | 34 | class MessageHandler 35 | { 36 | public: 37 | /** 38 | * Normal constructor. 39 | * @param socket The socket to handle messages from. 40 | */ 41 | 42 | explicit MessageHandler(std::auto_ptr& socket); 43 | 44 | /** 45 | * Destructor. 46 | */ 47 | 48 | virtual ~MessageHandler() {} 49 | 50 | /** 51 | * Starts listening for messages and handling them. Required starting 52 | * point for using the Boost thread library. 53 | */ 54 | virtual void operator()(); 55 | protected: 56 | std::auto_ptr _socket; 57 | }; 58 | 59 | #endif // SRC_MESSAGEHANDLER_HPP_ 60 | -------------------------------------------------------------------------------- /src/MySqlLoggerListenSocket.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "ListenSocket.hpp" 22 | #include "Logger.hpp" 23 | #include "MySqlLogger.hpp" 24 | #include "MySqlLoggerListenSocket.hpp" 25 | #include "Proxy.hpp" 26 | #include "Socket.hpp" 27 | #include "SocketException.hpp" 28 | 29 | #include 30 | #include 31 | 32 | using std::auto_ptr; 33 | using std::string; 34 | 35 | 36 | MySqlLoggerListenSocket::MySqlLoggerListenSocket( 37 | const uint16_t listenPort, 38 | const uint16_t mySqlPort, 39 | const string mySqlHost 40 | ) : 41 | ListenSocket(listenPort), 42 | mySqlPort_(mySqlPort), 43 | mySqlHost_(mySqlHost) 44 | { 45 | } 46 | 47 | 48 | void MySqlLoggerListenSocket::handleConnection( 49 | auto_ptr clientConnection 50 | ) const 51 | { 52 | auto_ptr serverConnection(new Socket(mySqlPort_, mySqlHost_)); 53 | AutoPtrWithOperatorParens client( 54 | new MySqlLogger( 55 | clientConnection.get(), 56 | serverConnection.get(), 57 | "./queries/" 58 | ) 59 | ); 60 | AutoPtrWithOperatorParens server( 61 | new ProxyHalf( 62 | serverConnection.get(), 63 | clientConnection.get() 64 | ) 65 | ); 66 | Proxy proxy(client, server, clientConnection, serverConnection); 67 | proxy.runUntilFinished(); 68 | } 69 | -------------------------------------------------------------------------------- /src/MySqlLoggerListenSocket.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_MYSQLLOGGERLISTENSOCKET_HPP_ 22 | #define SRC_MYSQLLOGGERLISTENSOCKET_HPP_ 23 | 24 | #include "ListenSocket.hpp" 25 | #include "Socket.hpp" 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | /** 32 | * Listen socket that intercepts MySQL connections and saves all commands to a 33 | * file using MySqlLoggers. 34 | * @author Brandon Skari 35 | * @date October 25 2010 36 | */ 37 | 38 | class MySqlLoggerListenSocket : public ListenSocket 39 | { 40 | public: 41 | MySqlLoggerListenSocket(uint16_t listenPort, 42 | uint16_t mySqlPort = 3306, 43 | std::string mySqlHost = std::string("127.0.0.1")); 44 | 45 | /** 46 | * Quit listening and close all the sockets and threads. 47 | */ 48 | void quit(); 49 | 50 | protected: 51 | void handleConnection(std::auto_ptr clientConnection) const; 52 | 53 | private: 54 | const uint16_t mySqlPort_; 55 | const std::string mySqlHost_; 56 | }; 57 | 58 | #endif // SRC_MYSQLLOGGERLISTENSOCKET_HPP_ 59 | -------------------------------------------------------------------------------- /src/MySqlPrinter.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_MYSQLPRINTER_HPP_ 22 | #define SRC_MYSQLPRINTER_HPP_ 23 | 24 | #include "ProxyHalf.hpp" 25 | class Socket; 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | class MySqlPrinter : public ProxyHalf 32 | { 33 | public: 34 | MySqlPrinter(Socket* incomingConnection, Socket* outgoingConnection); 35 | void handleMessage(std::vector& rawMessage) const; 36 | 37 | private: 38 | mutable uint8_t lastCommandCode_; 39 | mutable bool firstPacket_; 40 | mutable std::string database_; 41 | }; 42 | 43 | #endif // SRC_MYSQLPRINTER_HPP_ 44 | -------------------------------------------------------------------------------- /src/Proxy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "AutoPtrWithOperatorParens.hpp" 22 | #include "Logger.hpp" 23 | #include "Proxy.hpp" 24 | #include "ProxyHalf.hpp" 25 | #include "Socket.hpp" 26 | 27 | #include 28 | #include 29 | 30 | using boost::thread; 31 | using std::auto_ptr; 32 | 33 | 34 | Proxy::Proxy( 35 | AutoPtrWithOperatorParens in, 36 | AutoPtrWithOperatorParens out, 37 | auto_ptr inSocket, 38 | auto_ptr outSocket 39 | ) : 40 | in_(in), 41 | out_(out), 42 | inSocket_(inSocket), 43 | outSocket_(outSocket) 44 | { 45 | } 46 | 47 | 48 | Proxy::Proxy(Proxy& rhs) : 49 | in_(rhs.in_), 50 | out_(rhs.out_), 51 | inSocket_(rhs.inSocket_), 52 | outSocket_(rhs.outSocket_) 53 | { 54 | } 55 | 56 | 57 | Proxy::~Proxy() 58 | { 59 | } 60 | 61 | 62 | void Proxy::operator()() 63 | { 64 | runUntilFinished(); 65 | } 66 | 67 | 68 | void Proxy::runUntilFinished() 69 | { 70 | thread inThread(in_); 71 | thread outThread(out_); 72 | inThread.join(); 73 | outThread.join(); 74 | Logger::log(Logger::DEBUG) 75 | << "Client disconnected, quitting thread #" 76 | << boost::this_thread::get_id(); 77 | } 78 | -------------------------------------------------------------------------------- /src/ScannerContext.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "ScannerContext.hpp" 22 | 23 | #include 24 | #include 25 | 26 | ScannerContext::ScannerContext() : 27 | identifiers(), 28 | identifier(), 29 | quotedStrings(), 30 | quotedString(), 31 | numbers() 32 | { 33 | } 34 | 35 | 36 | ScannerContext::~ScannerContext() 37 | { 38 | } 39 | -------------------------------------------------------------------------------- /src/ScannerContext.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_SCANNERCONTEXT_HPP_ 22 | #define SRC_SCANNERCONTEXT_HPP_ 23 | 24 | #include 25 | #include 26 | 27 | struct ScannerContext 28 | { 29 | std::stack identifiers; 30 | std::string identifier; 31 | std::stack quotedStrings; 32 | std::string quotedString; 33 | // Using strings instead of ints for this stack because otherwise I would 34 | // get weird segmentation fault errors whenever I'd try to pop it 35 | std::stack numbers; 36 | 37 | ScannerContext(); 38 | ~ScannerContext(); 39 | 40 | private: 41 | // Hidden methods 42 | ScannerContext(const ScannerContext& rhs); 43 | ScannerContext& operator=(const ScannerContext& rhs); 44 | }; 45 | 46 | #endif // SRC_SCANNERCONTEXT_HPP_ 47 | -------------------------------------------------------------------------------- /src/SocketException.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_SOCKETEXCEPTION_HPP_ 22 | #define SRC_SOCKETEXCEPTION_HPP_ 23 | 24 | #include "DescribedException.hpp" 25 | 26 | /** 27 | * Exceptions specifically meant to be thrown by the Socket class. 28 | * @author Brandon Skari 29 | * @date April 21 2010 30 | */ 31 | 32 | class SocketException : public DescribedException 33 | { 34 | public: 35 | /** 36 | * Normal constructor. 37 | */ 38 | SocketException() : DescribedException("Socket exception") {} 39 | 40 | /** 41 | * Constructor with explicit description. 42 | * @param description The descritiption to return from what . 43 | */ 44 | explicit SocketException(const std::string& description) : 45 | DescribedException("SocketException: " + description) {} 46 | }; 47 | 48 | class ClosedException : public SocketException 49 | { 50 | public: 51 | /** 52 | * Normal constructor. 53 | */ 54 | ClosedException() : SocketException("ClosedException") {} 55 | }; 56 | 57 | #endif // SRC_SOCKETEXCEPTION_HPP_ 58 | -------------------------------------------------------------------------------- /src/clearStack.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_CLEARSTACK_HPP_ 22 | #define SRC_CLEARSTACK_HPP_ 23 | 24 | #include "nullptr.hpp" 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | template 31 | void clearStack(std::stack* aStack) 32 | { 33 | assert(nullptr != aStack); 34 | while (!aStack->empty()) 35 | { 36 | aStack->pop(); 37 | } 38 | } 39 | 40 | 41 | template 42 | void clearQueue(std::queue* aQueue) 43 | { 44 | assert(nullptr != aQueue); 45 | while (!aQueue->empty()) 46 | { 47 | aQueue->pop(); 48 | } 49 | } 50 | 51 | #endif // SRC_CLEARSTACK_HPP_ 52 | -------------------------------------------------------------------------------- /src/dlib/dlib/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. -------------------------------------------------------------------------------- /src/dlib/dlib/README.txt: -------------------------------------------------------------------------------- 1 | 2 | dlib C++ library 3 | 4 | This project is a modern C++ library with a focus on portability 5 | and program correctness. It strives to be easy to use right and 6 | hard to use wrong. Thus, it comes with extensive documentation and 7 | thorough debugging modes. The library provides a platform abstraction 8 | layer for common tasks such as interfacing with network services, 9 | handling threads, or creating graphical user interfaces. Additionally, 10 | the library implements many useful algorithms such as data compression 11 | routines, linked lists, binary search trees, linear algebra and matrix 12 | utilities, machine learning algorithms, XML and text parsing, and many 13 | other general utilities. 14 | 15 | Documentation: 16 | There should be HTML documentation accompanying this library. But 17 | if there isn't you can download it from http://dlib.net 18 | 19 | Installation: 20 | To use this library all you have to do is extract the library 21 | somewhere, make sure the folder *containing* the dlib folder is in 22 | your include path, and finally add dlib/all/source.cpp to your 23 | project. 24 | 25 | An example makefile that uses this library can be found here: 26 | dlib/test/makefile. It is the makefile used to build the regression 27 | test suite for this library. There is also a CMake makefile that 28 | builds the regression test suite at dlib/test/CMakeLists.txt and 29 | another CMake makefile that builds all the example programs in 30 | the examples folder. 31 | 32 | For further information see the accompanying HTML documentation or 33 | visit http://dlib.net 34 | 35 | The license for this library can be found in LICENSE.txt. But the 36 | long and short of the license is that you can use this code however 37 | you like, even in closed source commercial software. 38 | 39 | -------------------------------------------------------------------------------- /src/dlib/dlib/all_console.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_ALL_CONSOLe_ 4 | #define DLIB_ALL_CONSOLe_ 5 | 6 | #error "This file has been replaced. Instead you should add dlib/all/source.cpp to your project" 7 | 8 | #endif // DLIB_ALL_CONSOLe_ 9 | 10 | -------------------------------------------------------------------------------- /src/dlib/dlib/all_gui.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_ALL_GUi_ 4 | #define DLIB_ALL_GUi_ 5 | 6 | #error "This file has been replaced. Instead you should add dlib/all/source.cpp to your project" 7 | 8 | #endif // DLIB_ALL_GUi_ 9 | 10 | -------------------------------------------------------------------------------- /src/dlib/dlib/any.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2010 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_AnY_ 4 | #define DLIB_AnY_ 5 | 6 | #include "any/any.h" 7 | 8 | #endif // DLIB_AnY_ 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/dlib/dlib/array/array_sort_2.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_ARRAY_SORt_2_ 4 | #define DLIB_ARRAY_SORt_2_ 5 | 6 | #include "array_sort_abstract.h" 7 | #include "../algs.h" 8 | #include "../sort.h" 9 | 10 | namespace dlib 11 | { 12 | 13 | template < 14 | typename array_base 15 | > 16 | class array_sort_2 : public array_base 17 | { 18 | 19 | public: 20 | 21 | /*! 22 | this is a median of three version of the QuickSort algorithm and 23 | this uses the dlib::qsort_array function 24 | !*/ 25 | 26 | void sort ( 27 | ); 28 | 29 | }; 30 | 31 | template < 32 | typename array_base 33 | > 34 | inline void swap ( 35 | array_sort_2& a, 36 | array_sort_2& b 37 | ) { a.swap(b); } 38 | 39 | // ---------------------------------------------------------------------------------------- 40 | // ---------------------------------------------------------------------------------------- 41 | // member function definitions 42 | // ---------------------------------------------------------------------------------------- 43 | // ---------------------------------------------------------------------------------------- 44 | 45 | template < 46 | typename array_base 47 | > 48 | void array_sort_2:: 49 | sort ( 50 | ) 51 | { 52 | if (this->size() > 1) 53 | { 54 | // call the quick sort function for arrays that is in algs.h 55 | dlib::qsort_array(*this,0,this->size()-1); 56 | } 57 | this->reset(); 58 | } 59 | 60 | // ---------------------------------------------------------------------------------------- 61 | 62 | } 63 | 64 | #endif // DLIB_ARRAY_SORt_2_ 65 | 66 | -------------------------------------------------------------------------------- /src/dlib/dlib/array/array_sort_abstract.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #undef DLIB_ARRAY_SORt_ABSTRACT_ 4 | #ifdef DLIB_ARRAY_SORt_ABSTRACT_ 5 | 6 | #include "array_kernel_abstract.h" 7 | 8 | namespace dlib 9 | { 10 | 11 | template < 12 | typename array_base 13 | > 14 | class array_sort : public array_base 15 | { 16 | 17 | /*! 18 | REQUIREMENTS ON ARRAY_BASE 19 | - must be an implementation of array/array_kernel_abstract.h 20 | - array_base::type must be a type with that is comparable via operator< 21 | 22 | POINTERS AND REFERENCES 23 | sort() may invalidate pointers and references to internal data. 24 | 25 | WHAT THIS EXTENSION DOES FOR ARRAY 26 | This gives an array the ability to sort its contents by calling sort(). 27 | !*/ 28 | 29 | 30 | public: 31 | 32 | void sort ( 33 | ); 34 | /*! 35 | ensures 36 | - for all elements in #*this the ith element is <= the i+1 element 37 | - #at_start() == true 38 | throws 39 | - std::bad_alloc or any exception thrown by T's constructor 40 | data may be lost if sort() throws 41 | !*/ 42 | 43 | }; 44 | 45 | template < 46 | typename array_base 47 | > 48 | inline void swap ( 49 | array_sort& a, 50 | array_sort& b 51 | ) { a.swap(b); } 52 | /*! 53 | provides a global swap function 54 | !*/ 55 | 56 | } 57 | 58 | #endif // DLIB_ARRAY_SORt_ABSTRACT_ 59 | 60 | -------------------------------------------------------------------------------- /src/dlib/dlib/array2d.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_ARRAY2d_ 4 | #define DLIB_ARRAY2d_ 5 | 6 | 7 | #include "array2d/array2d_kernel_1.h" 8 | #include "array2d/array2d_kernel_c.h" 9 | #include "memory_manager.h" 10 | 11 | 12 | 13 | namespace dlib 14 | { 15 | 16 | 17 | template < 18 | typename T, 19 | typename mem_manager = memory_manager::kernel_1a 20 | > 21 | class array2d 22 | { 23 | 24 | array2d() {} 25 | 26 | 27 | public: 28 | 29 | //----------- kernels --------------- 30 | 31 | // kernel_1a 32 | typedef array2d_kernel_1 33 | kernel_1a; 34 | typedef array2d_kernel_c 35 | kernel_1a_c; 36 | 37 | 38 | 39 | }; 40 | } 41 | 42 | #endif // DLIB_ARRAY2d_ 43 | 44 | -------------------------------------------------------------------------------- /src/dlib/dlib/base64.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_BASe64_ 4 | #define DLIB_BASe64_ 5 | 6 | 7 | #include "base64/base64_kernel_1.h" 8 | 9 | 10 | 11 | namespace dlib 12 | { 13 | 14 | 15 | class base64 16 | { 17 | 18 | base64() {} 19 | 20 | 21 | public: 22 | 23 | //----------- kernels --------------- 24 | 25 | // kernel_1a 26 | typedef base64_kernel_1 27 | kernel_1a; 28 | 29 | 30 | 31 | }; 32 | } 33 | 34 | #endif // DLIB_BASe64_ 35 | 36 | -------------------------------------------------------------------------------- /src/dlib/dlib/bayes_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_BAYES_UTILs_H_ 4 | #define DLIB_BAYES_UTILs_H_ 5 | 6 | #include "bayes_utils/bayes_utils.h" 7 | 8 | #endif // DLIB_BAYES_UTILs_H_ 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/dlib/dlib/bigint.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_BIGINt_ 4 | #define DLIB_BIGINt_ 5 | 6 | #include "bigint/bigint_kernel_1.h" 7 | #include "bigint/bigint_kernel_2.h" 8 | #include "bigint/bigint_kernel_c.h" 9 | 10 | 11 | 12 | 13 | namespace dlib 14 | { 15 | 16 | 17 | class bigint 18 | { 19 | bigint() {} 20 | 21 | 22 | public: 23 | 24 | //----------- kernels --------------- 25 | 26 | // kernel_1a 27 | typedef bigint_kernel_1 28 | kernel_1a; 29 | typedef bigint_kernel_c 30 | kernel_1a_c; 31 | 32 | // kernel_2a 33 | typedef bigint_kernel_2 34 | kernel_2a; 35 | typedef bigint_kernel_c 36 | kernel_2a_c; 37 | 38 | 39 | }; 40 | } 41 | 42 | #endif // DLIB_BIGINt_ 43 | 44 | -------------------------------------------------------------------------------- /src/dlib/dlib/binary_search_tree.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_BINARY_SEARCH_TREe_ 4 | #define DLIB_BINARY_SEARCH_TREe_ 5 | 6 | 7 | #include "binary_search_tree/binary_search_tree_kernel_1.h" 8 | #include "binary_search_tree/binary_search_tree_kernel_2.h" 9 | #include "binary_search_tree/binary_search_tree_kernel_c.h" 10 | 11 | 12 | #include "memory_manager.h" 13 | #include 14 | 15 | 16 | namespace dlib 17 | { 18 | 19 | template < 20 | typename domain, 21 | typename range, 22 | typename mem_manager = memory_manager::kernel_1a, 23 | typename compare = std::less 24 | > 25 | class binary_search_tree 26 | { 27 | binary_search_tree() {} 28 | 29 | public: 30 | 31 | //----------- kernels --------------- 32 | 33 | // kernel_1a 34 | typedef binary_search_tree_kernel_1 35 | kernel_1a; 36 | typedef binary_search_tree_kernel_c 37 | kernel_1a_c; 38 | 39 | 40 | // kernel_2a 41 | typedef binary_search_tree_kernel_2 42 | kernel_2a; 43 | typedef binary_search_tree_kernel_c 44 | kernel_2a_c; 45 | 46 | }; 47 | } 48 | 49 | #endif // DLIB_BINARY_SEARCH_TREe_ 50 | 51 | -------------------------------------------------------------------------------- /src/dlib/dlib/bit_stream.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_BIT_STREAm_ 4 | #define DLIB_BIT_STREAm_ 5 | 6 | #include "bit_stream/bit_stream_kernel_1.h" 7 | #include "bit_stream/bit_stream_kernel_c.h" 8 | 9 | #include "bit_stream/bit_stream_multi_1.h" 10 | #include "bit_stream/bit_stream_multi_c.h" 11 | 12 | namespace dlib 13 | { 14 | 15 | 16 | class bit_stream 17 | { 18 | bit_stream() {} 19 | public: 20 | 21 | //----------- kernels --------------- 22 | 23 | // kernel_1a 24 | typedef bit_stream_kernel_1 25 | kernel_1a; 26 | typedef bit_stream_kernel_c 27 | kernel_1a_c; 28 | 29 | //---------- extensions ------------ 30 | 31 | 32 | // multi_1 extend kernel_1a 33 | typedef bit_stream_multi_1 34 | multi_1a; 35 | typedef bit_stream_multi_c > 36 | multi_1a_c; 37 | 38 | }; 39 | } 40 | 41 | #endif // DLIB_BIT_STREAm_ 42 | 43 | -------------------------------------------------------------------------------- /src/dlib/dlib/bound_function_pointer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_BOUND_FUNCTION_POINTEr_ 4 | #define DLIB_BOUND_FUNCTION_POINTEr_ 5 | 6 | #include "bound_function_pointer/bound_function_pointer_kernel_1.h" 7 | #include "bound_function_pointer/bound_function_pointer_kernel_c.h" 8 | 9 | namespace dlib 10 | { 11 | 12 | class bound_function_pointer 13 | { 14 | bound_function_pointer() {} 15 | 16 | 17 | public: 18 | 19 | //----------- kernels --------------- 20 | 21 | // kernel_1a 22 | typedef bound_function_pointer_kernel_1 23 | kernel_1a; 24 | typedef bound_function_pointer_kernel_c 25 | kernel_1a_c; 26 | 27 | 28 | }; 29 | } 30 | 31 | #endif // DLIB_BOUND_FUNCTION_POINTEr_ 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/dlib/dlib/byte_orderer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_BYTE_ORDEREr_ 4 | #define DLIB_BYTE_ORDEREr_ 5 | 6 | 7 | #include "byte_orderer/byte_orderer_kernel_1.h" 8 | 9 | 10 | 11 | namespace dlib 12 | { 13 | 14 | 15 | class byte_orderer 16 | { 17 | 18 | byte_orderer() {} 19 | 20 | 21 | public: 22 | 23 | //----------- kernels --------------- 24 | 25 | // kernel_1a 26 | typedef byte_orderer_kernel_1 27 | kernel_1a; 28 | 29 | 30 | 31 | }; 32 | } 33 | 34 | #endif // DLIB_BYTE_ORDEREr_ 35 | 36 | -------------------------------------------------------------------------------- /src/dlib/dlib/cassert: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/cmd_line_parser.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_CMD_LINE_PARSEr_ 4 | #define DLIB_CMD_LINE_PARSEr_ 5 | 6 | #include "cmd_line_parser/cmd_line_parser_kernel_1.h" 7 | #include "cmd_line_parser/cmd_line_parser_kernel_c.h" 8 | #include "cmd_line_parser/cmd_line_parser_print_1.h" 9 | #include "cmd_line_parser/cmd_line_parser_check_1.h" 10 | #include "cmd_line_parser/cmd_line_parser_check_c.h" 11 | #include 12 | 13 | #include "map.h" 14 | #include "sequence.h" 15 | 16 | 17 | 18 | namespace dlib 19 | { 20 | 21 | 22 | template < 23 | typename charT 24 | > 25 | class cmd_line_parser 26 | { 27 | cmd_line_parser() {} 28 | 29 | typedef typename sequence >::kernel_2a sequence_2a; 30 | typedef typename sequence*>::kernel_2a psequence_2a; 31 | typedef typename map,void*>::kernel_1a map_1a_string; 32 | 33 | public: 34 | 35 | //----------- kernels --------------- 36 | 37 | // kernel_1a 38 | typedef cmd_line_parser_kernel_1 39 | kernel_1a; 40 | typedef cmd_line_parser_kernel_c 41 | kernel_1a_c; 42 | 43 | 44 | 45 | //----------- extensions --------------- 46 | 47 | // print_1 extend kernel_1a 48 | typedef cmd_line_parser_print_1 49 | print_1a; 50 | typedef cmd_line_parser_print_1 51 | print_1a_c; 52 | 53 | // check_1 extend print_1a 54 | typedef cmd_line_parser_check_1 55 | check_1a; 56 | typedef cmd_line_parser_check_c > 57 | check_1a_c; 58 | 59 | }; 60 | } 61 | 62 | #endif // DLIB_CMD_LINE_PARSEr_ 63 | 64 | -------------------------------------------------------------------------------- /src/dlib/dlib/cmd_line_parser/cmd_line_parser_print_abstract.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #undef DLIB_CMD_LINE_PARSER_PRINt_ABSTRACT_ 4 | #ifdef DLIB_CMD_LINE_PARSER_PRINt_ABSTRACT_ 5 | 6 | 7 | #include "cmd_line_parser_kernel_abstract.h" 8 | #include 9 | 10 | namespace dlib 11 | { 12 | 13 | template < 14 | typename clp_base 15 | > 16 | class cmd_line_parser_print : public clp_base 17 | { 18 | 19 | /*! 20 | REQUIREMENTS ON CLP_BASE 21 | clp_base is an implementation of cmd_line_parser/cmd_line_parser_kernel_abstract.h 22 | 23 | 24 | POINTERS AND REFERENCES TO INTERNAL DATA 25 | The print_options() function may invalidate pointers or references to 26 | internal data. 27 | 28 | 29 | WHAT THIS EXTENSION DOES FOR CMD_LINE_PARSER 30 | This gives a cmd_line_parser object the ability to print its options 31 | in a nice format that fits into a console screen. 32 | !*/ 33 | 34 | 35 | public: 36 | 37 | void print_options ( 38 | std::basic_ostream& out 39 | ) const; 40 | /*! 41 | ensures 42 | - prints all the command line options to out. 43 | - #at_start() == true 44 | throws 45 | - any exception. 46 | if an exception is thrown then #at_start() == true but otherwise 47 | it will have no effect on the state of #*this. 48 | !*/ 49 | }; 50 | 51 | template < 52 | typename clp_base 53 | > 54 | inline void swap ( 55 | cmd_line_parser_print& a, 56 | cmd_line_parser_print& b 57 | ) { a.swap(b); } 58 | /*! 59 | provides a global swap function 60 | !*/ 61 | 62 | } 63 | 64 | #endif // DLIB_CMD_LINE_PARSER_PRINt_ABSTRACT_ 65 | 66 | -------------------------------------------------------------------------------- /src/dlib/dlib/config_reader.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_CONFIG_READEr_ 4 | #define DLIB_CONFIG_READEr_ 5 | 6 | #include "config_reader/config_reader_kernel_1.h" 7 | #include "map.h" 8 | #include "tokenizer.h" 9 | 10 | #include "algs.h" 11 | 12 | #ifndef DLIB_ISO_CPP_ONLY 13 | #include "config_reader/config_reader_thread_safe_1.h" 14 | #endif 15 | 16 | namespace dlib 17 | { 18 | 19 | 20 | class config_reader 21 | { 22 | config_reader() {} 23 | 24 | public: 25 | 26 | //----------- kernels --------------- 27 | 28 | // kernel_1a 29 | typedef config_reader_kernel_1< 30 | map::kernel_1b, 31 | map::kernel_1b, 32 | tokenizer::kernel_1a 33 | > kernel_1a; 34 | 35 | 36 | #ifndef DLIB_ISO_CPP_ONLY 37 | // thread_safe_1a 38 | typedef config_reader_thread_safe_1< 39 | kernel_1a, 40 | map::kernel_1b 41 | > thread_safe_1a; 42 | 43 | #endif // DLIB_ISO_CPP_ONLY 44 | 45 | }; 46 | 47 | } 48 | 49 | #endif // DLIB_CONFIG_READEr_ 50 | 51 | -------------------------------------------------------------------------------- /src/dlib/dlib/config_reader/config_reader_thread_safe_abstract.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #undef DLIB_CONFIG_READER_THREAD_SAFe_ABSTRACT_ 4 | #ifdef DLIB_CONFIG_READER_THREAD_SAFe_ABSTRACT_ 5 | 6 | #include 7 | #include 8 | #include "config_reader_kernel_abstract.h" 9 | #include "../threads/threads_kernel_abstract.h" 10 | 11 | namespace dlib 12 | { 13 | 14 | template < 15 | typename config_reader_base 16 | > 17 | class config_reader_thread_safe 18 | { 19 | 20 | /*! 21 | REQUIREMENTS ON config_reader_base 22 | is an implementation of config_reader/config_reader_kernel_abstract.h 23 | 24 | WHAT THIS EXTENSION DOES FOR config_reader 25 | This object extends a normal config_reader by simply wrapping all 26 | its member functions inside mutex locks to make it safe to use 27 | in a threaded program. 28 | 29 | So this object provides an interface identical to the one defined 30 | in the config_reader/config_reader_kernel_abstract.h file except that 31 | the rmutex returned by get_mutex() is always locked when this 32 | object's member functions are called. 33 | !*/ 34 | 35 | public: 36 | 37 | const rmutex& get_mutex ( 38 | ) const; 39 | /*! 40 | ensures 41 | - returns the rmutex used to make this object thread safe. i.e. returns 42 | the rmutex that is locked when this object's functions are called. 43 | !*/ 44 | 45 | }; 46 | 47 | } 48 | 49 | #endif // DLIB_CONFIG_READER_THREAD_SAFe_ABSTRACT_ 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/dlib/dlib/cpp_pretty_printer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_CPP_PRETTY_PRINTEr_ 4 | #define DLIB_CPP_PRETTY_PRINTEr_ 5 | 6 | 7 | #include "cpp_pretty_printer/cpp_pretty_printer_kernel_1.h" 8 | #include "cpp_pretty_printer/cpp_pretty_printer_kernel_2.h" 9 | #include "cpp_tokenizer.h" 10 | #include "stack.h" 11 | 12 | namespace dlib 13 | { 14 | 15 | class cpp_pretty_printer 16 | { 17 | cpp_pretty_printer() {} 18 | 19 | 20 | typedef stack::kernel_1a stack; 21 | typedef cpp_tokenizer::kernel_1a tok; 22 | 23 | public: 24 | 25 | //----------- kernels --------------- 26 | 27 | // kernel_1a 28 | typedef cpp_pretty_printer_kernel_1 29 | kernel_1a; 30 | 31 | // kernel_2a 32 | typedef cpp_pretty_printer_kernel_2 33 | kernel_2a; 34 | 35 | }; 36 | } 37 | 38 | #endif // DLIB_CPP_PRETTY_PRINTEr_ 39 | 40 | -------------------------------------------------------------------------------- /src/dlib/dlib/cpp_tokenizer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_CPP_TOKENIZEr_ 4 | #define DLIB_CPP_TOKENIZEr_ 5 | 6 | #include 7 | #include "cpp_tokenizer/cpp_tokenizer_kernel_1.h" 8 | #include "cpp_tokenizer/cpp_tokenizer_kernel_c.h" 9 | #include "tokenizer.h" 10 | #include "queue.h" 11 | #include "set.h" 12 | 13 | namespace dlib 14 | { 15 | 16 | class cpp_tokenizer 17 | { 18 | cpp_tokenizer() {} 19 | 20 | 21 | typedef set::kernel_1a set; 22 | typedef queue::kernel_2a queue; 23 | typedef tokenizer::kernel_1a tok; 24 | 25 | public: 26 | 27 | //----------- kernels --------------- 28 | 29 | // kernel_1a 30 | typedef cpp_tokenizer_kernel_1 31 | kernel_1a; 32 | typedef cpp_tokenizer_kernel_c 33 | kernel_1a_c; 34 | 35 | 36 | }; 37 | } 38 | 39 | #endif // DLIB_CPP_TOKENIZEr_ 40 | 41 | -------------------------------------------------------------------------------- /src/dlib/dlib/crc32.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_CRc32_ 4 | #define DLIB_CRc32_ 5 | 6 | 7 | #include "crc32/crc32_kernel_1.h" 8 | 9 | 10 | 11 | namespace dlib 12 | { 13 | 14 | 15 | class crc32 16 | { 17 | 18 | crc32() {} 19 | 20 | 21 | public: 22 | 23 | //----------- kernels --------------- 24 | 25 | // kernel_1a 26 | typedef crc32_kernel_1 27 | kernel_1a; 28 | 29 | 30 | 31 | }; 32 | } 33 | 34 | #endif // DLIB_CRc32_ 35 | 36 | -------------------------------------------------------------------------------- /src/dlib/dlib/cstring: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/data_io.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2010 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_DATA_Io_HEADER 4 | #define DLIB_DATA_Io_HEADER 5 | 6 | #include "data_io/libsvm_io.h" 7 | 8 | #endif // DLIB_DATA_Io_HEADER 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/dlib/dlib/dir_nav.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_DIR_NAv_ 4 | #define DLIB_DIR_NAv_ 5 | 6 | 7 | #include "platform.h" 8 | 9 | 10 | #ifdef WIN32 11 | #include "dir_nav/windows.h" 12 | #endif 13 | 14 | #ifndef WIN32 15 | #include "dir_nav/posix.h" 16 | #endif 17 | 18 | #include "dir_nav/dir_nav_extensions.h" 19 | 20 | #endif // DLIB_DIR_NAv_ 21 | 22 | -------------------------------------------------------------------------------- /src/dlib/dlib/dir_nav/dir_nav_extensions.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2009 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_DIR_NAV_EXTENSIONs_CPP_ 4 | #define DLIB_DIR_NAV_EXTENSIONs_CPP_ 5 | 6 | #include "dir_nav_extensions.h" 7 | 8 | namespace dlib 9 | { 10 | 11 | // ---------------------------------------------------------------------------------------- 12 | 13 | namespace implementation_details 14 | { 15 | void get_all_sub_dirs ( 16 | const directory& top_of_tree, 17 | unsigned long max_depth, 18 | std::vector& result, 19 | std::vector& temp 20 | ) 21 | { 22 | if (max_depth > 0) 23 | { 24 | top_of_tree.get_dirs(temp); 25 | const unsigned long start = result.size(); 26 | result.insert(result.end(), temp.begin(), temp.end()); 27 | const unsigned long end = start + temp.size(); 28 | 29 | for (unsigned long i = start; i < end; ++i) 30 | { 31 | get_all_sub_dirs(result[i], max_depth-1, result, temp); 32 | } 33 | } 34 | } 35 | } 36 | 37 | // ---------------------------------------------------------------------------------------- 38 | 39 | directory get_parent_directory ( 40 | const directory& dir 41 | ) 42 | { 43 | return dir.get_parent(); 44 | } 45 | 46 | // ---------------------------------------------------------------------------------------- 47 | 48 | directory get_parent_directory ( 49 | const file& f 50 | ) 51 | { 52 | if (f.full_name().size() == 0) 53 | return directory(); 54 | 55 | std::string::size_type pos = f.full_name().find_last_of("\\/"); 56 | 57 | if (pos == std::string::npos) 58 | return directory(); 59 | 60 | return directory(f.full_name().substr(0,pos)); 61 | } 62 | 63 | // ---------------------------------------------------------------------------------------- 64 | 65 | } 66 | 67 | #endif // DLIB_DIR_NAV_EXTENSIONs_CPP_ 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/dlib/dlib/dir_nav/posix.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_DIR_NAV_KERNEl_1_ 4 | #include "dir_nav_kernel_2.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/dir_nav/windows.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_DIR_NAV_KERNEl_2_ 4 | #include "dir_nav_kernel_1.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/directed_graph.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_DIRECTED_GRAPh_ 4 | #define DLIB_DIRECTED_GRAPh_ 5 | 6 | #include "directed_graph/directed_graph_kernel_1.h" 7 | 8 | #include "memory_manager.h" 9 | 10 | namespace dlib 11 | { 12 | 13 | template < 14 | typename T, 15 | typename E = char, 16 | typename mem_manager = memory_manager::kernel_1a 17 | > 18 | class directed_graph 19 | { 20 | directed_graph() {} 21 | public: 22 | 23 | 24 | //----------- kernels --------------- 25 | 26 | // kernel_1a 27 | typedef directed_graph_kernel_1 28 | kernel_1a; 29 | typedef directed_graph_kernel_1 30 | kernel_1a_c; 31 | 32 | }; 33 | } 34 | 35 | #endif // DLIB_DIRECTED_GRAPh_ 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/dlib/dlib/dlib_include_path_tutorial.txt: -------------------------------------------------------------------------------- 1 | #error "Don't put the dlib folder in your include path" 2 | /* 3 | You are getting this error because you have added the dlib folder to your 4 | compiler's include search path. 5 | 6 | You should *NOT* add the dlib folder itself to your compiler's include path. 7 | Doing so will cause the build to fail because of name collisions (such as 8 | dlib/string.h and string.h from the standard library). Instead you should 9 | add the folder that contains the dlib folder to your include search path 10 | and then use include statements of the form #include or 11 | #include "dlib/queue.h". This will ensure that everything builds correctly. 12 | 13 | XCode: 14 | The XCode IDE often puts all folders that it knows about into 15 | the compiler search path. So if you are using XCode then either 16 | don't drag the whole dlib folder into the project or alternatively 17 | modify your XCode project settings to not auto-add all folders to 18 | the include path. Instead just make sure that the dlib folder is 19 | itself inside a folder in your include path. 20 | */ 21 | -------------------------------------------------------------------------------- /src/dlib/dlib/entropy_decoder.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_ENTROPY_DECODEr_ 4 | #define DLIB_ENTROPY_DECODEr_ 5 | 6 | #include "entropy_decoder/entropy_decoder_kernel_1.h" 7 | #include "entropy_decoder/entropy_decoder_kernel_2.h" 8 | #include "entropy_decoder/entropy_decoder_kernel_c.h" 9 | 10 | 11 | 12 | 13 | namespace dlib 14 | { 15 | 16 | 17 | class entropy_decoder 18 | { 19 | entropy_decoder() {} 20 | 21 | 22 | public: 23 | 24 | //----------- kernels --------------- 25 | 26 | // kernel_1a 27 | typedef entropy_decoder_kernel_1 28 | kernel_1a; 29 | typedef entropy_decoder_kernel_c 30 | kernel_1a_c; 31 | 32 | 33 | // kernel_2a 34 | typedef entropy_decoder_kernel_2 35 | kernel_2a; 36 | typedef entropy_decoder_kernel_c 37 | kernel_2a_c; 38 | 39 | 40 | }; 41 | } 42 | 43 | #endif // DLIB_ENTROPY_DECODEr_ 44 | 45 | -------------------------------------------------------------------------------- /src/dlib/dlib/entropy_encoder.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_ENTROPY_ENCODEr_ 4 | #define DLIB_ENTROPY_ENCODEr_ 5 | 6 | #include "entropy_encoder/entropy_encoder_kernel_1.h" 7 | #include "entropy_encoder/entropy_encoder_kernel_2.h" 8 | #include "entropy_encoder/entropy_encoder_kernel_c.h" 9 | 10 | 11 | 12 | 13 | namespace dlib 14 | { 15 | 16 | 17 | class entropy_encoder 18 | { 19 | entropy_encoder() {} 20 | 21 | 22 | public: 23 | 24 | //----------- kernels --------------- 25 | 26 | // kernel_1a 27 | typedef entropy_encoder_kernel_1 28 | kernel_1a; 29 | typedef entropy_encoder_kernel_c 30 | kernel_1a_c; 31 | 32 | 33 | // kernel_2a 34 | typedef entropy_encoder_kernel_2 35 | kernel_2a; 36 | typedef entropy_encoder_kernel_c 37 | kernel_2a_c; 38 | 39 | }; 40 | } 41 | 42 | #endif // DLIB_ENTROPY_ENCODEr_ 43 | 44 | -------------------------------------------------------------------------------- /src/dlib/dlib/fstream: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/geometry.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_GEOMETRy_HEADER 4 | #define DLIB_GEOMETRy_HEADER 5 | 6 | #include "geometry/rectangle.h" 7 | #include "geometry/vector.h" 8 | 9 | #endif // DLIB_GEOMETRy_HEADER 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/dlib/dlib/graph.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_GRAPh_ 4 | #define DLIB_GRAPh_ 5 | 6 | #include "graph/graph_kernel_1.h" 7 | 8 | #include "memory_manager.h" 9 | 10 | namespace dlib 11 | { 12 | 13 | template < 14 | typename T, 15 | typename E = char, 16 | typename mem_manager = memory_manager::kernel_1a 17 | > 18 | class graph 19 | { 20 | graph() {} 21 | public: 22 | 23 | 24 | //----------- kernels --------------- 25 | 26 | // kernel_1a 27 | typedef graph_kernel_1 28 | kernel_1a; 29 | typedef graph_kernel_1 30 | kernel_1a_c; 31 | 32 | }; 33 | } 34 | 35 | #endif // DLIB_GRAPh_ 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/dlib/dlib/graph_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_GRAPH_UTILs_H_ 4 | #define DLIB_GRAPH_UTILs_H_ 5 | 6 | #include "graph_utils/graph_utils.h" 7 | 8 | #endif // DLIB_GRAPH_UTILs_H_ 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/dlib/dlib/gui_core.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_GUI_CORe_ 4 | #define DLIB_GUI_CORe_ 5 | 6 | 7 | #include "platform.h" 8 | 9 | 10 | 11 | #ifdef WIN32 12 | #include "gui_core/windows.h" 13 | #else 14 | #include "gui_core/xlib.h" 15 | #endif 16 | 17 | 18 | 19 | #endif // DLIB_GUI_CORe_ 20 | 21 | -------------------------------------------------------------------------------- /src/dlib/dlib/gui_core/windows.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_GUI_CORE_KERNEl_2_ 4 | #include "gui_core_kernel_1.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/gui_core/xlib.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_GUI_CORE_KERNEl_1_ 4 | #include "gui_core_kernel_2.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/gui_widgets.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_GUI_WIDGETs_ 4 | #define DLIB_GUI_WIDGETs_ 5 | 6 | 7 | 8 | #include "gui_widgets/widgets.h" 9 | 10 | 11 | 12 | #endif // DLIB_GUI_WIDGETs_ 13 | 14 | -------------------------------------------------------------------------------- /src/dlib/dlib/hash_map.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_HASH_MAp_ 4 | #define DLIB_HASH_MAp_ 5 | 6 | #include "hash_map/hash_map_kernel_1.h" 7 | #include "hash_map/hash_map_kernel_c.h" 8 | 9 | #include "hash_table.h" 10 | #include "algs.h" 11 | 12 | #include "memory_manager.h" 13 | #include 14 | 15 | namespace dlib 16 | { 17 | 18 | template < 19 | typename domain, 20 | typename range, 21 | unsigned long expnum, 22 | typename mem_manager = memory_manager::kernel_1a, 23 | typename compare = std::less 24 | > 25 | class hash_map 26 | { 27 | hash_map() {} 28 | 29 | typedef typename hash_table::kernel_1a 30 | hash_table_1; 31 | typedef typename hash_table::kernel_2a 32 | hash_table_2; 33 | typedef typename hash_table::kernel_2b 34 | hash_table_3; 35 | 36 | public: 37 | 38 | //----------- kernels --------------- 39 | 40 | // kernel_1a 41 | typedef hash_map_kernel_1 42 | kernel_1a; 43 | typedef hash_map_kernel_c 44 | kernel_1a_c; 45 | 46 | // kernel_1b 47 | typedef hash_map_kernel_1 48 | kernel_1b; 49 | typedef hash_map_kernel_c 50 | kernel_1b_c; 51 | 52 | // kernel_1c 53 | typedef hash_map_kernel_1 54 | kernel_1c; 55 | typedef hash_map_kernel_c 56 | kernel_1c_c; 57 | 58 | 59 | }; 60 | } 61 | 62 | #endif // DLIB_HASH_MAp_ 63 | 64 | -------------------------------------------------------------------------------- /src/dlib/dlib/hash_set.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_HASH_SEt_ 4 | #define DLIB_HASH_SEt_ 5 | 6 | #include "hash_set/hash_set_kernel_1.h" 7 | #include "hash_set/hash_set_kernel_c.h" 8 | 9 | #include "hash_table.h" 10 | #include "algs.h" 11 | 12 | 13 | #include "memory_manager.h" 14 | #include 15 | 16 | 17 | namespace dlib 18 | { 19 | 20 | template < 21 | typename T, 22 | unsigned long expnum, 23 | typename mem_manager = memory_manager::kernel_1a, 24 | typename compare = std::less 25 | > 26 | class hash_set 27 | { 28 | hash_set() {} 29 | 30 | typedef typename hash_table::kernel_1a ht1a; 31 | typedef typename hash_table::kernel_1a ht2a; 32 | typedef typename hash_table::kernel_1a ht2b; 33 | 34 | public: 35 | 36 | //----------- kernels --------------- 37 | 38 | // kernel_1a 39 | typedef hash_set_kernel_1 40 | kernel_1a; 41 | typedef hash_set_kernel_c 42 | kernel_1a_c; 43 | 44 | // kernel_1b 45 | typedef hash_set_kernel_1 46 | kernel_1b; 47 | typedef hash_set_kernel_c 48 | kernel_1b_c; 49 | 50 | // kernel_1c 51 | typedef hash_set_kernel_1 52 | kernel_1c; 53 | typedef hash_set_kernel_c 54 | kernel_1c_c; 55 | 56 | 57 | 58 | 59 | }; 60 | } 61 | 62 | #endif // DLIB_HASH_SEt_ 63 | 64 | -------------------------------------------------------------------------------- /src/dlib/dlib/hash_table.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_HASH_TABLe_ 4 | #define DLIB_HASH_TABLe_ 5 | 6 | 7 | #include "hash_table/hash_table_kernel_1.h" 8 | #include "hash_table/hash_table_kernel_2.h" 9 | #include "hash_table/hash_table_kernel_c.h" 10 | #include "memory_manager.h" 11 | 12 | #include "binary_search_tree.h" 13 | #include 14 | 15 | 16 | namespace dlib 17 | { 18 | 19 | template < 20 | typename domain, 21 | typename range, 22 | typename mem_manager = memory_manager::kernel_1a, 23 | typename compare = std::less 24 | > 25 | class hash_table 26 | { 27 | hash_table() {} 28 | 29 | typedef typename binary_search_tree::kernel_1a 30 | bst_1; 31 | typedef typename binary_search_tree::kernel_2a 32 | bst_2; 33 | 34 | public: 35 | 36 | //----------- kernels --------------- 37 | 38 | // kernel_1a 39 | typedef hash_table_kernel_1 40 | kernel_1a; 41 | typedef hash_table_kernel_c 42 | kernel_1a_c; 43 | 44 | 45 | // kernel_2a 46 | typedef hash_table_kernel_2 47 | kernel_2a; 48 | typedef hash_table_kernel_c 49 | kernel_2a_c; 50 | 51 | // kernel_2b 52 | typedef hash_table_kernel_2 53 | kernel_2b; 54 | typedef hash_table_kernel_c 55 | kernel_2b_c; 56 | }; 57 | } 58 | 59 | #endif // DLIB_HASH_TABLe_ 60 | 61 | -------------------------------------------------------------------------------- /src/dlib/dlib/image_io.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_IMAGe_IO_ 4 | #define DLIB_IMAGe_IO_ 5 | 6 | #include "image_loader/image_loader.h" 7 | #include "image_loader/png_loader.h" 8 | #include "image_loader/jpeg_loader.h" 9 | #include "image_saver/image_saver.h" 10 | 11 | #endif // DLIB_IMAGe_IO_ 12 | 13 | -------------------------------------------------------------------------------- /src/dlib/dlib/image_keypoint.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2009 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_IMAGE_KEYPOINt_H_ 4 | #define DLIB_IMAGE_KEYPOINt_H_ 5 | 6 | #include "image_keypoint/surf.h" 7 | #include "image_keypoint/hessian_pyramid.h" 8 | #include "image_keypoint/hog.h" 9 | 10 | #endif // DLIB_IMAGE_KEYPOINt_H_ 11 | 12 | -------------------------------------------------------------------------------- /src/dlib/dlib/image_transforms.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_IMAGE_TRANSFORMs_ 4 | #define DLIB_IMAGE_TRANSFORMs_ 5 | 6 | #include "image_transforms/assign_image.h" 7 | #include "image_transforms/equalize_histogram.h" 8 | #include "image_transforms/morphological_operations.h" 9 | #include "image_transforms/spatial_filtering.h" 10 | #include "image_transforms/thresholding.h" 11 | #include "image_transforms/edge_detector.h" 12 | #include "image_transforms/draw.h" 13 | #include "image_transforms/integral_image.h" 14 | #include "image_transforms/image_pyramid.h" 15 | 16 | #endif // DLIB_IMAGE_TRANSFORMs_ 17 | 18 | -------------------------------------------------------------------------------- /src/dlib/dlib/image_transforms/draw_abstract.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #undef DLIB_DRAW_IMAGe_ABSTRACT 4 | #ifdef DLIB_DRAW_IMAGe_ABSTRACT 5 | 6 | 7 | namespace dlib 8 | { 9 | 10 | // ---------------------------------------------------------------------------------------- 11 | 12 | template < 13 | typename image_type 14 | > 15 | void draw_line ( 16 | long x1, 17 | long y1, 18 | long x2, 19 | long y2, 20 | image_type& img, 21 | typename image_type::type val 22 | ); 23 | /*! 24 | requires 25 | - image_type == is an implementation of array2d/array2d_kernel_abstract.h 26 | ensures 27 | - #img.nr() == img.nr() && #img.nc() == img.nc() 28 | (i.e. the dimensions of the input image are not chanaged) 29 | - for all valid r and c that are on the line between point (x1,y1) 30 | and point (x2,y2): 31 | - performs img[r][c] = val 32 | (i.e. it draws the line from (x1,y1) to (x2,y2) onto the image) 33 | !*/ 34 | 35 | // ---------------------------------------------------------------------------------------- 36 | 37 | } 38 | 39 | #endif // DLIB_DRAW_IMAGe_ABSTRACT 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/dlib/dlib/image_transforms/image_pyramid_abstract.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2010 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #undef DLIB_IMAGE_PYRaMID_ABSTRACT_H__ 4 | #ifdef DLIB_IMAGE_PYRaMID_ABSTRACT_H__ 5 | 6 | #include "../pixel.h" 7 | #include "../array2d.h" 8 | 9 | namespace dlib 10 | { 11 | 12 | class pyramid_down : noncopyable 13 | { 14 | /*! 15 | WHAT THIS OBJECT REPRESENTS 16 | This is a simple functor to help create image pyramids. 17 | !*/ 18 | public: 19 | 20 | template < 21 | typename in_image_type, 22 | typename out_image_type 23 | > 24 | void operator() ( 25 | const in_image_type& original, 26 | out_image_type& down 27 | ); 28 | /*! 29 | requires 30 | - original.nr() > 10 31 | - original.nc() > 10 32 | - in_image_type == is an implementation of array2d/array2d_kernel_abstract.h 33 | - out_image_type == is an implementation of array2d/array2d_kernel_abstract.h 34 | - pixel_traits::has_alpha == false 35 | - pixel_traits::has_alpha == false 36 | ensures 37 | - #down will contain an image that is roughly half the size of the original 38 | image. To be specific, this function performs the following steps: 39 | - 1. Applies a 5x5 Gaussian filter to the original image to smooth it a little. 40 | - 2. Every other row and column is discarded to create an image half the size 41 | of the original. This smaller image is stored in #down. 42 | !*/ 43 | }; 44 | 45 | } 46 | 47 | #endif // DLIB_IMAGE_PYRaMID_ABSTRACT_H__ 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/dlib/dlib/interfaces/map_pair.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MAP_PAIr_INTERFACE_ 4 | #define DLIB_MAP_PAIr_INTERFACE_ 5 | 6 | namespace dlib 7 | { 8 | 9 | // ---------------------------------------------------------------------------------------- 10 | 11 | template < 12 | typename T1, 13 | typename T2 14 | > 15 | class map_pair 16 | { 17 | /*! 18 | POINTERS AND REFERENCES TO INTERNAL DATA 19 | None of the functions in map_pair will invalidate 20 | pointers or references to internal data when called. 21 | 22 | WHAT THIS OBJECT REPRESENTS 23 | this object is used to return the key/value pair used in the 24 | map and hash_map containers when using the enumerable interface. 25 | 26 | note that the enumerable interface is defined in 27 | interfaces/enumerable.h 28 | !*/ 29 | 30 | public: 31 | typedef T1 key_type; 32 | typedef T2 value_type; 33 | 34 | virtual ~map_pair( 35 | )=0; 36 | 37 | virtual const T1& key( 38 | ) const =0; 39 | /*! 40 | ensures 41 | - returns a const reference to the key 42 | !*/ 43 | 44 | virtual const T2& value( 45 | ) const =0; 46 | /*! 47 | ensures 48 | - returns a const reference to the value associated with key 49 | !*/ 50 | 51 | virtual T2& value( 52 | )=0; 53 | /*! 54 | ensures 55 | - returns a non-const reference to the value associated with key 56 | !*/ 57 | 58 | protected: 59 | 60 | // restricted functions 61 | map_pair& operator=(const map_pair&) {return *this;} // no assignment operator 62 | 63 | }; 64 | 65 | // destructor does nothing 66 | template 67 | map_pair::~map_pair () {} 68 | 69 | // ---------------------------------------------------------------------------------------- 70 | 71 | } 72 | 73 | #endif // DLIB_MAP_PAIr_INTERFACE_ 74 | 75 | -------------------------------------------------------------------------------- /src/dlib/dlib/iomanip: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/iosfwd: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/iostream: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/istream: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/linker.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_LINKEr_ 4 | #define DLIB_LINKEr_ 5 | 6 | #include "linker/linker_kernel_1.h" 7 | #include "linker/linker_kernel_c.h" 8 | 9 | #include "algs.h" 10 | 11 | 12 | 13 | namespace dlib 14 | { 15 | 16 | 17 | class linker 18 | { 19 | linker() {} 20 | 21 | public: 22 | 23 | //----------- kernels --------------- 24 | 25 | // kernel_1a 26 | typedef linker_kernel_1 27 | kernel_1a; 28 | typedef linker_kernel_c 29 | kernel_1a_c; 30 | 31 | 32 | }; 33 | 34 | } 35 | 36 | #endif // DLIB_LINKEr_ 37 | 38 | -------------------------------------------------------------------------------- /src/dlib/dlib/linker/linker_kernel_c.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_LINKER_KERNEl_C_ 4 | #define DLIB_LINKER_KERNEl_C_ 5 | 6 | #include "linker_kernel_abstract.h" 7 | #include "../sockets.h" 8 | #include "../algs.h" 9 | #include "../assert.h" 10 | 11 | namespace dlib 12 | { 13 | 14 | 15 | template < 16 | typename linker_base 17 | > 18 | class linker_kernel_c : public linker_base 19 | { 20 | 21 | public: 22 | 23 | void link ( 24 | connection& a, 25 | connection& b 26 | ); 27 | 28 | }; 29 | 30 | 31 | // ---------------------------------------------------------------------------------------- 32 | // ---------------------------------------------------------------------------------------- 33 | // member function definitions 34 | // ---------------------------------------------------------------------------------------- 35 | // ---------------------------------------------------------------------------------------- 36 | 37 | template < 38 | typename linker_base 39 | > 40 | void linker_kernel_c:: 41 | link ( 42 | connection& a, 43 | connection& b 44 | ) 45 | { 46 | // make sure requires clause is not broken 47 | DLIB_CASSERT( 48 | this->is_running() == false , 49 | "\tvoid linker::link" 50 | << "\n\tis_running() == " << this->is_running() 51 | << "\n\tthis: " << this 52 | ); 53 | 54 | // call the real function 55 | linker_base::link(a,b); 56 | } 57 | 58 | // ---------------------------------------------------------------------------------------- 59 | 60 | } 61 | 62 | #endif // DLIB_LINKER_KERNEl_C_ 63 | 64 | -------------------------------------------------------------------------------- /src/dlib/dlib/locale: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/logger.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_LOGGEr_ 4 | #define DLIB_LOGGEr_ 5 | 6 | #include "logger/logger_kernel_1.h" 7 | #include "logger/extra_logger_headers.h" 8 | #include "logger/logger_config_file.h" 9 | 10 | #endif // DLIB_LOGGEr_ 11 | 12 | -------------------------------------------------------------------------------- /src/dlib/dlib/lz77_buffer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_LZ77_BUFFEr_ 4 | #define DLIB_LZ77_BUFFEr_ 5 | 6 | 7 | #include "lz77_buffer/lz77_buffer_kernel_1.h" 8 | #include "lz77_buffer/lz77_buffer_kernel_2.h" 9 | #include "lz77_buffer/lz77_buffer_kernel_c.h" 10 | 11 | #include "sliding_buffer.h" 12 | 13 | 14 | namespace dlib 15 | { 16 | 17 | 18 | class lz77_buffer 19 | { 20 | 21 | lz77_buffer() {} 22 | 23 | typedef sliding_buffer::kernel_1a sb1; 24 | 25 | public: 26 | 27 | //----------- kernels --------------- 28 | 29 | // kernel_1a 30 | typedef lz77_buffer_kernel_1 31 | kernel_1a; 32 | typedef lz77_buffer_kernel_c 33 | kernel_1a_c; 34 | 35 | 36 | // kernel_2a 37 | typedef lz77_buffer_kernel_2 38 | kernel_2a; 39 | typedef lz77_buffer_kernel_c 40 | kernel_2a_c; 41 | 42 | 43 | }; 44 | } 45 | 46 | #endif // DLIB_LZ77_BUFFEr_ 47 | 48 | -------------------------------------------------------------------------------- /src/dlib/dlib/lzp_buffer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_LZP_BUFFEr_ 4 | #define DLIB_LZP_BUFFEr_ 5 | 6 | 7 | #include "lzp_buffer/lzp_buffer_kernel_1.h" 8 | #include "lzp_buffer/lzp_buffer_kernel_2.h" 9 | #include "lzp_buffer/lzp_buffer_kernel_c.h" 10 | 11 | #include "sliding_buffer.h" 12 | 13 | 14 | namespace dlib 15 | { 16 | 17 | 18 | class lzp_buffer 19 | { 20 | 21 | lzp_buffer() {} 22 | 23 | typedef sliding_buffer::kernel_1a sb1; 24 | 25 | public: 26 | 27 | //----------- kernels --------------- 28 | 29 | // kernel_1a 30 | typedef lzp_buffer_kernel_1 31 | kernel_1a; 32 | typedef lzp_buffer_kernel_c 33 | kernel_1a_c; 34 | 35 | // kernel_2a 36 | typedef lzp_buffer_kernel_2 37 | kernel_2a; 38 | typedef lzp_buffer_kernel_c 39 | kernel_2a_c; 40 | 41 | 42 | }; 43 | } 44 | 45 | #endif // DLIB_LZP_BUFFEr_ 46 | 47 | -------------------------------------------------------------------------------- /src/dlib/dlib/manifold_regularization.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2010 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MANIFOLD_REGULARIzATION_HEADER 4 | #define DLIB_MANIFOLD_REGULARIzATION_HEADER 5 | 6 | #include "manifold_regularization/graph_creation.h" 7 | #include "manifold_regularization/linear_manifold_regularizer.h" 8 | #include "manifold_regularization/function_objects.h" 9 | #include "manifold_regularization/sample_pair.h" 10 | 11 | #endif // DLIB_MANIFOLD_REGULARIzATION_HEADER 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/dlib/dlib/map.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MAp_ 4 | #define DLIB_MAp_ 5 | 6 | #include "map/map_kernel_1.h" 7 | #include "map/map_kernel_c.h" 8 | 9 | #include "binary_search_tree.h" 10 | 11 | 12 | #include "memory_manager.h" 13 | #include 14 | 15 | 16 | namespace dlib 17 | { 18 | 19 | template < 20 | typename domain, 21 | typename range, 22 | typename mem_manager = memory_manager::kernel_1a, 23 | typename compare = std::less 24 | > 25 | class map 26 | { 27 | map() {} 28 | 29 | 30 | // a typedef for the binary search tree used by kernel_2 31 | typedef typename binary_search_tree::kernel_1a 32 | binary_search_tree_1; 33 | 34 | // a typedef for the binary search tree used by kernel_2 35 | typedef typename binary_search_tree::kernel_2a 36 | binary_search_tree_2; 37 | 38 | public: 39 | 40 | //----------- kernels --------------- 41 | 42 | // kernel_1a 43 | typedef map_kernel_1 44 | kernel_1a; 45 | typedef map_kernel_c 46 | kernel_1a_c; 47 | 48 | // kernel_1b 49 | typedef map_kernel_1 50 | kernel_1b; 51 | typedef map_kernel_c 52 | kernel_1b_c; 53 | 54 | 55 | }; 56 | } 57 | 58 | #endif // DLIB_MAp_ 59 | 60 | -------------------------------------------------------------------------------- /src/dlib/dlib/matrix.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MATRIx_HEADER 4 | #define DLIB_MATRIx_HEADER 5 | 6 | #include "matrix/matrix.h" 7 | #include "matrix/matrix_utilities.h" 8 | #include "matrix/matrix_subexp.h" 9 | #include "matrix/matrix_math_functions.h" 10 | #include "matrix/matrix_assign.h" 11 | #include "matrix/matrix_la.h" 12 | 13 | #ifdef DLIB_USE_BLAS 14 | #include "matrix/matrix_blas_bindings.h" 15 | #endif 16 | 17 | #endif // DLIB_MATRIx_HEADER 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/dlib/dlib/matrix/cblas_constants.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2010 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_CBLAS_CONSTAnTS_H__ 4 | #define DLIB_CBLAS_CONSTAnTS_H__ 5 | 6 | namespace dlib 7 | { 8 | namespace blas_bindings 9 | { 10 | enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102}; 11 | enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113}; 12 | enum CBLAS_UPLO {CblasUpper=121, CblasLower=122}; 13 | enum CBLAS_DIAG {CblasNonUnit=131, CblasUnit=132}; 14 | enum CBLAS_SIDE {CblasLeft=141, CblasRight=142}; 15 | 16 | } 17 | } 18 | 19 | #endif // DLIB_CBLAS_CONSTAnTS_H__ 20 | 21 | -------------------------------------------------------------------------------- /src/dlib/dlib/matrix/matrix_data_layout_abstract.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #undef DLIB_MATRIx_DATA_LAYOUT_ABSTRACT_ 4 | #ifdef DLIB_MATRIx_DATA_LAYOUT_ABSTRACT_ 5 | 6 | #include "../algs.h" 7 | 8 | namespace dlib 9 | { 10 | 11 | // ---------------------------------------------------------------------------------------- 12 | 13 | struct row_major_layout 14 | { 15 | /*! 16 | This is the default matrix layout. Any matrix object that uses this 17 | layout will be laid out in memory in row major order. Additionally, 18 | all elements are contiguous (e.g. there isn't any padding at the ends of 19 | rows or anything like that) 20 | !*/ 21 | }; 22 | 23 | // ---------------------------------------------------------------------------------------- 24 | 25 | struct column_major_layout 26 | { 27 | /*! 28 | Any matrix object that uses this layout will be laid out in memory in 29 | column major order. Additionally, all elements are contiguous (e.g. 30 | there isn't any padding at the ends of rows or anything like that) 31 | !*/ 32 | }; 33 | 34 | // ---------------------------------------------------------------------------------------- 35 | 36 | } 37 | 38 | #endif // DLIB_MATRIx_DATA_LAYOUT_ABSTRACT_ 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/dlib/dlib/matrix/matrix_fwd.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MATRIx_FWD 4 | #define DLIB_MATRIx_FWD 5 | 6 | #include "../memory_manager.h" 7 | 8 | namespace dlib 9 | { 10 | 11 | // ---------------------------------------------------------------------------------------- 12 | 13 | struct row_major_layout; 14 | 15 | // ---------------------------------------------------------------------------------------- 16 | 17 | template < 18 | typename T, 19 | long num_rows = 0, 20 | long num_cols = 0, 21 | typename mem_manager = memory_manager::kernel_1a, 22 | typename layout = row_major_layout 23 | > 24 | class matrix; 25 | 26 | // ---------------------------------------------------------------------------------------- 27 | 28 | } 29 | 30 | #endif // DLIB_MATRIx_FWD 31 | 32 | -------------------------------------------------------------------------------- /src/dlib/dlib/md5.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #include "md5/md5_kernel_1.h" 4 | -------------------------------------------------------------------------------- /src/dlib/dlib/md5/md5_kernel_1.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MD5_KERNEl_1_ 4 | #define DLIB_MD5_KERNEl_1_ 5 | 6 | #include "md5_kernel_abstract.h" 7 | #include 8 | #include 9 | #include "../algs.h" 10 | 11 | namespace dlib 12 | { 13 | 14 | // ---------------------------------------------------------------------------------------- 15 | 16 | const std::string md5 ( 17 | const std::string& input 18 | ); 19 | 20 | // ---------------------------------------------------------------------------------------- 21 | 22 | void md5 ( 23 | const unsigned char* input, 24 | unsigned long len, 25 | unsigned char* output 26 | ); 27 | 28 | // ---------------------------------------------------------------------------------------- 29 | 30 | const std::string md5 ( 31 | std::istream& input 32 | ); 33 | 34 | // ---------------------------------------------------------------------------------------- 35 | 36 | void md5 ( 37 | std::istream& input, 38 | unsigned char* output 39 | ); 40 | 41 | // ---------------------------------------------------------------------------------------- 42 | 43 | } 44 | 45 | #ifdef NO_MAKEFILE 46 | #include "md5_kernel_1.cpp" 47 | #endif 48 | 49 | #endif // DLIB_MD5_KERNEl_1_ 50 | 51 | -------------------------------------------------------------------------------- /src/dlib/dlib/member_function_pointer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MEMBER_FUNCTION_POINTEr_ 4 | #define DLIB_MEMBER_FUNCTION_POINTEr_ 5 | 6 | #include "member_function_pointer/member_function_pointer_kernel_1.h" 7 | #include "member_function_pointer/member_function_pointer_kernel_c.h" 8 | 9 | namespace dlib 10 | { 11 | 12 | template < 13 | typename PARAM1 = void, 14 | typename PARAM2 = void, 15 | typename PARAM3 = void, 16 | typename PARAM4 = void 17 | > 18 | class member_function_pointer 19 | { 20 | member_function_pointer() {} 21 | 22 | 23 | public: 24 | 25 | //----------- kernels --------------- 26 | 27 | // kernel_1a 28 | typedef mfpk1 29 | kernel_1a; 30 | typedef mfpkc 31 | kernel_1a_c; 32 | 33 | 34 | }; 35 | } 36 | 37 | #endif // DLIB_MEMBER_FUNCTION_POINTEr_ 38 | 39 | -------------------------------------------------------------------------------- /src/dlib/dlib/memory_manager_global.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MEMORY_MANAGER_GLOBAl_ 4 | #define DLIB_MEMORY_MANAGER_GLOBAl_ 5 | 6 | #include "memory_manager_global/memory_manager_global_kernel_1.h" 7 | #include "memory_manager.h" 8 | 9 | 10 | 11 | namespace dlib 12 | { 13 | 14 | template < 15 | typename T, 16 | typename factory 17 | > 18 | class memory_manager_global 19 | { 20 | memory_manager_global() {} 21 | 22 | 23 | public: 24 | 25 | //----------- kernels --------------- 26 | 27 | // kernel_1 28 | typedef memory_manager_global_kernel_1 29 | kernel_1a; 30 | 31 | 32 | 33 | 34 | }; 35 | } 36 | 37 | #endif // DLIB_MEMORY_MANAGER_GLOBAl_ 38 | 39 | -------------------------------------------------------------------------------- /src/dlib/dlib/misc_api.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | 4 | #ifndef DLIB_MISC_APi_ 5 | #define DLIB_MISC_APi_ 6 | 7 | #include "platform.h" 8 | 9 | #ifdef WIN32 10 | #include "misc_api/windows.h" 11 | #endif 12 | 13 | #ifndef WIN32 14 | #include "misc_api/posix.h" 15 | #endif 16 | 17 | #endif // DLIB_MISC_APi_ 18 | 19 | -------------------------------------------------------------------------------- /src/dlib/dlib/misc_api/misc_api_kernel_2.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MISC_API_KERNEl_2_ 4 | #define DLIB_MISC_API_KERNEl_2_ 5 | 6 | #ifdef DLIB_ISO_CPP_ONLY 7 | #error "DLIB_ISO_CPP_ONLY is defined so you can't use this OS dependent code. Turn DLIB_ISO_CPP_ONLY off if you want to use it." 8 | #endif 9 | 10 | 11 | #include "misc_api_kernel_abstract.h" 12 | #include "../algs.h" 13 | #include 14 | #include "../uintn.h" 15 | 16 | namespace dlib 17 | { 18 | 19 | // ---------------------------------------------------------------------------------------- 20 | 21 | void sleep ( 22 | unsigned long milliseconds 23 | ); 24 | 25 | // ---------------------------------------------------------------------------------------- 26 | 27 | std::string get_current_dir ( 28 | ); 29 | 30 | // ---------------------------------------------------------------------------------------- 31 | 32 | class timestamper 33 | { 34 | public: 35 | uint64 get_timestamp ( 36 | ) const; 37 | }; 38 | 39 | // ---------------------------------------------------------------------------------------- 40 | 41 | class dir_create_error : public error 42 | { 43 | public: 44 | dir_create_error( 45 | const std::string& dir_name 46 | ) : 47 | error(EDIR_CREATE,"Error creating directory '" + dir_name + "'."), 48 | name(dir_name) 49 | {} 50 | const std::string& name; 51 | }; 52 | 53 | 54 | void create_directory ( 55 | const std::string& dir 56 | ); 57 | 58 | // ---------------------------------------------------------------------------------------- 59 | 60 | } 61 | 62 | #ifdef NO_MAKEFILE 63 | #include "misc_api_kernel_2.cpp" 64 | #endif 65 | 66 | #endif // DLIB_MISC_API_KERNEl_2_ 67 | 68 | -------------------------------------------------------------------------------- /src/dlib/dlib/misc_api/posix.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MISC_API_KERNEl_1_ 4 | #include "misc_api_kernel_2.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/misc_api/windows.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MISC_API_KERNEl_2_ 4 | #include "misc_api_kernel_1.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/mlp.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_MLp_ 4 | #define DLIB_MLp_ 5 | 6 | #include "mlp/mlp_kernel_1.h" 7 | #include "mlp/mlp_kernel_c.h" 8 | 9 | namespace dlib 10 | { 11 | 12 | class mlp 13 | { 14 | mlp() {} 15 | 16 | public: 17 | 18 | //----------- kernels --------------- 19 | 20 | // kernel_1a 21 | typedef mlp_kernel_1 22 | kernel_1a; 23 | typedef mlp_kernel_c 24 | kernel_1a_c; 25 | 26 | }; 27 | } 28 | 29 | #endif // DLIB_MLp_ 30 | 31 | -------------------------------------------------------------------------------- /src/dlib/dlib/noncopyable.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost 2 | // Software License, Version 1.0. (See accompanying file 3 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | // Contributed by Dave Abrahams 5 | // See http://www.boost.org/libs/utility for documentation. 6 | 7 | #ifndef DLIB_BOOST_NONCOPYABLE_HPP_INCLUDED 8 | #define DLIB_BOOST_NONCOPYABLE_HPP_INCLUDED 9 | 10 | #ifndef BOOST_NONCOPYABLE_HPP_INCLUDED 11 | #define BOOST_NONCOPYABLE_HPP_INCLUDED 12 | 13 | namespace boost 14 | { 15 | 16 | namespace noncopyable_ // protection from unintended ADL 17 | { 18 | class noncopyable 19 | { 20 | /*! 21 | This class makes it easier to declare a class as non-copyable. 22 | If you want to make an object that can't be copied just inherit 23 | from this object. 24 | !*/ 25 | 26 | protected: 27 | noncopyable() {} 28 | ~noncopyable() {} 29 | private: // emphasize the following members are private 30 | noncopyable( const noncopyable& ); 31 | const noncopyable& operator=( const noncopyable& ); 32 | }; 33 | } 34 | 35 | typedef noncopyable_::noncopyable noncopyable; 36 | 37 | } // namespace boost 38 | 39 | #endif // BOOST_NONCOPYABLE_HPP_INCLUDED 40 | 41 | namespace dlib 42 | { 43 | using boost::noncopyable; 44 | } 45 | 46 | #endif // DLIB_BOOST_NONCOPYABLE_HPP_INCLUDED 47 | 48 | -------------------------------------------------------------------------------- /src/dlib/dlib/opencv.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2009 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_OPEnCV_HEADER 4 | #define DLIB_OPEnCV_HEADER 5 | 6 | #include "opencv/cv_image.h" 7 | 8 | #endif // DLIB_OPEnCV_HEADER 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/dlib/dlib/optimization.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_OPTIMIZATIOn_HEADER 4 | #define DLIB_SVM_HEADER 5 | 6 | #include "optimization/optimization.h" 7 | #include "optimization/optimization_bobyqa.h" 8 | #include "optimization/optimization_solve_qp_using_smo.h" 9 | #include "optimization/optimization_oca.h" 10 | #include "optimization/optimization_trust_region.h" 11 | #include "optimization/optimization_least_squares.h" 12 | 13 | #endif // DLIB_OPTIMIZATIOn_HEADER 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/dlib/dlib/ostream: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/pipe.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_PIPe_ 4 | #define DLIB_PIPe_ 5 | 6 | #include "pipe/pipe_kernel_1.h" 7 | 8 | 9 | namespace dlib 10 | { 11 | 12 | template < 13 | typename T 14 | > 15 | class pipe 16 | { 17 | pipe() {} 18 | public: 19 | 20 | 21 | //----------- kernels --------------- 22 | 23 | // kernel_1a 24 | typedef pipe_kernel_1 25 | kernel_1a; 26 | 27 | 28 | }; 29 | } 30 | 31 | #endif // DLIB_PIPe_ 32 | 33 | -------------------------------------------------------------------------------- /src/dlib/dlib/platform.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_PLATFORm_ 4 | #define DLIB_PLATFORm_ 5 | 6 | 7 | /*! 8 | This file ensures that: 9 | - if (we are compiling under a posix platform) then 10 | - POSIX will be defined 11 | - if (this is also Mac OS X) then 12 | - MACOSX will be defined 13 | - if (this is also HP-UX) then 14 | - HPUX will be defined 15 | - if (we are compiling under an MS Windows platform) then 16 | - WIN32 will be defined 17 | !*/ 18 | 19 | 20 | /* 21 | A good reference for this sort of information is 22 | http://predef.sourceforge.net/ 23 | */ 24 | 25 | // Define WIN32 if this is MS Windows 26 | #ifndef WIN32 27 | #if defined( _MSC_VER) || defined(__BORLANDC__) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) 28 | #define WIN32 29 | #endif 30 | #endif 31 | 32 | #ifndef WIN32 33 | // since this is the only other platform the library currently supports 34 | // just assume it is POSIX if it isn't WIN32 35 | #ifndef POSIX 36 | #define POSIX 37 | #endif 38 | 39 | #ifndef HPUX 40 | #if defined(__hpux ) || defined(hpux) || defined (_hpux) 41 | #define HPUX 42 | #endif 43 | #endif 44 | 45 | #ifndef MACOSX 46 | #ifdef __MACOSX__ 47 | #define MACOSX 48 | #endif 49 | #ifdef __APPLE__ 50 | #define MACOSX 51 | #endif 52 | #endif 53 | 54 | #endif 55 | 56 | 57 | 58 | 59 | #endif // DLIB_PLATFORm_ 60 | 61 | -------------------------------------------------------------------------------- /src/dlib/dlib/quantum_computing.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_QUANTUM_COMPUTINg_H_ 4 | #define DLIB_QUANTUM_COMPUTINg_H_ 5 | 6 | #include "quantum_computing/quantum_computing.h" 7 | 8 | #endif // DLIB_QUANTUM_COMPUTINg_H_ 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/dlib/dlib/queue.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_QUEUe_ 4 | #define DLIB_QUEUe_ 5 | 6 | #include "queue/queue_kernel_1.h" 7 | #include "queue/queue_kernel_2.h" 8 | #include "queue/queue_kernel_c.h" 9 | 10 | #include "queue/queue_sort_1.h" 11 | 12 | 13 | #include "memory_manager.h" 14 | 15 | namespace dlib 16 | { 17 | 18 | template < 19 | typename T, 20 | typename mem_manager = memory_manager::kernel_1a 21 | > 22 | class queue 23 | { 24 | queue() {} 25 | public: 26 | 27 | 28 | //----------- kernels --------------- 29 | 30 | // kernel_1a 31 | typedef queue_kernel_1 32 | kernel_1a; 33 | typedef queue_kernel_c 34 | kernel_1a_c; 35 | 36 | 37 | // kernel_2a 38 | typedef queue_kernel_2 39 | kernel_2a; 40 | typedef queue_kernel_c 41 | kernel_2a_c; 42 | 43 | 44 | // kernel_2b 45 | typedef queue_kernel_2 46 | kernel_2b; 47 | typedef queue_kernel_c 48 | kernel_2b_c; 49 | 50 | 51 | 52 | 53 | //---------- extensions ------------ 54 | 55 | // sort_1 extend kernel_1a 56 | typedef queue_sort_1 57 | sort_1a; 58 | typedef queue_sort_1 59 | sort_1a_c; 60 | 61 | 62 | // sort_1 extend kernel_2a 63 | typedef queue_sort_1 64 | sort_1b; 65 | typedef queue_sort_1 66 | sort_1b_c; 67 | 68 | 69 | 70 | // sort_1 extend kernel_2b 71 | typedef queue_sort_1 72 | sort_1c; 73 | typedef queue_sort_1 74 | sort_1c_c; 75 | 76 | 77 | 78 | 79 | 80 | }; 81 | } 82 | 83 | #endif // DLIB_QUEUe_ 84 | 85 | -------------------------------------------------------------------------------- /src/dlib/dlib/rand.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_RANd_ 4 | #define DLIB_RANd_ 5 | 6 | #include "rand/rand_kernel_1.h" 7 | #include "rand/rand_float_1.h" 8 | 9 | #include "algs.h" 10 | 11 | 12 | 13 | namespace dlib 14 | { 15 | 16 | 17 | class rand 18 | { 19 | rand() {} 20 | 21 | public: 22 | 23 | //----------- kernels --------------- 24 | 25 | // kernel_1a 26 | typedef rand_kernel_1 27 | kernel_1a; 28 | 29 | //---------- extensions ------------ 30 | 31 | // float_1 extend kernel_1a 32 | typedef rand_float_1 33 | float_1a; 34 | 35 | }; 36 | 37 | } 38 | 39 | #endif // DLIB_RANd_ 40 | 41 | -------------------------------------------------------------------------------- /src/dlib/dlib/rand/rand_float_abstract.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #undef DLIB_RAND_FLOAt_ABSTRACT_ 4 | #ifdef DLIB_RAND_FLOAt_ABSTRACT_ 5 | 6 | 7 | #include "rand_kernel_abstract.h" 8 | 9 | namespace dlib 10 | { 11 | 12 | template < 13 | typename rand_base 14 | > 15 | class rand_float : public rand_base 16 | { 17 | 18 | /*! 19 | REQUIREMENTS ON RAND_BASE 20 | RAND_BASE is instantiated with type T and 21 | is an implementation of rand/rand_kernel_abstract.h 22 | 23 | WHAT THIS EXTENSION DOES FOR RAND 24 | This gives rand the ability to generate random float values. 25 | !*/ 26 | 27 | 28 | public: 29 | 30 | float get_random_float ( 31 | ); 32 | /*! 33 | ensures 34 | - returns a random float number N where: 0.0 <= N < 1.0. 35 | throws 36 | - std::bad_alloc 37 | !*/ 38 | 39 | double get_random_double ( 40 | ); 41 | /*! 42 | ensures 43 | - returns a random double number N where: 0.0 <= N < 1.0. 44 | throws 45 | - std::bad_alloc 46 | !*/ 47 | }; 48 | 49 | template < 50 | template rand_base 51 | > 52 | inline void swap ( 53 | rand_float& a, 54 | rand_float& b 55 | ) { a.swap(b); } 56 | /*! 57 | provides a global swap function 58 | !*/ 59 | 60 | } 61 | 62 | #endif // DLIB_RAND_FLOAt_ABSTRACT_ 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/dlib/dlib/reference_counter.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_REFERENCE_COUNTEr_ 4 | #define DLIB_REFERENCE_COUNTEr_ 5 | 6 | #include "reference_counter/reference_counter_kernel_1.h" 7 | #include "algs.h" 8 | 9 | namespace dlib 10 | { 11 | 12 | template < 13 | typename T, 14 | typename copy = copy_functor 15 | > 16 | class reference_counter 17 | { 18 | reference_counter() {} 19 | public: 20 | 21 | //----------- kernels --------------- 22 | 23 | // kernel_1a 24 | typedef reference_counter_kernel_1 25 | kernel_1a; 26 | 27 | }; 28 | } 29 | 30 | #endif // DLIB_REFERENCE_COUNTEr_ 31 | 32 | -------------------------------------------------------------------------------- /src/dlib/dlib/sequence/sequence_sort_2.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SEQUENCE_SORt_2_ 4 | #define DLIB_SEQUENCE_SORt_2_ 5 | 6 | #include "sequence_sort_abstract.h" 7 | #include "../algs.h" 8 | #include "../sort.h" 9 | 10 | namespace dlib 11 | { 12 | 13 | template < 14 | typename seq_base 15 | > 16 | class sequence_sort_2 : public seq_base 17 | { 18 | typedef typename seq_base::type T; 19 | 20 | public: 21 | 22 | /*! 23 | this is a version of the QuickSort algorithm 24 | this uses the dlib::qsort_array function 25 | !*/ 26 | 27 | void sort ( 28 | ); 29 | 30 | 31 | }; 32 | 33 | template < 34 | typename seq_base 35 | > 36 | inline void swap ( 37 | sequence_sort_2& a, 38 | sequence_sort_2& b 39 | ) { a.swap(b); } 40 | 41 | // ---------------------------------------------------------------------------------------- 42 | // ---------------------------------------------------------------------------------------- 43 | // member function definitions 44 | // ---------------------------------------------------------------------------------------- 45 | // ---------------------------------------------------------------------------------------- 46 | 47 | template < 48 | typename seq_base 49 | > 50 | void sequence_sort_2:: 51 | sort ( 52 | ) 53 | { 54 | if (this->size() > 1) 55 | { 56 | dlib::qsort_array(*this,0,this->size()-1); 57 | } 58 | } 59 | 60 | // ---------------------------------------------------------------------------------------- 61 | 62 | } 63 | 64 | #endif // DLIB_SEQUENCE_SORt_2_ 65 | 66 | -------------------------------------------------------------------------------- /src/dlib/dlib/sequence/sequence_sort_abstract.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #undef DLIB_SEQUENCE_SORt_ABSTRACT_ 4 | #ifdef DLIB_SEQUENCE_SORt_ABSTRACT_ 5 | 6 | #include "sequence_kernel_abstract.h" 7 | 8 | namespace dlib 9 | { 10 | 11 | template < 12 | typename seq_base 13 | > 14 | class sequence_sort : public seq_base 15 | { 16 | 17 | /*! 18 | REQUIREMENTS ON T 19 | T must implement operator< for its type 20 | 21 | REQUIREMENTS ON seq_base 22 | must be an implementation of sequence/sequence_kernel_abstract.h 23 | 24 | 25 | 26 | POINTERS AND REFERENCES TO INTERNAL DATA 27 | sort() may invalidate pointers and references to data members. 28 | 29 | WHAT THIS EXTENSION DOES FOR sequence 30 | this gives a sequence the ability to sort its contents by calling sort() 31 | !*/ 32 | 33 | 34 | public: 35 | 36 | void sort ( 37 | ); 38 | /*! 39 | ensures 40 | - for all elements in #*this the ith element is <= the i+1 element 41 | - #at_start() == true 42 | throws 43 | - std::bad_alloc or any exception thrown by T's constructor 44 | data may be lost if sort() throws 45 | !*/ 46 | 47 | 48 | }; 49 | 50 | 51 | template < 52 | typename seq_base 53 | > 54 | inline void swap ( 55 | sequence_sort& a, 56 | sequence_sort& b 57 | ) { a.swap(b); } 58 | /*! 59 | provides a global swap function 60 | !*/ 61 | 62 | } 63 | 64 | #endif // DLIB_SEQUENCE_SORt_ABSTRACT_ 65 | 66 | -------------------------------------------------------------------------------- /src/dlib/dlib/server.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SERVEr_ 4 | #define DLIB_SERVEr_ 5 | 6 | #include "server/server_kernel_1.h" 7 | #include "server/server_kernel_c.h" 8 | #include "server/server_iostream_1.h" 9 | #include "server/server_http_1.h" 10 | 11 | #include "set.h" 12 | #include "algs.h" 13 | #include "sockstreambuf.h" 14 | #include "map.h" 15 | #include "queue.h" 16 | #include 17 | 18 | 19 | 20 | namespace dlib 21 | { 22 | 23 | class server 24 | { 25 | server() {} 26 | 27 | 28 | typedef set::kernel_1a set_of_cons_1a; 29 | 30 | typedef sockstreambuf::kernel_1a ssbuf1a; 31 | typedef sockstreambuf::kernel_2a ssbuf2a; 32 | 33 | typedef map::kernel_2a>::kernel_1b id_map; 34 | 35 | public: 36 | 37 | //----------- kernels --------------- 38 | 39 | // kernel_1a 40 | typedef server_kernel_1 41 | kernel_1a; 42 | typedef server_kernel_c 43 | kernel_1a_c; 44 | 45 | // iostream_1a 46 | typedef server_iostream_1 47 | iostream_1a; 48 | typedef server_iostream_1 49 | iostream_1a_c; 50 | 51 | // http_1a 52 | typedef server_http_1 53 | http_1a; 54 | typedef server_http_1 55 | http_1a_c; 56 | 57 | }; 58 | 59 | } 60 | 61 | #endif // DLIB_SERVEr_ 62 | 63 | -------------------------------------------------------------------------------- /src/dlib/dlib/set.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SEt_ 4 | #define DLIB_SEt_ 5 | 6 | #include "set/set_kernel_1.h" 7 | #include "set/set_kernel_c.h" 8 | 9 | 10 | 11 | #include "binary_search_tree.h" 12 | 13 | #include "set/set_compare_1.h" 14 | 15 | #include "memory_manager.h" 16 | #include 17 | 18 | namespace dlib 19 | { 20 | 21 | template < 22 | typename T, 23 | typename mem_manager = memory_manager::kernel_1a, 24 | typename compare = std::less 25 | > 26 | class set 27 | { 28 | set() {} 29 | 30 | 31 | 32 | 33 | 34 | typedef typename binary_search_tree::kernel_1a 35 | binary_search_tree_1; 36 | 37 | typedef typename binary_search_tree::kernel_2a 38 | binary_search_tree_2; 39 | 40 | public: 41 | 42 | //----------- kernels --------------- 43 | 44 | // kernel_1a 45 | typedef set_kernel_1 46 | kernel_1a; 47 | typedef set_kernel_c 48 | kernel_1a_c; 49 | 50 | // kernel_1b 51 | typedef set_kernel_1 52 | kernel_1b; 53 | typedef set_kernel_c 54 | kernel_1b_c; 55 | 56 | 57 | //---------- extensions ------------ 58 | 59 | // compare extensions 60 | typedef set_compare_1 61 | compare_1a; 62 | typedef set_compare_1 63 | compare_1a_c; 64 | 65 | typedef set_compare_1 66 | compare_1b; 67 | typedef set_compare_1 68 | compare_1b_c; 69 | 70 | }; 71 | } 72 | 73 | #endif // DLIB_SEt_ 74 | 75 | -------------------------------------------------------------------------------- /src/dlib/dlib/set_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SET_UTILs_H_ 4 | #define DLIB_SET_UTILs_H_ 5 | 6 | #include "set_utils/set_utils.h" 7 | 8 | #endif // DLIB_SET_UTILs_H_ 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/dlib/dlib/sliding_buffer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SLIDING_BUFFEr_ 4 | #define DLIB_SLIDING_BUFFEr_ 5 | 6 | 7 | #include "sliding_buffer/sliding_buffer_kernel_1.h" 8 | #include "sliding_buffer/sliding_buffer_kernel_c.h" 9 | 10 | 11 | 12 | namespace dlib 13 | { 14 | 15 | template < 16 | typename T 17 | > 18 | class sliding_buffer 19 | { 20 | 21 | sliding_buffer() {} 22 | public: 23 | 24 | //----------- kernels --------------- 25 | 26 | // kernel_1a 27 | typedef sliding_buffer_kernel_1 28 | kernel_1a; 29 | typedef sliding_buffer_kernel_c 30 | kernel_1a_c; 31 | 32 | 33 | }; 34 | } 35 | 36 | #endif // DLIB_SLIDING_BUFFEr_ 37 | 38 | -------------------------------------------------------------------------------- /src/dlib/dlib/smart_pointers.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SMART_POINTERs_H_ 4 | #define DLIB_SMART_POINTERs_H_ 5 | 6 | #include "smart_pointers/scoped_ptr.h" 7 | #include "smart_pointers/shared_ptr.h" 8 | #include "smart_pointers/weak_ptr.h" 9 | 10 | #endif // DLIB_SMART_POINTERs_H_ 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/dlib/dlib/smart_pointers_thread_safe.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SMART_POINTERs_THREAD_SAFE_H_ 4 | #define DLIB_SMART_POINTERs_THREAD_SAFE_H_ 5 | 6 | #include "smart_pointers/shared_ptr_thread_safe.h" 7 | 8 | #endif // DLIB_SMART_POINTERs_THREAD_SAFE_H_ 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/dlib/dlib/sockets.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SOCKETs_ 4 | #define DLIB_SOCKETs_ 5 | 6 | #include "platform.h" 7 | 8 | 9 | #ifdef WIN32 10 | #include "sockets/windows.h" 11 | #endif 12 | 13 | #ifndef WIN32 14 | #include "sockets/posix.h" 15 | #endif 16 | 17 | #include "sockets/sockets_extensions.h" 18 | 19 | #endif // DLIB_SOCKETs_ 20 | 21 | -------------------------------------------------------------------------------- /src/dlib/dlib/sockets/posix.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SOCKETS_KERNEl_1_ 4 | #include "sockets_kernel_2.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/sockets/sockets_extensions.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SOCKETS_EXTENSIONs_ 4 | #define DLIB_SOCKETS_EXTENSIONs_ 5 | 6 | #include 7 | #include "../sockets.h" 8 | #include "sockets_extensions_abstract.h" 9 | #include "../smart_pointers.h" 10 | 11 | namespace dlib 12 | { 13 | 14 | // ---------------------------------------------------------------------------------------- 15 | 16 | connection* connect ( 17 | const std::string& host_or_ip, 18 | unsigned short port 19 | ); 20 | 21 | // ---------------------------------------------------------------------------------------- 22 | 23 | connection* connect ( 24 | const std::string& host_or_ip, 25 | unsigned short port, 26 | unsigned long timeout 27 | ); 28 | 29 | // ---------------------------------------------------------------------------------------- 30 | 31 | bool is_ip_address ( 32 | std::string ip 33 | ); 34 | 35 | // ---------------------------------------------------------------------------------------- 36 | 37 | void close_gracefully ( 38 | connection* con, 39 | unsigned long timeout = 500 40 | ); 41 | 42 | // ---------------------------------------------------------------------------------------- 43 | 44 | void close_gracefully ( 45 | scoped_ptr& con, 46 | unsigned long timeout = 500 47 | ); 48 | 49 | // ---------------------------------------------------------------------------------------- 50 | 51 | } 52 | 53 | #ifdef NO_MAKEFILE 54 | #include "sockets_extensions.cpp" 55 | #endif 56 | 57 | #endif // DLIB_SOCKETS_EXTENSIONs_ 58 | 59 | -------------------------------------------------------------------------------- /src/dlib/dlib/sockets/windows.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SOCKETS_KERNEl_2_ 4 | #include "sockets_kernel_1.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/sockstreambuf.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef _SOCKSTREAMBUf_ 4 | #define _SOCKSTREAMBUf_ 5 | 6 | #include "sockstreambuf/sockstreambuf_kernel_1.h" 7 | #include "sockstreambuf/sockstreambuf_kernel_2.h" 8 | 9 | 10 | namespace dlib 11 | { 12 | 13 | 14 | class sockstreambuf 15 | { 16 | sockstreambuf() {} 17 | 18 | 19 | public: 20 | 21 | //----------- kernels --------------- 22 | 23 | // kernel_1a 24 | typedef sockstreambuf_kernel_1 25 | kernel_1a; 26 | 27 | // kernel_2a 28 | typedef sockstreambuf_kernel_2 29 | kernel_2a; 30 | 31 | 32 | }; 33 | } 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /src/dlib/dlib/sstream: -------------------------------------------------------------------------------- 1 | #include "dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/stack.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_STACk_ 4 | #define DLIB_STACk_ 5 | 6 | #include "stack/stack_kernel_1.h" 7 | #include "stack/stack_kernel_c.h" 8 | #include "memory_manager.h" 9 | 10 | namespace dlib 11 | { 12 | 13 | template < 14 | typename T, 15 | typename mem_manager = memory_manager::kernel_1a 16 | > 17 | class stack 18 | { 19 | stack() {} 20 | public: 21 | 22 | //----------- kernels --------------- 23 | 24 | // kernel_1a 25 | typedef stack_kernel_1 26 | kernel_1a; 27 | typedef stack_kernel_c 28 | kernel_1a_c; 29 | 30 | }; 31 | } 32 | 33 | #endif // DLIB_STACk_ 34 | 35 | -------------------------------------------------------------------------------- /src/dlib/dlib/static_map.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_STATIC_MAp_ 4 | #define DLIB_STATIC_MAp_ 5 | 6 | #include "static_map/static_map_kernel_1.h" 7 | #include "static_map/static_map_kernel_c.h" 8 | 9 | #include 10 | 11 | 12 | namespace dlib 13 | { 14 | 15 | template < 16 | typename domain, 17 | typename range, 18 | typename compare = std::less 19 | > 20 | class static_map 21 | { 22 | static_map() {} 23 | 24 | 25 | public: 26 | 27 | //----------- kernels --------------- 28 | 29 | // kernel_1a 30 | typedef static_map_kernel_1 31 | kernel_1a; 32 | typedef static_map_kernel_c 33 | kernel_1a_c; 34 | 35 | 36 | 37 | 38 | 39 | }; 40 | } 41 | 42 | #endif // DLIB_STATIC_MAp_ 43 | 44 | -------------------------------------------------------------------------------- /src/dlib/dlib/static_set.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_STATIC_SEt_ 4 | #define DLIB_STATIC_SEt_ 5 | 6 | #include "static_set/static_set_kernel_1.h" 7 | #include "static_set/static_set_kernel_c.h" 8 | #include "static_set/static_set_compare_1.h" 9 | 10 | #include 11 | 12 | namespace dlib 13 | { 14 | 15 | template < 16 | typename T, 17 | typename compare = std::less 18 | > 19 | class static_set 20 | { 21 | static_set() {} 22 | 23 | 24 | public: 25 | 26 | //----------- kernels --------------- 27 | 28 | // kernel_1a 29 | typedef static_set_kernel_1 30 | kernel_1a; 31 | typedef static_set_kernel_c 32 | kernel_1a_c; 33 | 34 | 35 | //----------- extensions ------------- 36 | 37 | typedef static_set_compare_1 38 | compare_1a; 39 | typedef static_set_compare_1 40 | compare_1a_c; 41 | 42 | 43 | 44 | 45 | }; 46 | } 47 | 48 | #endif // DLIB_STATIC_SEt_ 49 | 50 | -------------------------------------------------------------------------------- /src/dlib/dlib/statistics.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_STATISTICs_H_ 4 | #define DLIB_STATISTICs_H_ 5 | 6 | #include "statistics/statistics.h" 7 | #include "statistics/dpca.h" 8 | #include "statistics/random_subset_selector.h" 9 | 10 | #endif // DLIB_STATISTICs_H_ 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/dlib/dlib/stl_checked.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_STL_CHECKEd_HEADER 4 | #define DLIB_STL_CHECKEd_HEADER 5 | 6 | #include "stl_checked/std_vector_c.h" 7 | 8 | #endif // DLIB_STL_CHECKEd_HEADER 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/dlib/dlib/string.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_STRINg_TOP_ 4 | #define DLIB_STRINg_TOP_ 5 | 6 | #include "string/string.h" 7 | 8 | #endif // DLIB_STRINg_TOP_ 9 | 10 | -------------------------------------------------------------------------------- /src/dlib/dlib/string/cassert: -------------------------------------------------------------------------------- 1 | #include "../dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/string/iomanip: -------------------------------------------------------------------------------- 1 | #include "../dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/string/iosfwd: -------------------------------------------------------------------------------- 1 | #include "../dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/string/iostream: -------------------------------------------------------------------------------- 1 | #include "../dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/string/locale: -------------------------------------------------------------------------------- 1 | #include "../dlib_include_path_tutorial.txt" 2 | -------------------------------------------------------------------------------- /src/dlib/dlib/svm.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SVm_HEADER 4 | #define DLIB_SVM_HEADER 5 | 6 | #include "svm/svm.h" 7 | #include "svm/krls.h" 8 | #include "svm/kcentroid.h" 9 | #include "svm/kcentroid_overloads.h" 10 | #include "svm/kkmeans.h" 11 | #include "svm/feature_ranking.h" 12 | #include "svm/rbf_network.h" 13 | #include "svm/linearly_independent_subset_finder.h" 14 | #include "svm/reduced.h" 15 | #include "svm/rvm.h" 16 | #include "svm/pegasos.h" 17 | #include "svm/sparse_kernel.h" 18 | #include "svm/null_trainer.h" 19 | #include "svm/roc_trainer.h" 20 | #include "svm/kernel_matrix.h" 21 | #include "svm/empirical_kernel_map.h" 22 | #include "svm/svm_c_linear_trainer.h" 23 | #include "svm/svm_c_ekm_trainer.h" 24 | #include "svm/simplify_linear_decision_function.h" 25 | #include "svm/krr_trainer.h" 26 | #include "svm/sort_basis_vectors.h" 27 | 28 | #endif // DLIB_SVm_HEADER 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/dlib/dlib/svm/null_trainer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2009 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_NULL_TRAINERs_H_ 4 | #define DLIB_NULL_TRAINERs_H_ 5 | 6 | #include "null_trainer_abstract.h" 7 | #include "../algs.h" 8 | #include "function_abstract.h" 9 | 10 | namespace dlib 11 | { 12 | 13 | // ---------------------------------------------------------------------------------------- 14 | 15 | template < 16 | typename dec_funct_type 17 | > 18 | class null_trainer_type 19 | { 20 | public: 21 | typedef typename dec_funct_type::kernel_type kernel_type; 22 | typedef typename dec_funct_type::scalar_type scalar_type; 23 | typedef typename dec_funct_type::sample_type sample_type; 24 | typedef typename dec_funct_type::mem_manager_type mem_manager_type; 25 | typedef dec_funct_type trained_function_type; 26 | 27 | null_trainer_type ( 28 | ){} 29 | 30 | null_trainer_type ( 31 | const dec_funct_type& dec_funct_ 32 | ) : dec_funct(dec_funct_) {} 33 | 34 | template < 35 | typename in_sample_vector_type, 36 | typename in_scalar_vector_type 37 | > 38 | const dec_funct_type& train ( 39 | const in_sample_vector_type& , 40 | const in_scalar_vector_type& 41 | ) const { return dec_funct; } 42 | 43 | private: 44 | dec_funct_type dec_funct; 45 | }; 46 | 47 | // ---------------------------------------------------------------------------------------- 48 | 49 | template < 50 | typename dec_funct_type 51 | > 52 | const null_trainer_type null_trainer ( 53 | const dec_funct_type& dec_funct 54 | ) { return null_trainer_type(dec_funct); } 55 | 56 | // ---------------------------------------------------------------------------------------- 57 | 58 | } 59 | 60 | #endif // DLIB_NULL_TRAINERs_H_ 61 | 62 | -------------------------------------------------------------------------------- /src/dlib/dlib/svm_threaded.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2008 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SVm_THREADED_HEADER 4 | #define DLIB_SVm_THREADED_HEADER 5 | 6 | #include "svm.h" 7 | #include "svm/svm_threaded.h" 8 | 9 | #endif // DLIB_SVm_THREADED_HEADER 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/dlib/dlib/sync_extension.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SYNC_EXTENSIOn_ 4 | #define DLIB_SYNC_EXTENSIOn_ 5 | 6 | #include "sync_extension/sync_extension_kernel_1.h" 7 | 8 | 9 | 10 | namespace dlib 11 | { 12 | 13 | template < 14 | typename base 15 | > 16 | class sync_extension 17 | { 18 | sync_extension() {} 19 | public: 20 | 21 | //----------- kernels --------------- 22 | 23 | // kernel_1a 24 | typedef sync_extension_kernel_1 25 | kernel_1a; 26 | 27 | }; 28 | } 29 | 30 | #endif // DLIB_SYNC_EXTENSIOn_ 31 | 32 | -------------------------------------------------------------------------------- /src/dlib/dlib/sync_extension/sync_extension_kernel_1.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_SYNC_EXTENSION_KERNEl_1_ 4 | #define DLIB_SYNC_EXTENSION_KERNEl_1_ 5 | 6 | #include "../threads.h" 7 | #include "../algs.h" 8 | #include "sync_extension_kernel_abstract.h" 9 | 10 | namespace dlib 11 | { 12 | 13 | template < 14 | typename base 15 | > 16 | class sync_extension_kernel_1 : public base 17 | { 18 | 19 | rmutex m; 20 | rsignaler s; 21 | 22 | public: 23 | 24 | sync_extension_kernel_1 () : s(m) {} 25 | 26 | template < typename T > 27 | sync_extension_kernel_1 (const T& one) : base(one),s(m) {} 28 | template < typename T, typename U > 29 | sync_extension_kernel_1 (const T& one, const U& two) : base(one,two),s(m) {} 30 | 31 | 32 | const rmutex& get_mutex( 33 | ) const { return m; } 34 | 35 | void lock ( 36 | ) const { m.lock(); } 37 | 38 | void unlock ( 39 | ) const { m.unlock(); } 40 | 41 | void wait ( 42 | ) const { s.wait(); } 43 | 44 | bool wait_or_timeout ( 45 | unsigned long milliseconds 46 | ) const { return s.wait_or_timeout(milliseconds); } 47 | 48 | void broadcast ( 49 | ) const { s.broadcast(); } 50 | 51 | void signal ( 52 | ) const { s.signal(); } 53 | 54 | }; 55 | 56 | template < 57 | typename base 58 | > 59 | inline void swap ( 60 | sync_extension_kernel_1& a, 61 | sync_extension_kernel_1& b 62 | ) { a.swap(b); } 63 | 64 | } 65 | 66 | #endif // DLIB_SYNC_EXTENSION_KERNEl_1_ 67 | 68 | -------------------------------------------------------------------------------- /src/dlib/dlib/threads.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_THREADs_ 4 | #define DLIB_THREADs_ 5 | 6 | #include "threads/threads_kernel.h" 7 | 8 | #include "threads/auto_mutex_extension.h" 9 | #include "threads/auto_unlock_extension.h" 10 | #include "threads/create_new_thread_extension.h" 11 | #include "threads/multithreaded_object_extension.h" 12 | #include "threads/rmutex_extension.h" 13 | #include "threads/rsignaler_extension.h" 14 | #include "threads/threaded_object_extension.h" 15 | #include "threads/thread_specific_data_extension.h" 16 | #include "threads/thread_function_extension.h" 17 | #include "threads/thread_pool_extension.h" 18 | #include "threads/read_write_mutex_extension.h" 19 | 20 | #endif // DLIB_THREADs_ 21 | 22 | -------------------------------------------------------------------------------- /src/dlib/dlib/threads/create_new_thread_extension.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_CREATE_NEW_THREAD_EXTENSIOn_ 4 | #define DLIB_CREATE_NEW_THREAD_EXTENSIOn_ 5 | 6 | #include "threads_kernel_abstract.h" 7 | #include "create_new_thread_extension_abstract.h" 8 | #include "../threads.h" 9 | 10 | namespace dlib 11 | { 12 | 13 | // ---------------------------------------------------------------------------------------- 14 | 15 | template < 16 | typename T, 17 | void (T::*funct)() 18 | > 19 | inline void dlib_create_new_thread_helper ( 20 | void* obj 21 | ) 22 | { 23 | T* o = reinterpret_cast(obj); 24 | (o->*funct)(); 25 | } 26 | 27 | // ---------------------------------------------------------------------------------------- 28 | 29 | template < 30 | typename T, 31 | void (T::*funct)() 32 | > 33 | inline bool create_new_thread ( 34 | T& obj 35 | ) 36 | { 37 | return create_new_thread(dlib_create_new_thread_helper,&obj); 38 | } 39 | 40 | // ---------------------------------------------------------------------------------------- 41 | 42 | } 43 | 44 | #endif // DLIB_CREATE_NEW_THREAD_EXTENSIOn_ 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/dlib/dlib/threads/create_new_thread_extension_abstract.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #undef DLIB_CREATE_NEW_THREAD_EXTENSIOn_ABSTRACT_ 4 | #ifdef DLIB_CREATE_NEW_THREAD_EXTENSIOn_ABSTRACT_ 5 | 6 | #include "threads_kernel_abstract.h" 7 | 8 | namespace dlib 9 | { 10 | 11 | // ---------------------------------------------------------------------------------------- 12 | 13 | template < 14 | typename T, 15 | void (T::*funct)() 16 | > 17 | bool create_new_thread ( 18 | T& obj 19 | ); 20 | /*! 21 | ensures 22 | - creates a new thread and calls obj.*funct() from it. 23 | - returns true upon success and false upon failure to create the new thread. 24 | !*/ 25 | 26 | // ---------------------------------------------------------------------------------------- 27 | 28 | } 29 | 30 | #endif // DLIB_CREATE_NEW_THREAD_EXTENSIOn_ABSTRACT_ 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/dlib/dlib/threads/posix.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_THREADS_KERNEl_1_ 4 | #include "threads_kernel_2.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/threads/threads_kernel.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_THREADs_KERNEL_ 4 | #define DLIB_THREADs_KERNEL_ 5 | 6 | #include "../platform.h" 7 | 8 | #ifdef WIN32 9 | #include "windows.h" 10 | #endif 11 | 12 | #ifndef WIN32 13 | #include "posix.h" 14 | #endif 15 | 16 | #endif // DLIB_THREADs_KERNEL_ 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/dlib/dlib/threads/threads_kernel_1.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_THREADS_KERNEL_1_CPp_ 4 | #define DLIB_THREADS_KERNEL_1_CPp_ 5 | 6 | #include "../platform.h" 7 | 8 | #ifdef WIN32 9 | 10 | #include "threads_kernel_1.h" 11 | 12 | #include 13 | 14 | 15 | namespace dlib 16 | { 17 | namespace threads_kernel_shared_helpers 18 | { 19 | 20 | // ----------------------------------------------------------------------------------- 21 | 22 | struct info 23 | { 24 | void* param; 25 | void (*funct)(void*); 26 | }; 27 | 28 | // ----------------------------------------------------------------------------------- 29 | 30 | unsigned int __stdcall thread_starter ( 31 | void* param 32 | ) 33 | { 34 | info* alloc_p = reinterpret_cast(param); 35 | info p = *alloc_p; 36 | delete alloc_p; 37 | 38 | p.funct(p.param); 39 | return 0; 40 | } 41 | 42 | // ----------------------------------------------------------------------------------- 43 | 44 | bool spawn_thread ( 45 | void (*funct)(void*), 46 | void* param 47 | ) 48 | { 49 | info* p; 50 | try { p = new info; } 51 | catch (...) { return false; } 52 | 53 | p->funct = funct; 54 | p->param = param; 55 | 56 | 57 | unsigned int garbage; 58 | 59 | HANDLE thandle = (HANDLE)_beginthreadex (NULL,0,thread_starter,p,0,&garbage); 60 | // make thread and add it to the pool 61 | 62 | // return false if _beginthreadex didn't work 63 | if ( thandle == 0) 64 | { 65 | delete p; 66 | return false; 67 | } 68 | 69 | // throw away the thread handle 70 | CloseHandle(thandle); 71 | return true; 72 | } 73 | 74 | // ----------------------------------------------------------------------------------- 75 | 76 | } 77 | 78 | } 79 | 80 | #endif // WIN32 81 | 82 | #endif // DLIB_THREADS_KERNEL_1_CPp_ 83 | 84 | -------------------------------------------------------------------------------- /src/dlib/dlib/threads/threads_kernel_2.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_THREADS_KERNEL_2_CPp_ 4 | #define DLIB_THREADS_KERNEL_2_CPp_ 5 | 6 | #include "../platform.h" 7 | 8 | #ifdef POSIX 9 | 10 | #include "threads_kernel_2.h" 11 | 12 | 13 | namespace dlib 14 | { 15 | namespace threads_kernel_shared_helpers 16 | { 17 | 18 | // ----------------------------------------------------------------------------------- 19 | 20 | struct info 21 | { 22 | void* param; 23 | void (*funct)(void*); 24 | }; 25 | 26 | // ----------------------------------------------------------------------------------- 27 | 28 | void* thread_starter ( 29 | void* param 30 | ) 31 | { 32 | info* alloc_p = reinterpret_cast(param); 33 | info p = *alloc_p; 34 | delete alloc_p; 35 | 36 | // detach self 37 | pthread_detach(pthread_self()); 38 | 39 | p.funct(p.param); 40 | return 0; 41 | } 42 | 43 | // ----------------------------------------------------------------------------------- 44 | 45 | bool spawn_thread ( 46 | void (*funct)(void*), 47 | void* param 48 | ) 49 | { 50 | info* p; 51 | try { p = new info; } 52 | catch (...) { return false; } 53 | 54 | p->funct = funct; 55 | p->param = param; 56 | 57 | pthread_t thread_id; 58 | if ( pthread_create (&thread_id, 0, thread_starter, p) ) 59 | { 60 | delete p; 61 | return false; 62 | } 63 | return true; 64 | } 65 | 66 | // ----------------------------------------------------------------------------------- 67 | 68 | } 69 | 70 | } 71 | 72 | #endif // POSIX 73 | 74 | #endif // DLIB_THREADS_KERNEL_2_CPp_ 75 | 76 | -------------------------------------------------------------------------------- /src/dlib/dlib/threads/windows.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_THREADS_KERNEl_2_ 4 | #include "threads_kernel_1.h" 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /src/dlib/dlib/timeout.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_TIMEOUt_ 4 | #define DLIB_TIMEOUt_ 5 | 6 | #include "timeout/timeout_kernel_1.h" 7 | 8 | namespace dlib 9 | { 10 | 11 | class timeout 12 | { 13 | timeout() {} 14 | 15 | 16 | public: 17 | 18 | //----------- kernels --------------- 19 | 20 | // kernel_1a 21 | typedef timeout_kernel_1 22 | kernel_1a; 23 | 24 | }; 25 | } 26 | 27 | #endif // DLIB_TIMEOUt_ 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/dlib/dlib/timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_TIMEr_ 4 | #define DLIB_TIMEr_ 5 | 6 | #include "timer/timer_kernel_1.h" 7 | #include "timer/timer_kernel_2.h" 8 | #include "uintn.h" 9 | #include "memory_manager.h" 10 | 11 | namespace dlib 12 | { 13 | 14 | template < 15 | typename T 16 | > 17 | class timer 18 | { 19 | timer() {} 20 | 21 | 22 | 23 | public: 24 | 25 | //----------- kernels --------------- 26 | 27 | // kernel_1a 28 | typedef timer_kernel_1 29 | kernel_1a; 30 | 31 | // kernel_2a 32 | typedef timer_kernel_2 33 | kernel_2a; 34 | }; 35 | } 36 | 37 | #endif // DLIB_TIMEr_ 38 | 39 | -------------------------------------------------------------------------------- /src/dlib/dlib/tokenizer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2005 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_TOKENIZEr_ 4 | #define DLIB_TOKENIZEr_ 5 | 6 | #include "tokenizer/tokenizer_kernel_1.h" 7 | #include "tokenizer/tokenizer_kernel_c.h" 8 | 9 | 10 | namespace dlib 11 | { 12 | 13 | class tokenizer 14 | { 15 | tokenizer() {} 16 | 17 | 18 | public: 19 | 20 | //----------- kernels --------------- 21 | 22 | // kernel_1a 23 | typedef tokenizer_kernel_1 24 | kernel_1a; 25 | typedef tokenizer_kernel_c 26 | kernel_1a_c; 27 | 28 | 29 | }; 30 | } 31 | 32 | #endif // DLIB_TOKENIZEr_ 33 | 34 | -------------------------------------------------------------------------------- /src/dlib/dlib/tuple.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_TUPLe_TOP_ 4 | #define DLIB_TUPLe_TOP_ 5 | 6 | #include "tuple/tuple.h" 7 | 8 | #endif // DLIB_TUPLe_TOP__ 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/dlib/dlib/type_safe_union.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2009 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_TYPE_SAFE_UNIOn_TOP_ 4 | #define DLIB_TYPE_SAFE_UNIOn_TOP_ 5 | 6 | #include "type_safe_union/type_safe_union_kernel.h" 7 | 8 | #endif // DLIB_TYPE_SAFE_UNIOn_TOP_ 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/dlib/dlib/unicode.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2007 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_UNICODe_TOP_ 4 | #define DLIB_UNICODe_TOP_ 5 | 6 | #include "unicode/unicode.h" 7 | 8 | #endif // DLIB_UNICODe_TOP_ 9 | 10 | -------------------------------------------------------------------------------- /src/dlib/dlib/windows_magic.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2006 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_WINDOWS_MAGIc_ 4 | #define DLIB_WINDOWS_MAGIc_ 5 | 6 | #include "platform.h" 7 | 8 | #ifdef WIN32 9 | 10 | // This file contains all the magical #defines you have to setup before you 11 | // include the windows header files. 12 | 13 | #ifndef NOMINMAX 14 | #define NOMINMAX // prevent windows from messing with std::min and std::max 15 | #endif 16 | 17 | // now just for good measure undefine min and max if they are defined 18 | #ifdef min 19 | #undef min 20 | #endif 21 | 22 | #ifdef max 23 | #undef max 24 | #endif 25 | 26 | #ifdef NO_MAKEFILE 27 | // only define this if all the cpp files are going to be sucked into the headers 28 | // because otherwise we don't need it since everything is isolated in the sockets 29 | // cpp file and this declaration for _WINSOCKAPI_ appears there also. 30 | #ifndef _WINSOCKAPI_ 31 | #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ 32 | #endif 33 | #endif 34 | 35 | // This is something stupid you have to do to make visual studio include the right 36 | // stuff. I don't really know what the deal is with this. 37 | #if _WIN32_WINNT < 0x0500 38 | #undef _WIN32_WINNT 39 | #define _WIN32_WINNT 0x0500 40 | #endif 41 | 42 | #endif // WIN32 43 | 44 | #endif // DLIB_WINDOWS_MAGIc_ 45 | 46 | -------------------------------------------------------------------------------- /src/dlib/dlib/xml_parser.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_XML_PARSEr_ 4 | #define DLIB_XML_PARSEr_ 5 | 6 | #include 7 | 8 | #include "xml_parser/xml_parser_kernel_interfaces.h" 9 | #include "xml_parser/xml_parser_kernel_1.h" 10 | #include "xml_parser/xml_parser_kernel_c.h" 11 | 12 | #include "map.h" 13 | #include "stack.h" 14 | #include "sequence.h" 15 | 16 | 17 | namespace dlib 18 | { 19 | 20 | 21 | class xml_parser 22 | { 23 | 24 | 25 | 26 | 27 | typedef map::kernel_2a>::kernel_1b map1a; 28 | typedef map::kernel_2a>::kernel_1b_c map1a_c; 29 | typedef stack::kernel_2a>::kernel_1a stack1a; 30 | typedef sequence::kernel_2a seq_dh2a; 31 | typedef sequence::kernel_2a seq_eh2a; 32 | 33 | 34 | 35 | // A version that uses the checked map. This way there is checking on the attribute 36 | // list that gets passed back to the user. 37 | typedef xml_parser_kernel_1 38 | kernel_1a_c_impl; 39 | 40 | xml_parser() {} 41 | public: 42 | 43 | //----------- kernels --------------- 44 | 45 | // kernel_1a 46 | typedef xml_parser_kernel_1 47 | kernel_1a; 48 | typedef xml_parser_kernel_c 49 | kernel_1a_c; 50 | 51 | 52 | }; 53 | } 54 | 55 | #endif // DLIB_XML_PARSEr_ 56 | 57 | -------------------------------------------------------------------------------- /src/dlib/dlib/xml_parser/xml_parser_kernel_c.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003 Davis E. King (davis@dlib.net) 2 | // License: Boost Software License See LICENSE.txt for the full license. 3 | #ifndef DLIB_XML_PARSER_KERNEL_C_ 4 | #define DLIB_XML_PARSER_KERNEL_C_ 5 | 6 | #include "xml_parser_kernel_abstract.h" 7 | #include 8 | #include 9 | #include "../algs.h" 10 | #include "../assert.h" 11 | 12 | namespace dlib 13 | { 14 | 15 | template < 16 | typename xml_parser_base 17 | > 18 | class xml_parser_kernel_c : public xml_parser_base 19 | { 20 | public: 21 | void parse ( 22 | std::istream& in 23 | ); 24 | }; 25 | 26 | 27 | template < 28 | typename xml_parser_base 29 | > 30 | inline void swap ( 31 | xml_parser_kernel_c& a, 32 | xml_parser_kernel_c& b 33 | ) { a.swap(b); } 34 | 35 | // ---------------------------------------------------------------------------------------- 36 | // ---------------------------------------------------------------------------------------- 37 | // member function definitions 38 | // ---------------------------------------------------------------------------------------- 39 | // ---------------------------------------------------------------------------------------- 40 | 41 | 42 | template < 43 | typename xml_parser_base 44 | > 45 | void xml_parser_kernel_c:: 46 | parse ( 47 | std::istream& in 48 | ) 49 | { 50 | DLIB_CASSERT ( in.fail() == false , 51 | "\tvoid xml_parser::parse" 52 | << "\n\tthe input stream must not be in the fail state" 53 | << "\n\tthis: " << this 54 | ); 55 | 56 | return xml_parser_base::parse(in); 57 | } 58 | 59 | // ---------------------------------------------------------------------------------------- 60 | 61 | } 62 | 63 | #endif // DLIB_XML_PARSER_KERNEL_C_ 64 | 65 | -------------------------------------------------------------------------------- /src/dlib/docs/.current_minor_release_number: -------------------------------------------------------------------------------- 1 | 33 2 | -------------------------------------------------------------------------------- /src/dlib/docs/.current_release_number: -------------------------------------------------------------------------------- 1 | 17 2 | -------------------------------------------------------------------------------- /src/dlib/docs/.logger_revnum: -------------------------------------------------------------------------------- 1 | 3957 2 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/bigminus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/bigminus.gif -------------------------------------------------------------------------------- /src/dlib/docs/docs/bigplus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/bigplus.gif -------------------------------------------------------------------------------- /src/dlib/docs/docs/boost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/boost.png -------------------------------------------------------------------------------- /src/dlib/docs/docs/change_log.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Change Log 6 | 7 |
8 |
Old Change Logs
9 |
10 | 11 |
12 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/READ THE README. DO NOT EDIT THE TABLE OF CONTENTS FILE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/chm/READ THE README. DO NOT EDIT THE TABLE OF CONTENTS FILE -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/READ THE README. DO NOT EDIT THE TABLE OF CONTENTS FILE2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/chm/READ THE README. DO NOT EDIT THE TABLE OF CONTENTS FILE2 -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/READ THE README. DO NOT EDIT THE TABLE OF CONTENTS FILE3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/chm/READ THE README. DO NOT EDIT THE TABLE OF CONTENTS FILE3 -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/README.txt: -------------------------------------------------------------------------------- 1 | The Table of Contents.hhc file is auto generated by the toc.xml and htmlhelp_stylesheet.xsl files. 2 | You really can edit it if you want but I suggest you use the stylesheet to auto generate it instead. 3 | 4 | If you want to regenerate the table of contents file you can do so with 5 | the command "msxsl toc.xml htmlhelp_stylesheet.xsl" if you are using msxsl.exe. -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/documentation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | dlib C++ library 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

15 | 16 | click here to go to the documentation 17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/htmlhelp/hha.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/chm/htmlhelp/hha.dll -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/htmlhelp/hhc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/chm/htmlhelp/hhc.exe -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/htmlhelp/htmlhelp.reg: -------------------------------------------------------------------------------- 1 | REGEDIT4 2 | 3 | 4 | [HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides] 5 | "itss"="native" 6 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/htmlhelp/itcc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/chm/htmlhelp/itcc.dll -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/htmlhelp/itircl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/chm/htmlhelp/itircl.dll -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/htmlhelp/itss.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/chm/htmlhelp/itss.dll -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/htmlhelp/setup_htmlhelp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Setup the registry 4 | wine regedit htmlhelp.reg 5 | 6 | wine regsvr32 itcc.dll 7 | wine regsvr32 itircl.dll 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/lib.hhp: -------------------------------------------------------------------------------- 1 | [OPTIONS] 2 | Binary TOC=Yes 3 | Compatibility=1.1 or later 4 | Compiled file=help.chm 5 | Contents file=Table of Contents.hhc 6 | Default topic=docs/index.html 7 | Display compile progress=Yes 8 | Full-text search=Yes 9 | Language=0x409 English (United States) 10 | Title=dLib 11 | 12 | 13 | [FILES] 14 | docs/api.html 15 | docs/dlib/test/makefile 16 | docs/right.gif 17 | docs/down.gif 18 | docs/plus.gif 19 | docs/minus.gif 20 | docs/change_log.html 21 | docs/compile.html 22 | docs/compress_stream_ex.cpp.html 23 | docs/compression.html 24 | docs/containers.html 25 | docs/dir_nav_ex.cpp.html 26 | docs/gui_api_ex.cpp.html 27 | docs/index.html 28 | docs/intro.html 29 | docs/kernel_1a.html 30 | docs/kernel_1b.html 31 | docs/kernel_1c.html 32 | docs/kernel_1da.html 33 | docs/kernel_1db.html 34 | docs/kernel_1ea.html 35 | docs/kernel_1eb.html 36 | docs/kernel_1ec.html 37 | docs/kernel_2a.html 38 | docs/kernel_3a.html 39 | docs/kernel_3b.html 40 | docs/license.html 41 | docs/network.html 42 | docs/other.html 43 | docs/metaprogramming.html 44 | docs/imaging.html 45 | docs/parsing.html 46 | docs/queue_ex.cpp.html 47 | docs/release_notes.html 48 | docs/old_release_notes.html 49 | docs/sockets_ex.cpp.html 50 | 51 | [INFOTYPES] 52 | 53 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/chm/toc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | docs 6 | ../main_menu.xml 7 | false 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/down.gif -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_1a.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_1a 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_1b.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_1b 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_1c.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_1c 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_1da.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_1da 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_1db.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_1db 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_1ea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_1ea 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_1eb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_1eb 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_1ec.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_1ec 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_2a.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_2a 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_3a.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_3a 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/kernel_3b.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | kernel_3b 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/license.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | License 6 |
 7 | 
 8 | 
 9 | Boost Software License - Version 1.0 - August 17th, 2003
10 | 
11 | Permission is hereby granted, free of charge, to any person or organization
12 | obtaining a copy of the software and accompanying documentation covered by
13 | this license (the "Software") to use, reproduce, display, distribute,
14 | execute, and transmit the Software, and to prepare derivative works of the
15 | Software, and to permit third-parties to whom the Software is furnished to
16 | do so, all subject to the following:
17 | 
18 | The copyright notices in the Software and this entire statement, including
19 | the above license grant, this restriction and the following disclaimer,
20 | must be included in all copies of the Software, in whole or in part, and
21 | all derivative works of the Software, unless such copies or derivative
22 | works are solely in the form of machine-executable object code generated by
23 | a source language processor.
24 | 
25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
28 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
29 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
30 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
31 | DEALINGS IN THE SOFTWARE.
32 | 
33 | 
34 | 
35 |    
36 |
37 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/minus.gif -------------------------------------------------------------------------------- /src/dlib/docs/docs/old_change_log.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Old Change Logs 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/old_release_notes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Old Release Notes 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/dlib/docs/docs/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/plus.gif -------------------------------------------------------------------------------- /src/dlib/docs/docs/right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/docs/right.gif -------------------------------------------------------------------------------- /src/dlib/docs/htmlify/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This is a CMake makefile. You can find the cmake utility and 3 | # information about it at http://www.cmake.org 4 | # 5 | 6 | SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) 7 | cmake_minimum_required(VERSION 2.4) 8 | if(COMMAND cmake_policy) 9 | cmake_policy(SET CMP0003 NEW) 10 | endif() 11 | 12 | # create a variable called target_name and set it to the string "htmlify" 13 | set (target_name htmlify) 14 | 15 | PROJECT(${target_name}) 16 | 17 | # add all the cpp files we want to compile to this list. This tells 18 | # cmake that they are part of our target (which is the exectuable named htmlify) 19 | ADD_EXECUTABLE(${target_name} 20 | htmlify.cpp 21 | to_xml.cpp 22 | ) 23 | 24 | # add the folder containing the dlib folder to the include path 25 | INCLUDE_DIRECTORIES(../..) 26 | 27 | # There is a CMakeLists.txt file in the dlib source folder that tells cmake 28 | # how to build the dlib library. Tell cmake about that file. 29 | add_subdirectory(../../dlib dlib_build) 30 | 31 | # Tell cmake to link our target executable to the non-gui version of the dlib 32 | # library. 33 | TARGET_LINK_LIBRARIES(${target_name} dlib ) 34 | 35 | 36 | 37 | 38 | INSTALL(TARGETS ${target_name} 39 | RUNTIME DESTINATION bin 40 | ) 41 | 42 | 43 | #set default build type to Release 44 | if(NOT CMAKE_BUILD_TYPE) 45 | set(CMAKE_BUILD_TYPE "Release" CACHE STRING 46 | "Choose the type of build, options are: Debug Release 47 | RelWithDebInfo MinSizeRel." FORCE) 48 | endif() 49 | 50 | -------------------------------------------------------------------------------- /src/dlib/docs/htmlify/to_xml.h: -------------------------------------------------------------------------------- 1 | #ifndef DLIB_HTMLIFY_TO_XmL_H__ 2 | #define DLIB_HTMLIFY_TO_XmL_H__ 3 | 4 | #include "dlib/cmd_line_parser.h" 5 | #include 6 | 7 | void generate_xml_markup( 8 | const dlib::cmd_line_parser::check_1a_c& parser, 9 | const std::string& filter, 10 | const unsigned long search_depth, 11 | const unsigned long expand_tabs 12 | ); 13 | /*! 14 | ensures 15 | - reads all the files indicated by the parser arguments and converts them 16 | to XML. The output will be stored in the output.xml file. 17 | - if (expand_tabs != 0) then 18 | - tabs will be replaced with expand_tabs spaces inside comment blocks 19 | !*/ 20 | 21 | #endif // DLIB_HTMLIFY_TO_XmL_H__ 22 | 23 | -------------------------------------------------------------------------------- /src/dlib/docs/htmlify/to_xml_example/bigminus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/htmlify/to_xml_example/bigminus.gif -------------------------------------------------------------------------------- /src/dlib/docs/htmlify/to_xml_example/bigplus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/htmlify/to_xml_example/bigplus.gif -------------------------------------------------------------------------------- /src/dlib/docs/htmlify/to_xml_example/example.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Documented Code 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/dlib/docs/htmlify/to_xml_example/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/htmlify/to_xml_example/minus.gif -------------------------------------------------------------------------------- /src/dlib/docs/htmlify/to_xml_example/output.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test 6 | 7 | class test 8 | test.cpp 9 | WHAT THIS OBJECT REPRESENTS 10 | This is a simple test class that doesn't do anything 11 | 12 | typedef int type 13 | 14 | 15 | 16 | test 17 | test() 18 | ensures 19 | - constructs a test object 20 | 21 | 22 | print 23 | void 24 | print() const 25 | ensures 26 | - prints a message to the screen 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | add_numbers 37 | 38 | int 39 | add_numbers ( 40 | int a, 41 | int b 42 | ) 43 | test.cpp 44 | ensures 45 | - returns a + b 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/dlib/docs/htmlify/to_xml_example/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bskari/sqlassie/8e803236bb04b17d08f836c5bad5d984609edac1/src/dlib/docs/htmlify/to_xml_example/plus.gif -------------------------------------------------------------------------------- /src/dlib/docs/htmlify/to_xml_example/test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // ---------------------------------------------------------------------------------------- 4 | 5 | using namespace std; 6 | 7 | // ---------------------------------------------------------------------------------------- 8 | 9 | class test 10 | { 11 | /*! 12 | WHAT THIS OBJECT REPRESENTS 13 | This is a simple test class that doesn't do anything 14 | !*/ 15 | 16 | public: 17 | 18 | typedef int type; 19 | 20 | test (); 21 | /*! 22 | ensures 23 | - constructs a test object 24 | !*/ 25 | 26 | void print () const; 27 | /*! 28 | ensures 29 | - prints a message to the screen 30 | !*/ 31 | 32 | }; 33 | 34 | // ---------------------------------------------------------------------------------------- 35 | 36 | test::test() {} 37 | 38 | void test::print() const 39 | { 40 | cout << "A message!" << endl; 41 | } 42 | 43 | // ---------------------------------------------------------------------------------------- 44 | 45 | int add_numbers ( 46 | int a, 47 | int b 48 | ) 49 | /*! 50 | ensures 51 | - returns a + b 52 | !*/ 53 | { 54 | return a + b; 55 | } 56 | 57 | // ---------------------------------------------------------------------------------------- 58 | 59 | void a_function ( 60 | ) 61 | /*!P 62 | This is a function which won't show up in the output of htmlify --to-xml 63 | because of the presence of the P in the above /*!P above. 64 | !*/ 65 | { 66 | } 67 | 68 | // ---------------------------------------------------------------------------------------- 69 | 70 | int main() 71 | { 72 | test a; 73 | a.print(); 74 | } 75 | 76 | // ---------------------------------------------------------------------------------------- 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/dlib/docs/makesnapshot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | report_failure () 4 | { 5 | echo " **** failed to complete **** " 6 | exit 1 7 | } 8 | 9 | 10 | ./testenv || report_failure 11 | 12 | ./makedocs snapshot || exit 1 13 | 14 | REVNUM_FILE=.logger_revnum 15 | 16 | 17 | rm -rf release/* || report_failure 18 | 19 | 20 | DLIB_REPOS=`svn info | grep URL | awk '{print $2}' | sed -e 's/\/docs$//' ` 21 | 22 | 23 | REVISION=`svn info | grep Revision | awk '{ print $2 }'` 24 | 25 | svn log -v -r $REVISION:`cat $REVNUM_FILE` $DLIB_REPOS/dlib > release/change_log.txt || report_failure 26 | 27 | 28 | 29 | 30 | 31 | cd release || report_failure 32 | 33 | 34 | RELDIR=`echo dlib_snapshot-rev$REVISION` 35 | mkdir $RELDIR 36 | cd $RELDIR || report_failure 37 | cp -r ../../docs/cache/dlib . || report_failure 38 | cp -r ../../docs/cache/examples . || report_failure 39 | 40 | echo This copy of dlib C++ library is a developmental snapshot. >> dlib/README.txt 41 | echo "Date: `date`" >> dlib/README.txt 42 | echo Subversion Revision Number: $REVISION >> dlib/README.txt 43 | 44 | 45 | SOURCE_ZIP=`echo $RELDIR.zip` 46 | SOURCE_TAR=`echo $RELDIR.tar` 47 | tar -C ../../docs/chm -cf - docs/ documentation.html --exclude=".svn" | tar -xf - 48 | cd .. || report_failure 49 | 50 | tar -cf $SOURCE_TAR $RELDIR 51 | # flip everything to MS-DOS line endings 52 | find $RELDIR -name "*.cpp" -or -name "*.h" -or -name "*.txt" -or -name "*.html" | xargs flip -m 53 | zip -r9 $SOURCE_ZIP $RELDIR > /dev/null 54 | bzip2 $SOURCE_TAR 55 | 56 | rm -rf $RELDIR 57 | 58 | 59 | # make an index.html with links to the snapshot archives and chm file 60 | #echo "" > index.html 61 | #echo "$SOURCE_ZIP
" >> index.html 62 | #echo "$SOURCE_TAR.bz2
" >> index.html 63 | #echo "dlib_documentation_snapshot-rev$REVISION.chm
" >> index.html 64 | #echo "" >> index.html 65 | 66 | 67 | # finally, generate the chm help file 68 | wine ../docs/chm/htmlhelp/hhc.exe ../docs/chm/lib.hhp 69 | mv ../docs/chm/help.chm dlib_documentation_snapshot-rev$REVISION.chm 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/dlib/docs/testenv: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | # 3 | #This script checks to make sure all the commands we need are 4 | #present 5 | 6 | return_error() 7 | { 8 | echo "Error, can't run the $1 command" 9 | exit 1 10 | } 11 | 12 | 13 | echo Testing environment for needed utilities 14 | 15 | bc -h > /dev/null || return_error "bc"; 16 | flip -h > /dev/null || return_error "flip"; 17 | echo nothing | awk '{}' > /dev/null || return_error "awk"; 18 | echo | sed -e "s/s/r/" > /dev/null || return_error "sed"; 19 | htmlify > /dev/null || return_error "htmlify"; 20 | echo | xargs > /dev/null || return_error "xargs"; 21 | svn help > /dev/null || return_error "svn"; 22 | xsltproc -V > /dev/null || return_error "xsltproc"; 23 | tar --help > /dev/null || return_error "tar"; 24 | zip -h > /dev/null || return_error "zip"; 25 | bzip2 -h &> /dev/null || return_error "bzip2"; 26 | wine --help &> /dev/null || return_error "wine"; 27 | 28 | 29 | echo All needed utilities found 30 | exit 0 31 | 32 | -------------------------------------------------------------------------------- /src/dlib/examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt: -------------------------------------------------------------------------------- 1 | The intent of the example programs supplied with the dlib C++ library is 2 | to both instruct users and to also provide a simple body of code they 3 | may copy and paste from. To make this as painless as possible all the 4 | example programs have been placed into the public domain. 5 | 6 | 7 | This work is hereby released into the Public Domain. 8 | To view a copy of the public domain dedication, visit 9 | http://creativecommons.org/licenses/publicdomain/ or send a 10 | letter to 11 | Creative Commons 12 | 171 Second Street 13 | Suite 300, 14 | San Francisco, California, 94105, USA. 15 | 16 | 17 | 18 | Public domain dedications are not recognized by some countries. So 19 | if you live in an area where the above dedication isn't valid then 20 | you can consider the example programs to be licensed under the Boost 21 | Software License. 22 | 23 | -------------------------------------------------------------------------------- /src/dlib/examples/config.txt: -------------------------------------------------------------------------------- 1 | # This is an example config file. Note that # is used to create a comment. 2 | 3 | # At its most basic level a config file is just a bunch of key/value pairs. 4 | # So for example: 5 | key1 = value2 6 | dlib = a C++ library 7 | 8 | # You can also define "sub blocks" in your config files like so 9 | user1 10 | { 11 | # Inside a sub block you can list more key/value pairs. 12 | id = 42 13 | name = davis 14 | 15 | # you can also nest sub-blocks as deep as you want 16 | details 17 | { 18 | editor = vim 19 | home_dir = /home/davis 20 | } 21 | } 22 | user2 { 23 | id = 1234 24 | name = joe 25 | details { 26 | editor = emacs 27 | home_dir = /home/joe 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /src/dlib/examples/thread_function_ex.cpp: -------------------------------------------------------------------------------- 1 | // The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt 2 | /* 3 | This is a very simple example that illustrates the use of the 4 | thread_function object from the dlib C++ Library. 5 | 6 | The output of the programs should look like this: 7 | 8 | 45.6 9 | 9.999 10 | I have no args! 11 | val: 3 12 | */ 13 | 14 | 15 | #include 16 | #include "dlib/threads.h" 17 | #include "dlib/ref.h" 18 | 19 | using namespace dlib; 20 | using namespace std; 21 | 22 | void thread_1(double a) 23 | { 24 | cout << a << endl; 25 | } 26 | 27 | void thread_2 () 28 | { 29 | cout << "I have no args!" << endl; 30 | } 31 | 32 | void thread_increment(double& a) 33 | { 34 | a += 1; 35 | } 36 | 37 | int main() 38 | { 39 | // create a thread that will call thread_1(45.6) 40 | thread_function t1(thread_1,45.6); 41 | // wait for the t1 thread to end 42 | t1.wait(); 43 | 44 | 45 | // create a thread that will call thread_1(9.999) 46 | thread_function t2(thread_1,9.999); 47 | // wait for the t2 thread to end 48 | t2.wait(); 49 | 50 | 51 | // create a thread that will call thread_2() 52 | thread_function t3(thread_2); 53 | 54 | 55 | // Note that we can also use the ref() function to pass a variable 56 | // to a thread by reference. For example, the thread below adds 57 | // one to val. 58 | double val = 2; 59 | thread_function t4(thread_increment, dlib::ref(val)); 60 | t4.wait(); // wait for t4 to finish before printing val. 61 | // Print val. It will now have a value of 3. 62 | cout << "val: " << val << endl; 63 | 64 | 65 | 66 | // At this point we will automatically wait for t3 to end because 67 | // the destructor for thread_function objects always wait for their 68 | // thread to terminate. 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/dlib/examples/threaded_object_ex.cpp: -------------------------------------------------------------------------------- 1 | // The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt 2 | /* 3 | 4 | This is an example illustrating the use of the threaded_object 5 | from the dlib C++ Library. 6 | 7 | 8 | This is a very simple example. It creates a single thread that 9 | just prints messages to the screen. 10 | */ 11 | 12 | 13 | #include 14 | #include "dlib/threads.h" 15 | #include "dlib/misc_api.h" // for dlib::sleep 16 | 17 | using namespace std; 18 | using namespace dlib; 19 | 20 | class my_object : public threaded_object 21 | { 22 | public: 23 | my_object() 24 | { 25 | // Start our thread going in the thread() function 26 | start(); 27 | } 28 | 29 | ~my_object() 30 | { 31 | // Tell the thread() function to stop. This will cause should_stop() to 32 | // return true so the thread knows what to do. 33 | stop(); 34 | 35 | // Wait for the thread to stop before letting this object destruct itself. 36 | // Also note, you are *required* to wait for the thread to end before 37 | // letting this object destruct itself. 38 | wait(); 39 | } 40 | 41 | private: 42 | 43 | void thread() 44 | { 45 | // This is our thread. It will loop until it is told that it should terminate. 46 | while (should_stop() == false) 47 | { 48 | cout << "hurray threads!" << endl; 49 | dlib::sleep(500); 50 | } 51 | } 52 | }; 53 | 54 | int main() 55 | { 56 | // Create an instance of our threaded object. 57 | my_object t; 58 | 59 | dlib::sleep(4000); 60 | 61 | // Tell the threaded object to pause its thread. This causes the 62 | // thread to block on its next call to should_stop(). 63 | t.pause(); 64 | 65 | dlib::sleep(3000); 66 | cout << "starting thread back up from paused state" << endl; 67 | 68 | // Tell the thread to unpause itself. This causes should_stop() to unblock 69 | // and to let the thread continue. 70 | t.start(); 71 | 72 | dlib::sleep(4000); 73 | 74 | // Let the program end. When t is destructed it will gracefully terminate your 75 | // thread because we have set the destructor up to do so. 76 | } 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/dlib/examples/timer_ex.cpp: -------------------------------------------------------------------------------- 1 | // The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt 2 | 3 | 4 | /* 5 | This is an example illustrating the use of the timer object. 6 | 7 | The timer object is an object that calls some user specified member function 8 | in its own thread at regular intervals. 9 | */ 10 | 11 | 12 | #include "dlib/timer.h" 13 | #include "dlib/misc_api.h" // for dlib::sleep 14 | #include 15 | 16 | using namespace dlib; 17 | using namespace std; 18 | 19 | // ---------------------------------------------------------------------------------------- 20 | 21 | class timer_example 22 | { 23 | public: 24 | timer_example( 25 | ) : 26 | // Here we construct our timer object. It needs two things. The second argument is 27 | // the member function it is going to call at regular intervals and the first 28 | // argument is the object instance it will call that member function on. 29 | t(*this,&timer_example::action_function) 30 | { 31 | // set the timer object to trigger every second 32 | t.set_delay_time(1000); 33 | 34 | // start the timer. It will start calling the action function 35 | // 1 second from this call to start. 36 | t.start(); 37 | } 38 | 39 | private: 40 | 41 | timer::kernel_2a t; 42 | 43 | void action_function() 44 | { 45 | // print out a message so we can see that this function is being triggered 46 | cout << "action_function() called" << endl; 47 | } 48 | }; 49 | 50 | // ---------------------------------------------------------------------------------------- 51 | 52 | int main() 53 | { 54 | timer_example e; 55 | 56 | // sleep for 10 seconds before letting the program end 57 | dlib::sleep(10000); 58 | } 59 | 60 | // ---------------------------------------------------------------------------------------- 61 | 62 | -------------------------------------------------------------------------------- /src/getpass.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | /** 26 | * getpass is deprecated and will be removed soon - this duplicates that 27 | * feature and allows user input without echo. 28 | * @author Brandon Skari 29 | * @date May 5 2011 30 | */ 31 | 32 | #ifndef SRC_GETPASS_H_ 33 | #define SRC_GETPASS_H_ 34 | 35 | char* getpass(const char* prompt, char* buffer, const int size) 36 | { 37 | struct termios oflags, nflags; 38 | 39 | /* Disable echo */ 40 | tcgetattr(fileno(stdin), &oflags); 41 | nflags = oflags; 42 | nflags.c_lflag &= ~ECHO; 43 | nflags.c_lflag |= ECHONL; 44 | 45 | if (0 != tcsetattr(fileno(stdin), TCSANOW, &nflags)) 46 | { 47 | return NULL; 48 | } 49 | 50 | printf("%s", prompt); 51 | char* const success = fgets(buffer, size, stdin); 52 | if (NULL == success) 53 | { 54 | return NULL; 55 | } 56 | 57 | /* Make sure it's null-terminated */ 58 | buffer[size - 1] = '\0'; 59 | 60 | /* fgets will also include a newline, so remove it */ 61 | for (char* i = buffer; i != '\0'; ++i) 62 | { 63 | if ('\n' == *i || '\r' == *i) 64 | { 65 | *i = '\0'; 66 | break; 67 | } 68 | } 69 | 70 | /* Enable echo */ 71 | if (0 != tcsetattr(fileno(stdin), TCSANOW, &oflags)) 72 | { 73 | return NULL; 74 | } 75 | 76 | return buffer; 77 | } 78 | 79 | #endif // SRC_GETPASS_H_ 80 | -------------------------------------------------------------------------------- /src/initializeSingletons.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "initializeSingletons.hpp" 22 | #include "Logger.hpp" 23 | #include "MySqlGuardObjectContainer.hpp" 24 | #include "SensitiveNameChecker.hpp" 25 | 26 | void initializeSingletons() 27 | { 28 | // Instantiate singleton classes 29 | Logger::initialize(); 30 | MySqlGuardObjectContainer::initialize(); 31 | SensitiveNameChecker::initialize(); 32 | } 33 | -------------------------------------------------------------------------------- /src/initializeSingletons.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_INITIALIZESINGLETONS_HPP_ 22 | #define SRC_INITIALIZESINGLETONS_HPP_ 23 | 24 | /** 25 | * Initializes all of the useful singleton classes. This code is factored out 26 | * of all the main files I have scattered around. 27 | * @author Brandon Skari 28 | * @date May 10 2012 29 | */ 30 | void initializeSingletons(); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/logger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #include "Logger.hpp" 22 | #include "MySqlLoggerListenSocket.hpp" 23 | 24 | #include 25 | #include 26 | 27 | using boost::lexical_cast; 28 | using std::cerr; 29 | using std::endl; 30 | 31 | int main(int argc, char* argv[]) 32 | { 33 | if (argc < 4) 34 | { 35 | cerr << "Usage: " 36 | << argv[0] 37 | << " listenPort MySQL-port MySQL-host" 38 | << endl; 39 | return -1; 40 | } 41 | const uint16_t listenPort = lexical_cast(argv[1]); 42 | const uint16_t mySqlPort = lexical_cast(argv[2]); 43 | MySqlLoggerListenSocket logger(listenPort, mySqlPort, argv[3]); 44 | logger.acceptClients(); 45 | Logger::log(Logger::INFO) << "Exiting main"; 46 | } 47 | -------------------------------------------------------------------------------- /src/tests/blockWhitelist.mysql: -------------------------------------------------------------------------------- 1 | # Deviations from this shouldn't be blocked, e.g.: 2 | # they don't union against password 3 | # they don't have an always true statement 4 | # they don't comment out quotes 5 | # etc., because the query risk will have changed 6 | SELECT * FROM something WHERE age > '21' OR 1 = 1 UNION SELECT username, password FROM user -- ' 7 | -------------------------------------------------------------------------------- /src/tests/nightly/crawl_ccdc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Crawls the CCDC Mediawiki page for stress testing SQLassie and MySQL.""" 3 | 4 | from BeautifulSoup import BeautifulSoup 5 | import sys 6 | import urllib2 7 | 8 | all_pages_ccdc_url = "http://localhost/mediawiki/index.php/Special:AllPages" 9 | 10 | def get_soup(url): 11 | page = urllib2.urlopen(url) 12 | soup = BeautifulSoup(page) 13 | return soup 14 | 15 | def get_all_pages_links(soup): 16 | tables = soup.findAll('table') 17 | links_table = tables[2] 18 | raw_links = [link['href'] for link in links_table.findAll('a')] 19 | 20 | def relative_to_localhost(link): 21 | if link[0] == '/': 22 | return 'http://localhost' + link 23 | return link 24 | 25 | links = [relative_to_localhost(link) for link in raw_links] 26 | return links 27 | 28 | def run(): 29 | front_page = get_soup(all_pages_ccdc_url) 30 | links = get_all_pages_links(front_page) 31 | for url in links: 32 | sys.stdout.write('.') 33 | urllib2.urlopen(url) 34 | sys.stdout.write('\n') 35 | 36 | if __name__ == '__main__': 37 | run() 38 | -------------------------------------------------------------------------------- /src/tests/nightly/mysqlMultiThreadedStress.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Multi-threaded MySQL stress test. 3 | # Usage: ./mysqlMultiThreadedStress.sh [threads] [port] [iterations] [user] [database] [query] 4 | set -e 5 | set -u 6 | 7 | if [ "$#" -lt 1 ]; 8 | then 9 | echo "Usage: $0 [port] [iterations] [user] [database] [query]" 1>&2 10 | exit 0 11 | fi 12 | 13 | set +u 14 | echo ./mysqlStress.sh "$2" "$3" "$4" "$5" "$6" ; 15 | set -u 16 | 17 | for i in $(seq 1 "$1") 18 | do 19 | coproc_name=coproc_$i 20 | set +u 21 | coproc "$coproc_name" { ./mysqlStress.sh $2 $3 $4 $5 $6 ; } 22 | set -u 23 | pid_arr["$i"]="$!" 24 | done 25 | 26 | for i in $(seq 1 "$1") 27 | do 28 | wait ${pid_arr["$i"]} 29 | done 30 | -------------------------------------------------------------------------------- /src/tests/nightly/mysqlStress.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # MySQL stress test. 3 | # Usage: ./mysqlStress.sh [port] [iterations] [user] [database] [query] 4 | set -e 5 | set -u 6 | 7 | if [ "$#" -ge 1 ] ; 8 | then 9 | port="$1" 10 | else 11 | port=3306 12 | fi 13 | 14 | if [ "$#" -ge 2 ] ; 15 | then 16 | iterations="$2" 17 | else 18 | iterations=10000 19 | fi 20 | 21 | if [ "$#" -ge 3 ] ; 22 | then 23 | user="$3" 24 | else 25 | user='sqlassie' 26 | fi 27 | 28 | if [ "$#" -ge 4 ] ; 29 | then 30 | database="$4" 31 | else 32 | database='mysql' 33 | fi 34 | 35 | if [ "$#" -ge 5 ] ; 36 | then 37 | query="$5" 38 | else 39 | query="SELECT User, Host, User FROM user ORDER BY User, Host LIMIT 1, 3;" 40 | fi 41 | 42 | command="mysql -u $user -P $port $database -h 127.0.0.1" 43 | echo "$command" 44 | yes "$query" | head -n "$iterations" | $command > /dev/null 45 | -------------------------------------------------------------------------------- /src/tests/parseWhitelist.mysql: -------------------------------------------------------------------------------- 1 | # Empty query 2 | ; 3 | 4 | # Weird queries 5 | SELECT select FROM from WHERE where = not AND and = or 6 | 7 | # Any string should be parsed just fine 8 | SELECT "foo" FROM "bar" JOIN "baz" 9 | -------------------------------------------------------------------------------- /src/tests/testMySqlConstants.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | #ifndef SRC_TESTS_TESTMYSQLCONSTANTS_HPP_ 21 | #define SRC_TESTS_TESTMYSQLCONSTANTS_HPP_ 22 | 23 | /** 24 | * Tests that my implementation of the soundex algorithm, used in SOUNDS LIKE 25 | * comparisons, matches MySQL''s implementation. 26 | */ 27 | void testSoundex(); 28 | 29 | 30 | /** 31 | * Tests that my function to convert MySQL regular expressions into Perl 32 | * regular expressions that I can use with Boost's regular expression library 33 | * works. 34 | */ 35 | void testConvertRegex(); 36 | 37 | #endif // SRC_TESTS_TESTMYSQLCONSTANTS_HPP_ 38 | -------------------------------------------------------------------------------- /src/tests/testNode.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2012 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | #ifndef SRC_TESTS_TESTNODE_HPP_ 21 | #define SRC_TESTS_TESTNODE_HPP_ 22 | 23 | void testAstNode(); 24 | void testAlwaysSomethingNode(); 25 | void testComparisonNode(); 26 | 27 | #endif // SRC_TESTS_TESTNODE_HPP_ 28 | -------------------------------------------------------------------------------- /src/tests/testParser.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | #ifndef SRC_TESTS_TESTPARSER_HPP_ 21 | #define SRC_TESTS_TESTPARSER_HPP_ 22 | 23 | /** 24 | * Tests that some collected, known queries that are stored in files in the 25 | * /queries directory will successfully parse. 26 | */ 27 | void testParseKnownGoodQueries(); 28 | 29 | /** 30 | * Tests that safe queries don't produce any risks. 31 | */ 32 | void testQueryRiskSafe(); 33 | 34 | /** 35 | * Tests that the risk of certain comment types are correctly identified. 36 | */ 37 | void testQueryRiskComments(); 38 | 39 | /** 40 | * Tests that the risk of always true statements in queries are correctly 41 | * identified. 42 | */ 43 | void testQueryRiskAlwaysTrue(); 44 | 45 | /** 46 | * Test different kinds of select items. 47 | */ 48 | void testSelectItems(); 49 | 50 | #endif // SRC_TESTS_TESTPARSER_HPP_ 51 | -------------------------------------------------------------------------------- /src/tests/testQueryWhitelist.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2012 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | #ifndef SRC_TESTS_TESTQUERYWHITELIST_HPP_ 21 | #define SRC_TESTS_TESTQUERYWHITELIST_HPP_ 22 | 23 | void testParseWhitelist(); 24 | void testRiskWhitelist(); 25 | 26 | #endif // SRC_TESTS_TESTQUERYWHITELIST_HPP_ 27 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_VERSION_H_ 22 | #define SRC_VERSION_H_ 23 | 24 | const char* sqlassieVersion() 25 | { 26 | return "(Development)"; 27 | } 28 | 29 | const char* sqlassieName() 30 | { 31 | return "SQLassie"; 32 | } 33 | 34 | const char* sqlassieCopyright() 35 | { 36 | return "Copyright (C) 2011 Brandon Skari"; 37 | } 38 | 39 | const char* sqlassieShortLicense() 40 | { 41 | return 42 | "This is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; // NOLINT(whitespace/line_length) 43 | } 44 | 45 | #endif // SRC_VERSION_H_ 46 | -------------------------------------------------------------------------------- /src/warnUnusedResult.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SQLassie - database firewall 3 | * Copyright (C) 2011 Brandon Skari 4 | * 5 | * This file is part of SQLassie. 6 | * 7 | * SQLassie is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * SQLassie is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with SQLassie. If not, see . 19 | */ 20 | 21 | #ifndef SRC_WARNUNUSEDRESULT_H_ 22 | #define SRC_WARNUNUSEDRESULT_H_ 23 | 24 | /** 25 | * Defines a macro WARN_IF_UNUSED that can be applied as a function attribute 26 | * that will issue a warning if the return value of that function is ignored. 27 | * This must be applied at the declaration of the function. 28 | * 29 | * Example: 30 | * int run_some_tests() WARN_UNUSED_RESULT; 31 | * 32 | * You can ignore these checks by using the -Wno-unused-result compiler flag. 33 | * @author Brandon Skari 34 | * @date June 30 2011 35 | */ 36 | 37 | #ifdef WARN_UNUSED_RESULT 38 | #undef WARN_UNUSED_RESULT 39 | #endif 40 | 41 | #ifdef __GNUC__ 42 | #define WARN_UNUSED_RESULT __attribute__ ((warn_unused_result)) 43 | #else 44 | #define WARN_UNUSED_RESULT 45 | #endif 46 | 47 | #endif // SRC_WARNUNUSEDRESULT_H_ 48 | --------------------------------------------------------------------------------