From 3fecb55b2f47f9ed569cac1e9519a63c5f0a61ca Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Fri, 26 Apr 2013 17:18:48 +0200 Subject: [PATCH 001/118] Initial commit to add default .gitIgnore and .gitAttribute files. --- .gitattributes | 63 ++++++++++++++++++++ .gitignore | 154 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..1ff0c423 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..31a08b73 --- /dev/null +++ b/.gitignore @@ -0,0 +1,154 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store From 022af9a031c80e768eec05626b4c56cfa8732535 Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Fri, 26 Apr 2013 17:52:08 +0200 Subject: [PATCH 002/118] Creation --- HTTPServer/HTTPServer.cpp | 21 ++ HTTPServer/HTTPServer.vcxproj | 132 ++++++++ HTTPServer/HTTPServer.vcxproj.filters | 144 +++++++++ HTTPServer/ReadMe.txt | 40 +++ HTTPServer/http_connexion.cpp | 155 +++++++++ HTTPServer/http_connexion.h | 20 ++ HTTPServer/http_request.cpp | 356 +++++++++++++++++++++ HTTPServer/http_request.h | 42 +++ HTTPServer/page.h | 29 ++ HTTPServer/socket_helper.h | 44 +++ HTTPServer/socket_server.cpp | 143 +++++++++ HTTPServer/socket_server.h | 34 ++ HTTPServer/thread_pool.cpp | 80 +++++ HTTPServer/thread_pool.h | 19 ++ HTTPServer/webfront.cpp | 79 +++++ HTTPServer/webfront.h | 28 ++ HTTPServer/xmldoc.cpp | 33 ++ HTTPServer/xmldoc.h | 34 ++ HTTPServer/xmldoc_attr.cpp | 52 +++ HTTPServer/xmldoc_attr.h | 27 ++ HTTPServer/xmldoc_c_data_section.h | 14 + HTTPServer/xmldoc_character_data.cpp | 144 +++++++++ HTTPServer/xmldoc_character_data.h | 28 ++ HTTPServer/xmldoc_comment.h | 18 ++ HTTPServer/xmldoc_document.cpp | 122 +++++++ HTTPServer/xmldoc_document.h | 54 ++++ HTTPServer/xmldoc_document_fragment.h | 17 + HTTPServer/xmldoc_document_type.cpp | 58 ++++ HTTPServer/xmldoc_document_type.h | 29 ++ HTTPServer/xmldoc_dom_exception.h | 25 ++ HTTPServer/xmldoc_dom_implementation.cpp | 165 ++++++++++ HTTPServer/xmldoc_dom_implementation.h | 30 ++ HTTPServer/xmldoc_element.cpp | 164 ++++++++++ HTTPServer/xmldoc_element.h | 30 ++ HTTPServer/xmldoc_entity_reference.h | 17 + HTTPServer/xmldoc_named_node_map.cpp | 141 ++++++++ HTTPServer/xmldoc_named_node_map.h | 31 ++ HTTPServer/xmldoc_node.cpp | 195 +++++++++++ HTTPServer/xmldoc_node.h | 96 ++++++ HTTPServer/xmldoc_node_list.h | 23 ++ HTTPServer/xmldoc_processing_instruction.h | 22 ++ HTTPServer/xmldoc_text.cpp | 29 ++ HTTPServer/xmldoc_text.h | 21 ++ 43 files changed, 2985 insertions(+) create mode 100644 HTTPServer/HTTPServer.cpp create mode 100644 HTTPServer/HTTPServer.vcxproj create mode 100644 HTTPServer/HTTPServer.vcxproj.filters create mode 100644 HTTPServer/ReadMe.txt create mode 100644 HTTPServer/http_connexion.cpp create mode 100644 HTTPServer/http_connexion.h create mode 100644 HTTPServer/http_request.cpp create mode 100644 HTTPServer/http_request.h create mode 100644 HTTPServer/page.h create mode 100644 HTTPServer/socket_helper.h create mode 100644 HTTPServer/socket_server.cpp create mode 100644 HTTPServer/socket_server.h create mode 100644 HTTPServer/thread_pool.cpp create mode 100644 HTTPServer/thread_pool.h create mode 100644 HTTPServer/webfront.cpp create mode 100644 HTTPServer/webfront.h create mode 100644 HTTPServer/xmldoc.cpp create mode 100644 HTTPServer/xmldoc.h create mode 100644 HTTPServer/xmldoc_attr.cpp create mode 100644 HTTPServer/xmldoc_attr.h create mode 100644 HTTPServer/xmldoc_c_data_section.h create mode 100644 HTTPServer/xmldoc_character_data.cpp create mode 100644 HTTPServer/xmldoc_character_data.h create mode 100644 HTTPServer/xmldoc_comment.h create mode 100644 HTTPServer/xmldoc_document.cpp create mode 100644 HTTPServer/xmldoc_document.h create mode 100644 HTTPServer/xmldoc_document_fragment.h create mode 100644 HTTPServer/xmldoc_document_type.cpp create mode 100644 HTTPServer/xmldoc_document_type.h create mode 100644 HTTPServer/xmldoc_dom_exception.h create mode 100644 HTTPServer/xmldoc_dom_implementation.cpp create mode 100644 HTTPServer/xmldoc_dom_implementation.h create mode 100644 HTTPServer/xmldoc_element.cpp create mode 100644 HTTPServer/xmldoc_element.h create mode 100644 HTTPServer/xmldoc_entity_reference.h create mode 100644 HTTPServer/xmldoc_named_node_map.cpp create mode 100644 HTTPServer/xmldoc_named_node_map.h create mode 100644 HTTPServer/xmldoc_node.cpp create mode 100644 HTTPServer/xmldoc_node.h create mode 100644 HTTPServer/xmldoc_node_list.h create mode 100644 HTTPServer/xmldoc_processing_instruction.h create mode 100644 HTTPServer/xmldoc_text.cpp create mode 100644 HTTPServer/xmldoc_text.h diff --git a/HTTPServer/HTTPServer.cpp b/HTTPServer/HTTPServer.cpp new file mode 100644 index 00000000..be070d02 --- /dev/null +++ b/HTTPServer/HTTPServer.cpp @@ -0,0 +1,21 @@ +// HTTPServer.cpp : Defines the entry point for the console application. +// +#include "webfront.h" +#include "page.h" +#include + + + +int main(int argc, char* argv[]) +{ + { + WebFront::Site my_site("1600"); + auto index_page = my_site.CreatePage("index.html"); + + + std::cout << "Press Return to quit" << std::endl; std::cin.get(); + } + std::cout << "Press Return to quit" << std::endl; std::cin.get(); + return 0; +} + diff --git a/HTTPServer/HTTPServer.vcxproj b/HTTPServer/HTTPServer.vcxproj new file mode 100644 index 00000000..fabaa9c4 --- /dev/null +++ b/HTTPServer/HTTPServer.vcxproj @@ -0,0 +1,132 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56} + Win32Proj + HTTPServer + + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + true + + + false + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + + + Console + true + + + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/HTTPServer/HTTPServer.vcxproj.filters b/HTTPServer/HTTPServer.vcxproj.filters new file mode 100644 index 00000000..06d635a2 --- /dev/null +++ b/HTTPServer/HTTPServer.vcxproj.filters @@ -0,0 +1,144 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/HTTPServer/ReadMe.txt b/HTTPServer/ReadMe.txt new file mode 100644 index 00000000..d2087a53 --- /dev/null +++ b/HTTPServer/ReadMe.txt @@ -0,0 +1,40 @@ +======================================================================== + CONSOLE APPLICATION : HTTPServer Project Overview +======================================================================== + +AppWizard has created this HTTPServer application for you. + +This file contains a summary of what you will find in each of the files that +make up your HTTPServer application. + + +HTTPServer.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +HTTPServer.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +HTTPServer.cpp + This is the main application source file. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named HTTPServer.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/HTTPServer/http_connexion.cpp b/HTTPServer/http_connexion.cpp new file mode 100644 index 00000000..2bb59cdb --- /dev/null +++ b/HTTPServer/http_connexion.cpp @@ -0,0 +1,155 @@ +#include "http_connexion.h" +#include "http_request.h" +#include +#include +#include + +#include +#include + +class HTTPConnexion::Impl : public SocketHelper +{ +public: + Impl(SocketType socket) : socket_(socket) + { + // Test(); + + { // Add connexion to connexions list + std::unique_lock(connexions_mutex); + connexions.push_back(std::unique_ptr(this)); + } + } + + void Disconnect() + { + Shutdown(socket_); + CloseSocket(socket_); + { // Remove this connexion from connexions list + std::unique_lock(connexions_mutex); + connexions.remove_if([this](std::unique_ptr& cnx) { return cnx.get() == this; }); + } + } + + static void CloseAllConnexions() + { + std::unique_lock(connexions_mutex); + while (!connexions.empty()) + { + connexions.front()->Disconnect(); + } + } + + void Serve() + { +// std::cout << "thread:" << std::this_thread::get_id() << " Serve" << std::endl; + + int received_bytes; + + send(socket_, "SERVER OK\r\n", 11, 0); + + HTTPRequest request; + while ((received_bytes = recv(socket_, request.GetBuffer(), request.GetBufferSize(), 0)) > 0) + { + //std::cout << "Recv " << received_bytes << std::endl; + //HexDump(buffer.data(), received_bytes); + request.GetBuffer()[received_bytes] = 0; + + request.ParseData(received_bytes); + if (request.HeaderIsComplete()) + { + switch (request.method()) + { + case HTTPRequest::kGet: + std::cout << "Method GET on url " << request.url() << std::endl; + std::cout << " host : " << request.host() << std::endl; + break; + case HTTPRequest::kHead: + std::cout << "Method HEAD" << std::endl; + break; + } + } + + + } + std::cout << "thread:" << std::this_thread::get_id() << " Serve ended" << std::endl; + + Disconnect(); + } + + void Test() + { + HTTPRequest request; + std::string test_header = "GET /myurl HTTP/1.1\r\nHost:1\r\nUser-Agent:2\r\n 0\r\n\r\n"; + + char* buffer = request.GetBuffer(); + for (auto c : test_header) + *buffer++ = c; + + request.ParseData(test_header.length()); + if (HTTPRequest::kGet == request.method()) std::cout << "GET ok" << std::endl; else std::cout << "GET no" << std::endl; + std::cout << "Url:" << request.url() << std::endl; + std::cout << "Host:" << request.host() << std::endl; + std::cout << "User-Agent:" << request.user_agent() << std::endl; + } + +private: + SocketType socket_; + + static std::list> connexions; //< List all connections + static std::mutex connexions_mutex; + +private: + static void HexDump(void* data, unsigned int bytes) + { + char *parser, *last=reinterpret_cast(data); + parser = last; + last += bytes; + + char output_line[] = " | ................"; + + for (; parser<=last; parser+=16) + { + for (unsigned int charac=0; charac<16; charac++) + { + if (parser+charac < last) + { + char towrite = parser[charac]; + if ((towrite>>4)<10) + output_line[charac*3] = (towrite>>4) + 48; + else + output_line[charac*3] = (towrite>>4) + 55; + if ((towrite%16)<10) + output_line[charac*3+1] = (towrite%16) + 48; + else + output_line[charac*3+1] = (towrite%16) + 55; + if (towrite>31) + { + output_line[51+charac] = towrite; + } + else + { + output_line[51+charac] = '.'; + } + } + else + { + output_line[charac*3] = '.'; + output_line[charac*3+1] = '.'; + output_line[51+charac] = '.'; + } + } + std::cout << std::setw(8) << std::setfill('0') << std::hex << reinterpret_cast(parser); + std::cout << " " << output_line << std::endl; + } + } +}; + + +HTTPConnexion::HTTPConnexion(SocketType socket) : pimpl_(new Impl(socket)) {} +HTTPConnexion::~HTTPConnexion() {} +void HTTPConnexion::Serve() { pimpl_->Serve(); } +void HTTPConnexion::CloseAllConnexions() { Impl::CloseAllConnexions(); } + +std::list> HTTPConnexion::Impl::connexions; +std::mutex HTTPConnexion::Impl::connexions_mutex; + diff --git a/HTTPServer/http_connexion.h b/HTTPServer/http_connexion.h new file mode 100644 index 00000000..4206cdb2 --- /dev/null +++ b/HTTPServer/http_connexion.h @@ -0,0 +1,20 @@ +#ifndef __HTTP_CONNEXION_H_ +#define __HTTP_CONNEXION_H_ +#include +#include "socket_helper.h" + + +class HTTPConnexion +{ +public: + HTTPConnexion(SocketType socket); + ~HTTPConnexion(); + void Serve(); //< Connexion main loop + static void CloseAllConnexions(); //< Close all open HTTPConnexions sockets + +private: + class Impl; + std::unique_ptr pimpl_; +}; + +#endif //__HTTP_CONNEXION_H_ \ No newline at end of file diff --git a/HTTPServer/http_request.cpp b/HTTPServer/http_request.cpp new file mode 100644 index 00000000..34447623 --- /dev/null +++ b/HTTPServer/http_request.cpp @@ -0,0 +1,356 @@ +#include "http_request.h" +#include +#include +#include +#include + +#define HT 9 +#define SP ' ' +#define CR '\r' +#define LF '\n' +#define AFFECT ':' + +class HTTPRequest::Impl +{ +private: + enum HeaderField; + +public: + Impl() + { + Reinitialize(); + } + + void Reinitialize() + { + set_method(kUndefined); + set_parse_status(kUnparsed); + set_connection_keepalive(true); + buffer_parser_ = buffer_.data(); + buffer_end_ = buffer_parser_; + } + + bool ParseData(size_t bytes) + { + static char* affect_sign=nullptr; + + if (kUnparsed == parse_status()) + { + // Find end of first line (CRLF) + while (LF != *buffer_end_) + { + if (0 == bytes) // if there is no more data to parse before CRLF, that means + return true; // that we get to wait for more data (in the next call to ParseData) + --bytes; + buffer_end_++; + } + + + if (CR == buffer_end_[-1]) + { + // CRLF found : we have a first header line. Let's fine the method + switch (buffer_parser_[0]) + { + case 'G': + if (('E' == buffer_parser_[1]) && ('T' == buffer_parser_[2])) + { + set_method(kGet); + set_parse_status(kMethodParsed); + buffer_parser_+=3;; + }; + break; + case 'H': + if (('E' == buffer_parser_[1]) && ('A' == buffer_parser_[2]) && ('D' == buffer_parser_[3])) + { + set_method(kHead); + set_parse_status(kMethodParsed); + buffer_parser_+=4;; + } + break; + } + + // if no method had been recognized, we return and ask for connection termination + if (kMethodParsed != parse_status()) + return false; + + // Extract URL + while (SP == *buffer_parser_ || HT == *buffer_parser_) + ++buffer_parser_; + while (SP != *buffer_parser_ && HT != *buffer_parser_) + { + url_.append(buffer_parser_, 1); + ++buffer_parser_; + } + + // Extract HTTP version + while (SP == *buffer_parser_ || HT == *buffer_parser_) + ++buffer_parser_; + while (SP != *buffer_parser_ && HT != *buffer_parser_ && buffer_parser_<(buffer_end_-1)) + { + http_version_.append(buffer_parser_, 1); + ++buffer_parser_; + } + + buffer_parser_ = buffer_end_; + set_parse_status(kMethodLineParsed); + } + } + + while (kMethodLineParsed == parse_status()) + { + while (LF != *buffer_end_) + { + if (0 == bytes) return true; + if (nullptr == affect_sign) + { + if (AFFECT == *buffer_end_) affect_sign = buffer_end_; + } + --bytes; + buffer_end_++; + } + if (CR == buffer_end_[-1]) + { + // if the completed line begins with a space character then it is + // the continuation of the precedent affection. + if ((SP == *buffer_parser_) || (HT == *buffer_parser_)) + { + ++buffer_parser_; + while (SP == *buffer_parser_ || HT == *buffer_parser_) // remove leading spaces + ++buffer_parser_; + + AffectFieldValue(last_header_field_, buffer_parser_, buffer_end_-1); + } + else + // If the completed line has a ':', then we can extract the field association + if (nullptr != affect_sign) + { + ExtractAssociation(buffer_parser_, affect_sign, buffer_end_-1); + affect_sign = nullptr; + } + + + if (LF == buffer_end_[-2] && CR == buffer_end_[-3]) + { + // CRLFCRLF found : the header is completely parsed + set_parse_status(kHeaderParsed); + return true; + } + + ++buffer_end_; + buffer_parser_ = buffer_end_; + } + else + { + // CR missing : we abort the connection + return false; + } + } + return true; + } + + void ExtractAssociation(const char* begin, const char* affect_sign, const char* end) + { + std::string name, value; + const char* end_name = affect_sign; + while ((SP == *begin) || (HT == *begin)) ++begin; // Remove leading spaces + while ((SP == *end_name) || (HT == *end_name)) --end_name; // Remove trailing spaces + name.append(begin, end_name); + + const char* begin_value = affect_sign + 1; + while ((SP == *begin_value) || (HT == *begin_value)) ++begin_value; // Remove leading spaces + while ((SP == *end) || (HT == *end)) --end; // Remove trailing spaces + value.append(begin_value, end); + +// for (auto& c : name) if (c>='A'&& c<='Z') c-='A'-'a'; // Convert name to lowercase + + + + + switch (name[0]) + { + case 'A': // Accept, Accept-encoding, Accept-language, Accept-charset, Authorization + if (name.length()>=6) + { + switch (name[1]) + { + case 'c': + if (0 == name.compare(2, 4, "cept")) + { + if (6 ==name.length()) last_header_field_ = kAccept; + else + { + if (0 == name.compare(6, 9, "-encoding")) last_header_field_ = kAccept_encoding; + else + if (0 == name.compare(6, 9, "-language")) last_header_field_ = kAccept_language; + else + if (0 == name.compare(6, 8, "-charset")) last_header_field_ = kAccept_charset; + } + } + break; + + case 'u': + if (0 == name.compare(2, 11, "thorization")) last_header_field_ = kAuthorization; + break; + } + } + break; + + case 'C': // Connection, Cookie + if (0 == name.compare(1, 9, "onnection")) last_header_field_ = kConnection; + else + if (0 == name.compare(1, 5, "ookie")) last_header_field_ = kCookie; + else + if (0 == name.compare(1, 12, "ache-Control")) last_header_field_ = kCache_Control; + break; + + case 'H': // Host + if (0 == name.compare(1, 3, "ost")) last_header_field_ = kHost; + break; + + case 'R': // Referer + if (0 == name.compare(1, 6, "eferer")) last_header_field_ = kReferer; + break; + + case 'U': // Upgrade, User-agent + if (0 == name.compare(1, 6, "pgrade")) last_header_field_ = kUpgrade; + else + if (0 == name.compare(1, 9, "ser-Agent")) last_header_field_ = kUser_Agent; + break; + } + + AffectFieldValue(last_header_field_, begin_value, end); +// std::cout << "ExtractAssociation : " << name << " -> " << value << std::endl; + } + + void AffectFieldValue(HeaderField field, const char* value_begin, const char* value_end) + { + switch (field) + { + case kNone: + break; + case kAccept: + accept_.append(value_begin, value_end); + break; + case kAccept_encoding: + accept_encoding_.append(value_begin, value_end); + break; + case kAccept_language: + accept_language_.append(value_begin, value_end); + break; + case kAccept_charset: + accept_charset_.append(value_begin, value_end); + break; + case kAuthorization: + authorization_.append(value_begin, value_end); + break; + case kConnection: + if ('c' == *value_begin) // close + set_connection_keepalive(false); + break; + case kCookie: + cookie_.append(value_begin, value_end); + break; + case kCache_Control: + cache_control_.append(value_begin, value_end); + break; + case kHost: + host_.append(value_begin, value_end); + break; + case kReferer: + referer_.append(value_begin, value_end); + break; + case kUpgrade: + upgrade_.append(value_begin, value_end); + break; + case kUser_Agent: + user_agent_.append(value_begin, value_end); + break; + } + } + + bool HeaderIsComplete() const { return parse_status() >= kHeaderParsed; } + char* GetBuffer() { return buffer_end_; } + size_t GetBufferSize() const { return buffer_.size(); } + Method method() const { return method_; } + + const std::string& url() const { return url_; } + const std::string& host() const { return host_; } + const std::string& user_agent() const { return user_agent_; } + const std::string& accept() const { return accept_; } + const std::string& accept_encoding() const { return accept_encoding_; } + const std::string& accept_language() const { return accept_language_; } + const std::string& accept_charset() const { return accept_charset_; } + const std::string& authorization() const { return authorization_; } + const std::string& cache_control() const { return cache_control_; } + const std::string& cookie() const { return cookie_; } + const std::string& referer() const { return referer_; } + const std::string& upgrade() const { return upgrade_; } + bool connection_keepalive() const { return connection_keepalive_; } + +private: + enum ParseStatus; + + void set_method(Method method) { method_ = method; } + void set_parse_status(ParseStatus status) { parse_status_ = status; } + void set_connection_keepalive(bool keep) { connection_keepalive_ = keep; } + ParseStatus parse_status() const { return parse_status_; } + + + // Request header data + Method method_; + std::string url_; + std::string http_version_; + std::string host_; + std::string user_agent_; + std::string accept_; + std::string accept_encoding_; + std::string accept_language_; + std::string accept_charset_; + std::string authorization_; + std::string cache_control_; + std::string cookie_; + std::string referer_; + std::string upgrade_; + bool connection_keepalive_; + +private: + enum ParseStatus + { + kUnparsed = 1, kMethodParsed, kMethodLineParsed, kHeaderParsed, kContentParsed + } parse_status_; + + enum HeaderField + { + kNone, kAccept, kAccept_encoding, kAccept_language, kAccept_charset, kAuthorization, + kCache_Control, kConnection, kCookie, kHost, kReferer, kUpgrade, kUser_Agent + }; + + + + static const unsigned int kReceiveBufferSize = 16384; + std::array buffer_; + char* buffer_end_; //< First unfilled character in the buffer + char* buffer_parser_; //< Next character to be parsed + HeaderField last_header_field_; +}; + +HTTPRequest::HTTPRequest() : pimpl_(new Impl()) {} +HTTPRequest::~HTTPRequest() {}; +void HTTPRequest::Reinitialize() { pimpl_->Reinitialize(); } +bool HTTPRequest::ParseData(size_t bytes) { return pimpl_->ParseData(bytes); } +bool HTTPRequest::HeaderIsComplete() const { return pimpl_->HeaderIsComplete(); } +char* HTTPRequest::GetBuffer() { return pimpl_->GetBuffer(); } +size_t HTTPRequest::GetBufferSize() const { return pimpl_->GetBufferSize(); } +HTTPRequest::Method HTTPRequest::method() const { return pimpl_->method(); } +const std::string& HTTPRequest::url() const { return pimpl_->url(); } +const std::string& HTTPRequest::host() const { return pimpl_->host(); } +const std::string& HTTPRequest::user_agent() const { return pimpl_->user_agent(); } +const std::string& HTTPRequest::accept_encoding() const { return pimpl_->accept_encoding(); } +const std::string& HTTPRequest::accept_language() const { return pimpl_->accept_language(); } +const std::string& HTTPRequest::accept_charset() const { return pimpl_->accept_charset(); } +const std::string& HTTPRequest::authorization() const { return pimpl_->authorization(); } +const std::string& HTTPRequest::cache_control() const { return pimpl_->cache_control(); } +const std::string& HTTPRequest::cookie() const { return pimpl_->cookie(); } +const std::string& HTTPRequest::referer() const { return pimpl_->referer(); } +const std::string& HTTPRequest::upgrade() const { return pimpl_->upgrade(); } +bool HTTPRequest::connection_keepalive() const { return pimpl_->connection_keepalive(); } diff --git a/HTTPServer/http_request.h b/HTTPServer/http_request.h new file mode 100644 index 00000000..f4d094cf --- /dev/null +++ b/HTTPServer/http_request.h @@ -0,0 +1,42 @@ +#ifndef __HTTP_REQUEST_H_ +#define __HTTP_REQUEST_H_ + +#include +#include + +class HTTPRequest +{ +public: + enum Method + { + kUndefined, kGet, kHead + }; + +public: + HTTPRequest(); + ~HTTPRequest(); + void Reinitialize(); + bool ParseData(size_t bytes); //< Parse newly received data. Return false if there is a non-recoverable parse error. + bool HeaderIsComplete() const; //< Returns true if a complete header has been parsed + char* GetBuffer(); + size_t GetBufferSize() const; + Method method() const; + const std::string& url() const; + const std::string& host() const; + const std::string& user_agent() const; + const std::string& accept_encoding() const; + const std::string& accept_language() const; + const std::string& accept_charset() const; + const std::string& authorization() const; + const std::string& cache_control() const; + const std::string& cookie() const; + const std::string& referer() const; + const std::string& upgrade() const; + bool connection_keepalive() const; + +private: + class Impl; + std::unique_ptr pimpl_; +}; + +#endif \ No newline at end of file diff --git a/HTTPServer/page.h b/HTTPServer/page.h new file mode 100644 index 00000000..516c044b --- /dev/null +++ b/HTTPServer/page.h @@ -0,0 +1,29 @@ +#ifndef __WEBFRONT_PAGE_H_ +#define __WEBFRONT_PAGE_H_ + +#include +#include + +namespace WebFront +{ +class Site; + +class Page +{ +public: + Page(std::string page_name) : page_name_(page_name) + { + } + + /* + Create + */ + const std::vector& Render(); + +public: + std::string page_name_; +}; + +} + +#endif //__WEBFRONT_PAGE_H_ \ No newline at end of file diff --git a/HTTPServer/socket_helper.h b/HTTPServer/socket_helper.h new file mode 100644 index 00000000..5f16be8f --- /dev/null +++ b/HTTPServer/socket_helper.h @@ -0,0 +1,44 @@ +#ifndef __SOCKET_HELPER_H_ +#define __SOCKET_HELPER_H_ + +#ifdef WIN32 +#include +#include +#pragma comment(lib, "Ws2_32.lib") +typedef SOCKET SocketType; +class SocketHelper +{ +public: + static const SocketType kInvalidSocket = INVALID_SOCKET; + + static bool InitializeLib() + { + WSADATA wsa_data; + int init_value = WSAStartup(MAKEWORD(2, 2), &wsa_data); + return init_value == 0; + } + + static void CleanupLib() { WSACleanup(); } + static void CloseSocket(SocketType socket) { closesocket(socket); } + static void Shutdown(SocketType socket) { shutdown(socket, SD_BOTH); } +}; +#else +#include +#include +#include +#include + +typedef int SocketType; +class SocketHelper +{ +public: + static const SocketType kInvalidSocket = -1; + + static bool InitializeLib() { return true; } + static void CleanupLib() {} + static void CloseSocket(SocketType socket) { close(socket); } + static void Shutdown(SocketType socket) { shutdown(socket, SHUT_RDWR); } +}; + +#endif +#endif //__SOCKET_HELPER_H_ \ No newline at end of file diff --git a/HTTPServer/socket_server.cpp b/HTTPServer/socket_server.cpp new file mode 100644 index 00000000..a3171e08 --- /dev/null +++ b/HTTPServer/socket_server.cpp @@ -0,0 +1,143 @@ +#include "socket_server.h" +#include +#include +#include + +#include "socket_helper.h" +#include "thread_pool.h" +#include "http_request.h" +#include "http_connexion.h" + + +class SocketServer::Impl : public SocketHelper +{ +public: + Impl(int port) : server_status_(kUninitialized), server_info_(nullptr) + { + InitializeSocket(std::to_string(port)); + } + + Impl(std::string protocol) : server_status_(kUninitialized), server_info_(nullptr) + { + InitializeSocket(protocol); + } + + ~Impl() + { + freeaddrinfo(server_info_); + CleanupLib(); + } + + bool Start() + { + if (nullptr == server_info_) + return false; + listening_socket_ = socket(server_info_->ai_family, server_info_->ai_socktype, server_info_->ai_protocol); + if (kInvalidSocket == listening_socket_) + return false; + + if (0 != bind(listening_socket_, server_info_->ai_addr, server_info_->ai_addrlen)) + return false; + + if (0 != listen(listening_socket_, SOMAXCONN)) + return false; + + listening_ = true; + listening_thread_ = std::thread(&Impl::ListenLoop, this); + set_server_status(kStarted); + return true; + } + + void Stop() + { + Shutdown(listening_socket_); + + listening_ = false; + CloseSocket(listening_socket_); + std::cout << "socket closed" << std::endl; + listening_thread_.join(); + std::cout << "thread joined" << std::endl; + set_server_status(kStopped); + } + + ServerStatus server_status() const { return server_status_; } + +private: + void InitializeSocket(std::string protocol) + { + set_server_status(kUninitialized); + listening_ = false; + if (!InitializeLib()) + { + set_server_status(kInitializationFailed); + return; + } + + int status; + addrinfo hints = {}; + + hints.ai_family = AF_UNSPEC; // don't care IPv4 or IPv6 + hints.ai_socktype = SOCK_STREAM; // TCP stream sockets + hints.ai_flags = AI_PASSIVE; // Fill my IP for me + status = getaddrinfo(nullptr, protocol.c_str(), &hints, &server_info_); + + if (0 != status) + { + set_server_status(kInitializationFailed); + return; + } + + set_server_status(kInitialized); + } + + void set_server_status(ServerStatus status) + { + const char* nom[] = { "Uninitialized", "InitializationFailed", "Initialized", "Started", "Stopped" }; + server_status_ = status; + std::cout << "server_status changed to " << nom[status] << std::endl; + } + + void ListenLoop() + { + std::cout << "ListenLoop started" << std::endl; + sockaddr_storage client_addr; + socklen_t client_addr_size; + SocketType client_socket; + + ThreadPool thread_pool; + + client_addr_size = sizeof client_addr; + while (listening_) + { + client_socket = accept(listening_socket_, reinterpret_cast(&client_addr), &client_addr_size); + if (kInvalidSocket == client_socket) + { + std::cout << "Erreur socket" << std::endl; + } + else + { + HTTPConnexion* connexion = new HTTPConnexion(client_socket); + std::function myfunc = std::bind(&HTTPConnexion::Serve, connexion); + thread_pool.EnqueueTask(myfunc); + } + } + HTTPConnexion::CloseAllConnexions(); + std::cout << "ListenLoop end" << std::endl; + } + +private: + addrinfo *server_info_; //< Listening socket address structure + ServerStatus server_status_; + SocketType listening_socket_; + std::thread listening_thread_; + bool listening_; //< Is the listening loop started ? + +}; + + +SocketServer::SocketServer(int port) : pimpl_(new Impl(port)) {} +SocketServer::SocketServer(std::string protocol) : pimpl_(new Impl(protocol)) {} +SocketServer::~SocketServer() {} +bool SocketServer::Start() { return pimpl_->Start(); } +void SocketServer::Stop() { return pimpl_->Stop(); } +SocketServer::ServerStatus SocketServer::server_status() const { return pimpl_->server_status(); } diff --git a/HTTPServer/socket_server.h b/HTTPServer/socket_server.h new file mode 100644 index 00000000..18988b98 --- /dev/null +++ b/HTTPServer/socket_server.h @@ -0,0 +1,34 @@ +#ifndef __SOCKET_SERVER_H_ +#define __SOCKET_SERVER_H_ + +#include +#include + + +class SocketServer +{ +public: + enum ServerStatus + { kUninitialized, + kInitializationFailed, + kInitialized, + kStarted, + kStopped }; + +public: + SocketServer(int port); + SocketServer(std::string protocol); + ~SocketServer(); + + bool Start(); + void Stop(); + ServerStatus server_status() const; + +private: + class Impl; + std::unique_ptr pimpl_; +}; + + + +#endif //__SOCKET_SERVER_H_ \ No newline at end of file diff --git a/HTTPServer/thread_pool.cpp b/HTTPServer/thread_pool.cpp new file mode 100644 index 00000000..2a330c92 --- /dev/null +++ b/HTTPServer/thread_pool.cpp @@ -0,0 +1,80 @@ +#include "thread_pool.h" +#include +#include +#include +#include +#include +#include + +class ThreadPool::Impl +{ +public: + Impl(size_t number_of_threads) : running_(true) + { + for (size_t thread =0; thread < number_of_threads; ++thread) + workers_.push_back(std::thread(&Impl::Worker, this)); + } + + ~Impl() + { + std::cout << "ThreadPool destructor" << std::endl; + running_ = false; + tasks_condition_.notify_all(); + + // Wait for threads termination + for (auto &thread : workers_) + { + thread.join(); + } + } + + template void EnqueueTask(Function function) + { + { + std::unique_lock lock(tasks_mutex_); + tasks_.push_back(std::function(function)); + } + tasks_condition_.notify_one(); + } + +private: + bool running_; + std::vector workers_; //< workers threads + std::deque> tasks_; //< task queue + std::mutex tasks_mutex_; + std::condition_variable tasks_condition_; + +private: + void Worker() + { + std::function task; + while (running_) + { + { + // acquire a lock for the condition variable + std::unique_lock lock(tasks_mutex_); + + // wait for a new task (in a loop in case of spurious wakeup) + while (tasks_.empty() && running_) + tasks_condition_.wait(lock); + + if (running_) + { + task = tasks_.front(); + tasks_.pop_front(); + } + } + if (running_) + { + task(); + } + } + } +}; + +ThreadPool::ThreadPool(size_t number_of_threads) : pimpl_(new Impl(number_of_threads)) {} +ThreadPool::ThreadPool() : pimpl_(new Impl(std::thread::hardware_concurrency())) {} +ThreadPool::~ThreadPool() {} +template void ThreadPool::EnqueueTask(Function function) { pimpl_->EnqueueTask(function); } + +template void ThreadPool::EnqueueTask(std::function); diff --git a/HTTPServer/thread_pool.h b/HTTPServer/thread_pool.h new file mode 100644 index 00000000..a9e3a1a1 --- /dev/null +++ b/HTTPServer/thread_pool.h @@ -0,0 +1,19 @@ +#ifndef __THREAD_POOL_H_ +#define __THREAD_POOL_H_ +#include + +class ThreadPool +{ +public: + ThreadPool( size_t number_of_threads); + ThreadPool(); //< Create a thread pool with the maximum number of concurrent threads supported by the hardware + ~ThreadPool(); + template void EnqueueTask(Function function); + +private: + class Impl; + std::unique_ptr pimpl_; +}; + + +#endif //__THREAD_POOL_H_ \ No newline at end of file diff --git a/HTTPServer/webfront.cpp b/HTTPServer/webfront.cpp new file mode 100644 index 00000000..3d0a4c45 --- /dev/null +++ b/HTTPServer/webfront.cpp @@ -0,0 +1,79 @@ +#include + +#include "webfront.h" +#include "socket_server.h" + + +#define HTTP_PROTOCOL "http" +namespace WebFront +{ + +class Site::Impl +{ +public: + template Impl(Protocol protocol) : server_(protocol) + { + server_.Start(); + } + + std::shared_ptr CreatePage(const std::string page_name) + { + std::shared_ptr new_page = std::make_shared(page_name); + pages_.insert(PagesMap::value_type(page_name, new_page)); + return new_page; + } + + std::shared_ptr GetPage(const std::string page_name) const + { + const auto page = pages_.find(page_name); + if (pages_.end() == page) + { + return nullptr; + } + return page->second; + } + + std::shared_ptr RemovePage(const std::string page_name) + { + auto page = pages_.find(page_name); + if (pages_.end() == page) + { + return nullptr; + } + pages_.erase(page); + return page->second; + } + +private: + +private: + SocketServer server_; + typedef std::unordered_map> PagesMap; + PagesMap pages_; +}; + +Site::Site() : pimpl_(new Impl(HTTP_PROTOCOL)) { } +Site::Site(unsigned int port) : pimpl_(new Impl(port)) {} +Site::Site(std::string protocol) : pimpl_(new Impl(protocol)) {} +Site::~Site() {} + +/** Creates a new Page and returns a pointer on it. + * If the page_name already exist, the Page is created but not linked to the site. + * \param[in] page_name name/path of the Page + * \return The created Page + */ +std::shared_ptr Site::CreatePage(const std::string page_name) { return pimpl_->CreatePage(page_name); } + +/** Get a Page from Site. A pointer on the page is returned. + * \param[in] page_name name/path of the Page + * \return The removed Page. nullptr if page_name doesn't exist. + */ +std::shared_ptr Site::GetPage(const std::string page_name) { return pimpl_->GetPage(page_name); } + +/** Removes a Page from Site. A pointer on the removed page is returned. + * \param[in] page_name name/path of the Page + * \return The removed Page. nullptr if page_name doesn't exist. + */ +std::shared_ptr Site::RemovePage(const std::string page_name) { return pimpl_->RemovePage(page_name); } + +} \ No newline at end of file diff --git a/HTTPServer/webfront.h b/HTTPServer/webfront.h new file mode 100644 index 00000000..190eb2a3 --- /dev/null +++ b/HTTPServer/webfront.h @@ -0,0 +1,28 @@ +#ifndef __WEBFRONT_SITE_H_ +#define __WEBFRONT_SITE_H_ + +#include +#include + +#include "page.h" + +namespace WebFront +{ +class Site +{ +public: + Site(); + Site(unsigned int port); + Site(std::string protocol); + ~Site(); + + std::shared_ptr CreatePage(const std::string page_name); + std::shared_ptr GetPage(const std::string page_name); + std::shared_ptr RemovePage(const std::string page_name); + +private: + class Impl; + std::unique_ptr pimpl_; +}; +} +#endif //__WEBFRONT_H_ diff --git a/HTTPServer/xmldoc.cpp b/HTTPServer/xmldoc.cpp new file mode 100644 index 00000000..fbb74ee3 --- /dev/null +++ b/HTTPServer/xmldoc.cpp @@ -0,0 +1,33 @@ +#include "xmldoc.h" + +namespace WebFront { namespace XMLDoc +{ + + + + + + + +/*void Traverse() +{ + auto node = getFirstChild(); + while (nullptr != node) + { + // std::cout << node.getNodeName() << " = " << std::getNodeValue()); + + if (node->hasChildNodes()) + { + node = node->getFirstChild(); + } + else + { // leaf + // Get to the parent level + while (nullptr == node->getNextSibling() && node.get() != this) + node = node->getParentNode(); + node = node->getNextSibling(); + } + } +} +*/ +}} \ No newline at end of file diff --git a/HTTPServer/xmldoc.h b/HTTPServer/xmldoc.h new file mode 100644 index 00000000..59cf8310 --- /dev/null +++ b/HTTPServer/xmldoc.h @@ -0,0 +1,34 @@ +#ifndef __WEBFRONT_XMLDOC_H_ +#define __WEBFRONT_XMLDOC_H_ + +#include +#include +#include +#include +#include +#include + +#include "xmldoc_attr.h" +#include "xmldoc_character_data.h" +#include "xmldoc_comment.h" +#include "xmldoc_document.h" +#include "xmldoc_document_fragment.h" +#include "xmldoc_document_type.h" +#include "xmldoc_dom_exception.h" +#include "xmldoc_element.h" +#include "xmldoc_named_node_map.h" +#include "xmldoc_node.h" +#include "xmldoc_node_list.h" + + + +namespace WebFront { namespace XMLDoc { + +class XMLDoc +{ +public: + +}; + +}} +#endif //__WEBFRONT_XMLDOC_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_attr.cpp b/HTTPServer/xmldoc_attr.cpp new file mode 100644 index 00000000..113466a3 --- /dev/null +++ b/HTTPServer/xmldoc_attr.cpp @@ -0,0 +1,52 @@ +#include "xmldoc_attr.h" + +namespace WebFront { namespace XMLDoc { + +Attr::Attr() : Node(ATTRIBUTE_NODE) +{ +} + +/** + * Returns the name of this attribute. + * @return The name of this attribute. + */ +const std::string& Attr::getName() const +{ + return getNodeName(); +} + + +/** + * Tells if the attribute value has been specified in the original + * document. + * @return true if the attribute has an assigned value + * in the Document (and the value is the assigned value). + * false if the attribute value came from the default + * value declared in the Document's DTD. + */ +bool Attr::getSpecified() +{ + return specified_; +} + + +const std::string& Attr::getValue() const +{ + return getNodeValue(); +} + + +void Attr::setValue(const std::string& value) +{ + setNodeValue(value); +} + + +std::shared_ptr Attr::getOwnerElement() const +{ + // NOT IMPLEMENTED + return nullptr; +} + + +}} \ No newline at end of file diff --git a/HTTPServer/xmldoc_attr.h b/HTTPServer/xmldoc_attr.h new file mode 100644 index 00000000..c982e4dd --- /dev/null +++ b/HTTPServer/xmldoc_attr.h @@ -0,0 +1,27 @@ +#ifndef __WEBFRONT_XMLDOC_ATTR_H_ +#define __WEBFRONT_XMLDOC_ATTR_H_ + +#include "xmldoc_node.h" +#include "xmldoc_element.h" + +namespace WebFront { namespace XMLDoc { +class Attr : public Node +{ +public: + const std::string& getName() const; + bool getSpecified(); + const std::string& getValue() const; + void setValue(const std::string& value) throw(DOMException); + std::shared_ptr getOwnerElement() const; + +private: + std::shared_ptr ownerElement_; // The Element node this attribute is attached to. + bool specified_; // True if the attribute has an assigned value in the Document. + +protected: + Attr(); + friend class Document; +}; + +}} +#endif // __WEBFRONT_XMLDOC_ATTR_H_ diff --git a/HTTPServer/xmldoc_c_data_section.h b/HTTPServer/xmldoc_c_data_section.h new file mode 100644 index 00000000..2c0fe6f5 --- /dev/null +++ b/HTTPServer/xmldoc_c_data_section.h @@ -0,0 +1,14 @@ +#ifndef __WEBFRONT_XMLDOC_CDATA_SECTION_H_ +#define __WEBFRONT_XMLDOC_CDATA_SECTION_H_ + +#include "xmldoc_text.h" + +namespace WebFront { namespace XMLDoc { + +class CDATASection : public Text +{ +}; + + +}} +#endif // __WEBFRONT_XMLDOC_CDATA_SECTION_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_character_data.cpp b/HTTPServer/xmldoc_character_data.cpp new file mode 100644 index 00000000..f7588f7a --- /dev/null +++ b/HTTPServer/xmldoc_character_data.cpp @@ -0,0 +1,144 @@ +#include "xmldoc_character_data.h" + +namespace WebFront { namespace XMLDoc { + +/** + * Returns the character data of the node. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. + * @exception DOMException + */ +const std::string& CharacterData::getData() const +{ + return getNodeValue(); +} + + +/** + * Set the character data of the node. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. + * @exception DOMException + */ +void CharacterData::setData(const std::string& data) +{ + setNodeValue(data); +} + +/** + * The number of characters in the node. + */ +unsigned int CharacterData::getLength() const +{ + return nodeValue_.length(); +} + +/** + * Extracts a range of data from the node. + * @param[in] offset Offset of substring to extract. + * @param[in] count The number of characters to extract. + * @return The specified substring. + * @exception DOMException + * DOMSTRING_SIZE_ERR: Raised if the specified range of text does + * not fit into a DOMString. + */ +std::string CharacterData::substringData(unsigned int offset, unsigned int count) const +{ + try + { + return nodeValue_.substr(offset, count); + } + catch (std::out_of_range&) + { + throw DOMException(DOMException::DOMSTRING_SIZE_ERR, "offset out of range"); + } +} + +/** + * Appends the string to the end of the character data of the node. + * @param[in] arg The string to append. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ +void CharacterData::appendData(const std::string& arg) +{ + if (isReadOnly()) + throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "node is read only"); + nodeValue_.append(arg); +} + + +/** + * Inserts a string at the specified offset. + * @param[in] offset The offset at which to insert. + * @param[in] arg The string to insert. + * @exception DOMException + * INDEX_SIZE_ERR: Raised if the specified offset is + * greater than the number of characters in data. + * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ +void CharacterData::insertData(unsigned int offset, const std::string& arg) +{ + if (isReadOnly()) + { + throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "node is read only"); + } + try + { + nodeValue_.insert(offset, arg); + } + catch (std::out_of_range& ) + { + throw DOMException(DOMException::INDEX_SIZE_ERR, "offset out of range"); + } +} + +/** + * Removes a range of characters from the node. + * @param[in] offset The offset from which to start removing. + * @param[in] count The number of characters to delete. + * @exception DOMException + * INDEX_SIZE_ERR: Raised if the specified offset is + * greater than the number of characters in data. + * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ +void CharacterData::deleteData(unsigned int offset, unsigned int count) +{ + if (isReadOnly()) + throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "node is read only"); + try + { + nodeValue_.erase(offset, count); + } + catch (std::out_of_range&) + { + throw DOMException(DOMException::INDEX_SIZE_ERR, "offset out of range"); + } +} + +/** +* Replaces the characters specified by the given string. +* @param[in] offset The offset of the first character to be replaced. +* @param[in] count The number of characters to replace. +* @param[in] arg The other string that will be copied. +* @exception DOMException +* INDEX_SIZE_ERR: Raised if the specified offset is +* greater than the number of characters in data. +* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. +*/void CharacterData::replaceData(unsigned int offset, unsigned int count, const std::string& arg) +{ + if (isReadOnly()) + { + throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "node is read only"); + } + try + { + nodeValue_.replace(offset, count, arg); + } + catch (std::out_of_range&) + { + throw DOMException(DOMException::INDEX_SIZE_ERR, "offset out of range"); + } +} + +}} \ No newline at end of file diff --git a/HTTPServer/xmldoc_character_data.h b/HTTPServer/xmldoc_character_data.h new file mode 100644 index 00000000..2701d3be --- /dev/null +++ b/HTTPServer/xmldoc_character_data.h @@ -0,0 +1,28 @@ +#ifndef __WEBFRONT_XMLDOC_CHARACTER_DATA_H_ +#define __WEBFRONT_XMLDOC_CHARACTER_DATA_H_ + +#include "xmldoc_node.h" + +namespace WebFront { namespace XMLDoc { + +class CharacterData : public Node +{ +public: + + const std::string& getData() const; + void setData(const std::string& data) throw(DOMException); + unsigned int getLength() const; + std::string substringData(unsigned int offset, unsigned int count) const throw(DOMException); + void appendData(const std::string& arg); + void insertData(unsigned int offset, const std::string& arg) throw(DOMException); + void deleteData(unsigned int offset, unsigned int count) throw(DOMException); + void replaceData(unsigned int offset, unsigned int count, const std::string& arg) throw(DOMException); + +protected: + CharacterData(unsigned short nodeType) : Node(nodeType) {} + +}; + + +}} +#endif // __WEBFRONT_XMLDOC_CHARACTER_DATA_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_comment.h b/HTTPServer/xmldoc_comment.h new file mode 100644 index 00000000..f66b5792 --- /dev/null +++ b/HTTPServer/xmldoc_comment.h @@ -0,0 +1,18 @@ +#ifndef __WEBFRONT_XMLDOC_COMMENT_H_ +#define __WEBFRONT_XMLDOC_COMMENT_H_ + +#include "xmldoc_character_data.h" + +namespace WebFront { namespace XMLDoc +{ + +class Comment : public CharacterData +{ +protected: + Comment() : CharacterData(COMMENT_NODE) {} + friend class Document; + +}; + +}} +#endif // __WEBFRONT_XMLDOC_COMMENT_H_ diff --git a/HTTPServer/xmldoc_document.cpp b/HTTPServer/xmldoc_document.cpp new file mode 100644 index 00000000..4076ba8a --- /dev/null +++ b/HTTPServer/xmldoc_document.cpp @@ -0,0 +1,122 @@ +#include "xmldoc_document.h" +#include "xmldoc_attr.h" +#include "xmldoc_c_data_section.h" +#include "xmldoc_comment.h" +#include "xmldoc_document_fragment.h" +#include "xmldoc_document_type.h" +#include "xmldoc_dom_implementation.h" +#include "xmldoc_element.h" +#include "xmldoc_entity_reference.h" +#include "xmldoc_node_list.h" +#include "xmldoc_processing_instruction.h" +#include "xmldoc_text.h" + +namespace WebFront { namespace XMLDoc { + +std::shared_ptr Document::getDoctype() +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::shared_ptr Document::getImplementation() const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::shared_ptr Document::getDocumentElement() const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createElement(const std::string& tagName) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createDocumentFragment() const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createTextNode(const std::string& data) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createComment(const std::string& data) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createCDATASection(const std::string& data) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createProcessingInstruction( + const std::string& target, const std::string& data) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createAttribute(const std::string& name) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createEntityReference(const std::string& name) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::shared_ptr Document::getElementsByTagName(const std::string& tagname) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::shared_ptr Document::importNode(std::shared_ptr importedNode, bool deep) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createElementNS( + const std::string& namespaceURI, const std::string& qualifiedName) +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::unique_ptr Document::createAttributeNS( + const std::string& namespaceURI, const std::string& qualifiedName) +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::shared_ptr Document::getElementsByTagNameNS( + const std::string& namespaceURI, const std::string& localName) const +{ + // NOT IMPLEMENTED + return nullptr; +} + +std::shared_ptr Document::getElementById(const std::string& elementId) +{ + // NOT IMPLEMENTED + return nullptr; +} + +}} \ No newline at end of file diff --git a/HTTPServer/xmldoc_document.h b/HTTPServer/xmldoc_document.h new file mode 100644 index 00000000..ed6451c2 --- /dev/null +++ b/HTTPServer/xmldoc_document.h @@ -0,0 +1,54 @@ +#ifndef __WEBFRONT_XMLDOC_DOCUMENT_H_ +#define __WEBFRONT_XMLDOC_DOCUMENT_H_ + +#include "xmldoc_node.h" + +namespace WebFront { namespace XMLDoc { + +class DocumentType; +class DOMImplementation; +class Element; +class DocumentFragment; +class Text; +class Comment; +class CDATASection; +class ProcessingInstruction; +class Attr; +class EntityReference; +class NodeList; + +class Document : public Node +{ +public: + std::shared_ptr getDoctype(); + std::shared_ptr getImplementation() const; + std::shared_ptr getDocumentElement() const; + std::unique_ptr createElement(const std::string& tagName) const throw(DOMException); + std::unique_ptr createDocumentFragment() const; + std::unique_ptr createTextNode(const std::string& data) const; + std::unique_ptr createComment(const std::string& data) const; + std::unique_ptr createCDATASection(const std::string& data) const throw(DOMException); + std::unique_ptr createProcessingInstruction(const std::string& target, + const std::string& data) const throw(DOMException); + std::unique_ptr createAttribute(const std::string& name) const throw(DOMException); + std::unique_ptr createEntityReference(const std::string& name) const throw(DOMException); + std::shared_ptr getElementsByTagName(const std::string& tagname) const; + std::shared_ptr importNode(std::shared_ptr importedNode, bool deep) const throw(DOMException); + + std::unique_ptr createElementNS(const std::string& namespaceURI, + const std::string& qualifiedName) throw(DOMException); + std::unique_ptr createAttributeNS(const std::string& namespaceURI, + const std::string& qualifiedName) throw(DOMException); + std::shared_ptr getElementsByTagNameNS(const std::string& namespaceURI, + const std::string& localName) const; + std::shared_ptr getElementById(const std::string& elementId); + +protected: + Document() : Node(DOCUMENT_NODE) {} + friend class DOMImplementation; + +}; + + +}} +#endif // __WEBFRONT_XMLDOC_DOCUMENT_H_ diff --git a/HTTPServer/xmldoc_document_fragment.h b/HTTPServer/xmldoc_document_fragment.h new file mode 100644 index 00000000..9133aec6 --- /dev/null +++ b/HTTPServer/xmldoc_document_fragment.h @@ -0,0 +1,17 @@ +#ifndef __WEBFRONT_XMLDOC_DOCUMENT_FRAGMENT_H_ +#define __WEBFRONT_XMLDOC_DOCUMENT_FRAGMENT_H_ + +#include "xmldoc.h" + +namespace WebFront { namespace XMLDoc +{ + +class DocumentFragment : public Node +{ +protected: + DocumentFragment() : Node(DOCUMENT_FRAGMENT_NODE) {} + friend class Document; +}; + +}} +#endif // __WEBFRONT_XMLDOC_DOCUMENT_FRAGMENT_H_ diff --git a/HTTPServer/xmldoc_document_type.cpp b/HTTPServer/xmldoc_document_type.cpp new file mode 100644 index 00000000..9f2fce62 --- /dev/null +++ b/HTTPServer/xmldoc_document_type.cpp @@ -0,0 +1,58 @@ +#include "xmldoc_document_type.h" + +namespace WebFront { namespace XMLDoc { + + /** + * The name of DTD (immediately following the DOCTYPE keyword. + */ +std::string DocumentType::getName() const +{ + return name_; +} + + +/** + * A NamedNodeMap containing the general entities declared in the DTD. + */ +std::unique_ptr DocumentType::getEntities() const +{ + return nullptr; +} + + +/** + * A NamedNodeMap containing the notations declared in the DTD. + */ +std::unique_ptr DocumentType::getNotations() const +{ + return nullptr; +} + + +/** + * The public identifier of the external subset. + */ +const std::string& DocumentType::getPublicId() const +{ + return public_id_; +} + + +/** + * The system identifier of the external subset. + */ +const std::string& DocumentType::getSystemId() const +{ + return system_id_; +} + + +/** + * The internal subset. + */ +const std::string& DocumentType::getInternalSubset() const +{ + return internal_subset_; +} + +}} \ No newline at end of file diff --git a/HTTPServer/xmldoc_document_type.h b/HTTPServer/xmldoc_document_type.h new file mode 100644 index 00000000..78a600f3 --- /dev/null +++ b/HTTPServer/xmldoc_document_type.h @@ -0,0 +1,29 @@ +#ifndef __WEBFRONT_XMLDOC_DOCUMENT_TYPE_H_ +#define __WEBFRONT_XMLDOC_DOCUMENT_TYPE_H_ + +#include "xmldoc_node.h" + +namespace WebFront { namespace XMLDoc { + +class DocumentType : public Node +{ +public: + std::string getName() const; + std::unique_ptr getEntities() const; + std::unique_ptr getNotations() const; + const std::string& getPublicId() const; + const std::string& getSystemId() const; + const std::string& getInternalSubset() const; + + +private: + friend class DOMImplementation; + DocumentType() : Node(DOCUMENT_TYPE_NODE) {} + +private: + std::string name_, public_id_, system_id_, internal_subset_; +}; + + +}} +#endif // __WEBFRONT_XMLDOC_DOCUMENT_TYPE_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_dom_exception.h b/HTTPServer/xmldoc_dom_exception.h new file mode 100644 index 00000000..a0394d26 --- /dev/null +++ b/HTTPServer/xmldoc_dom_exception.h @@ -0,0 +1,25 @@ +#ifndef __WEBFRONT_XMLDOC_DOM_EXCEPTION_H_ +#define __WEBFRONT_XMLDOC_DOM_EXCEPTION_H_ + +#include +#include + +namespace WebFront { namespace XMLDoc { + +class DOMException : public std::runtime_error +{ +public: + DOMException(short code, const std::string& message) : runtime_error(message) { code_ = code; } + short code_; + + // ExceptionCode + static const short INDEX_SIZE_ERR = 1, DOMSTRING_SIZE_ERR = 2, HIERARCHY_REQUEST_ERR = 3, + WRONG_DOCUMENT_ERR = 4, INVALID_CHARACTER_ERR = 5, NO_DATA_ALLOWED_ERR = 6, + NO_MODIFICATION_ALLOWED_ERR = 7, NOT_FOUND_ERR = 8, NOT_SUPPORTED_ERR = 9, + INUSE_ATTRIBUTE_ERR = 10, INVALID_STATE_ERR = 11, SYNTAX_ERR = 12, + INVALID_MODIFICATION_ERR = 13, NAMESPACE_ERR = 14, INVALID_ACCESS_ERR = 15; +}; + + #pragma warning(disable: 4290) // Visual Studio does not implement checked exceptions. +}} +#endif // __WEBFRONT_XMLDOC_DOM_EXCEPTION_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_dom_implementation.cpp b/HTTPServer/xmldoc_dom_implementation.cpp new file mode 100644 index 00000000..1d8d655b --- /dev/null +++ b/HTTPServer/xmldoc_dom_implementation.cpp @@ -0,0 +1,165 @@ +#include "xmldoc_dom_implementation.h" +#include "xmldoc_document_type.h" +#include "xmldoc_document.h" +#include + + +class WebFront::XMLDoc::DOMImplementation::Impl +{ +public: + bool hasFeature(std::string feature_name, const std::string& version_name) const + { + auto feature = getFeature(feature_name); + if (feature) + { + if (version_name.empty()) + { + return true; + } + else + if (feature->SupportVersion(version_name)) + { + return true; + } + } + return false; + } + +private: + struct Feature + { + std::string name_; + std::list supported_versions_; + bool SupportVersion(const std::string& version) const + { + for (auto supported_version : supported_versions_) + { + if (0 == supported_version.compare(version)) + return true; + } + return false; + } + }; + std::list features_; + +private: + + void addFeature(std::string feature_name, std::string version_name) + { + auto feature = getFeature(feature_name); + if (feature) + { + if (!feature->SupportVersion(version_name)) + { + feature->supported_versions_.push_back(version_name); + } + } + else + { + Feature feat; + feat.name_=feature_name; + feat.supported_versions_.push_back(version_name); + features_.push_back(feat); + } + } + + std::shared_ptr getFeature(std::string feature_name) const + { + std::transform(feature_name.begin(), feature_name.end(), feature_name.begin(), ::tolower); + for (auto feature : features_) + { + if (0 == feature.name_.compare(feature_name)) + { + return std::make_shared(feature); + } + } + return nullptr; + } + + +}; + +namespace WebFront { namespace XMLDoc { + DOMImplementation::DOMImplementation() : impl_(new Impl) {} + DOMImplementation::~DOMImplementation() {} + + /** + * Test if the DOM implementation implements a specific feature. + * @param feature The name of the feature to test (case-insensitive). + * @param version Version number of the feature to test. + * @return true if the feature is implemented in the + * specified version, false otherwise. + */ + bool DOMImplementation::hasFeature(const std::string& feature, const std::string& version) const + { + return impl_->hasFeature(feature, version); + } + + /** + * Creates an empty DocumentType node. + */ + std::unique_ptr DOMImplementation::createDocumentType( + const std::string& qualifiedName, + const std::string& publicId, + const std::string& systemId) const + { + std::unique_ptr doctype(new DocumentType); + doctype->name_=qualifiedName; + doctype->public_id_=publicId; + doctype->system_id_=systemId; + + return doctype; + } + + /** + * Creates an XML Document object of the specified type with + * its document element. HTML-only DOM implementations do not need to + * implement this method. + * @param[in] namespaceURI The namespace URI of the document element to create. + * @param[in] qualifiedName The qualified name of the document element to be + * created. + * @param doctype The type of document to be created or nullptr. + * When doctype is not nullptr, its + * Node.ownerDocument attribute is set to the document + * being created. + * @return A new Document object. + * @exception DOMException + * INVALID_CHARACTER_ERR: Raised if the specified qualified name + * contains an illegal character. + *
NAMESPACE_ERR: Raised if the qualifiedName is + * malformed, if the qualifiedName has a prefix and the + * namespaceURI is null, or if the + * qualifiedName has a prefix that is "xml" and the + * namespaceURI is different from " + * http://www.w3.org/XML/1998/namespace" . + *
WRONG_DOCUMENT_ERR: Raised if doctype has already + * been used with a different document or was created from a different + * implementation. + * @since DOM Level 2 + */ + std::shared_ptr DOMImplementation::createDocument( + const std::string& namespaceURI, + const std::string& qualifiedName, + std::shared_ptr doctype) const + { + std::shared_ptr new_doc(new Document); + new_doc->namespace_uri_ = namespaceURI; + new_doc->nodeName_ = qualifiedName; + + if (nullptr == doctype->getOwnerDocument()) + { + doctype->ownerDocument_ = new_doc; + } + else + { + if (new_doc != doctype->getOwnerDocument()) + { + throw DOMException(DOMException::WRONG_DOCUMENT_ERR, "Doctype has already been used with a different document"); + } + } + + return new_doc; + + } + +}} \ No newline at end of file diff --git a/HTTPServer/xmldoc_dom_implementation.h b/HTTPServer/xmldoc_dom_implementation.h new file mode 100644 index 00000000..b85e4d7b --- /dev/null +++ b/HTTPServer/xmldoc_dom_implementation.h @@ -0,0 +1,30 @@ +#ifndef __WEBFRONT_XMLDOC_DOM_IMPLEMENTATION_H_ +#define __WEBFRONT_XMLDOC_DOM_IMPLEMENTATION_H_ + +#include "xmldoc_document.h" +#include "xmldoc_document_type.h" + +namespace WebFront { namespace XMLDoc { + +class DOMImplementation +{ +public: + DOMImplementation(); + ~DOMImplementation(); + bool hasFeature(const std::string& feature, const std::string& version) const; + std::unique_ptr createDocumentType( + const std::string& qualifiedName, + const std::string& publicId, + const std::string& systemId) const throw(DOMException); + std::shared_ptr createDocument( + const std::string& namespaceURI, + const std::string& qualifiedName, + const std::shared_ptr doctype) const throw(DOMException); + +private: + class Impl; + std::unique_ptr impl_; +}; + +}} +#endif // __WEBFRONT_XMLDOC_DOM_IMPLEMENTATION_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_element.cpp b/HTTPServer/xmldoc_element.cpp new file mode 100644 index 00000000..418ec477 --- /dev/null +++ b/HTTPServer/xmldoc_element.cpp @@ -0,0 +1,164 @@ +#include "xmldoc_element.h" +#include "xmldoc_attr.h" +#include "xmldoc_document.h" +#include "xmldoc_node_list.h" + +namespace WebFront { namespace XMLDoc { + + +/** + * The name of the element. + */ +const std::string& Element::getTagName() const +{ + return getNodeName(); +} + + +/** + * Retrieves an attribute value by name. + * @param[in] name The name of the attribute to retrieve. + * @return The attribute value. +*/ +std::string Element::getAttribute(const std::string& name) const +{ + auto attribute = getAttributeNode(name); + if (attribute) + { + return attribute->getNodeValue(); + } + return std::string(); +} + + +/** + * Adds a new attribute. + * @param[in] name The name of the attribute to create or alter. + * @param[in] value Value to set in string form. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ +void Element::setAttribute(const std::string& name, const std::string& value) +{ + if (isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "node is read only"); + auto attribute = getAttributeNode(name); + if (nullptr == attribute) + { + auto new_attribute = getOwnerDocument()->createAttribute(name); + new_attribute->setValue(value); + appendChild(new_attribute); + } + else + { + attribute->setNodeValue(value); + } +} + +/** + * Removes an attribute by name. + * @param[in] name The name of the attribute to remove. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ +void Element::removeAttribute(const std::string& name) +{ + if (isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "node is read only"); + auto attribute = getAttributeNode(name); + if (nullptr != attribute) + { + removeAttributeNode(attribute); + } +} + + +/** + * Retrieves an attribute node by name. + * @param[in] name The name of the attribute to retrieve. + * @return The Attr node with the specified name ( + * nodeName) or nullptr. + */ +std::shared_ptr Element::getAttributeNode(const std::string& name) const +{ + for (auto node : childNodes_) + { + if (ATTRIBUTE_NODE == node->getNodeType()) + { + auto attr = std::static_pointer_cast(node); + if (0 == name.compare(attr->getNodeName())) + { + return attr; + } + } + } + return nullptr; +} + + +/** + * Removes the given attribute node. + * @param old_attr The Attr node to remove. + * @return The Attr node that was removed. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + *
NOT_FOUND_ERR: Raised if oldAttr is not an attribute + * of the element. + */ +std::shared_ptr Element::removeAttributeNode(std::shared_ptr old_attr) +{ + removeChild(old_attr); + return old_attr; +} + + +/** + * Returns a NodeList of all descendant Elements with a given tag name. + * @param[in] tag_name The name of the tag to match on. The special value "*" + * matches all tags. + * @return A list of matching Element nodes. + */ +std::unique_ptr Element::getElementsByTagName(const std::string& tag_name) const +{ + std::list> tagged_list; + auto node = getFirstChild(); + while (nullptr != node) + { + if (ELEMENT_NODE == node->getNodeType()) + { + if (0 == tag_name.compare(std::static_pointer_cast(node)->getTagName()) + || tag_name == "*") + { + tagged_list.push_back(node); + } + } + if (node->hasChildNodes()) + { + node = node->getFirstChild(); + } + else + { + while (nullptr == node->getNextSibling() && node.get() != this) + { + node = node->getParentNode(); + } + node = node->getNextSibling(); + } + } + return std::unique_ptr(new NodeList(tagged_list)); +} + + +/** +* Returns true if named attribute exists. +* @param[in] name The name of the attribute to look for. +* @return true if an attribute with the given name is +* specified on this element or has a default value, false +* otherwise. +*/ +bool Element::hasAttribute(const std::string& name) const +{ + return (getAttributeNode(name) != nullptr); +} + + + +}}; \ No newline at end of file diff --git a/HTTPServer/xmldoc_element.h b/HTTPServer/xmldoc_element.h new file mode 100644 index 00000000..cd80f3ab --- /dev/null +++ b/HTTPServer/xmldoc_element.h @@ -0,0 +1,30 @@ +#ifndef __WEBFRONT_XMLDOC_ELEMENT_H_ +#define __WEBFRONT_XMLDOC_ELEMENT_H_ + +#include "xmldoc_node.h" + +namespace WebFront { namespace XMLDoc { + +class Attr; +class Element : public Node +{ +public: + const std::string& getTagName() const; + + std::string getAttribute(const std::string& name) const; + void setAttribute(const std::string& name, const std::string& value) throw(DOMException); + void removeAttribute(const std::string& name) throw(DOMException); + std::shared_ptr getAttributeNode(const std::string& name) const; + std::shared_ptr setAttributeNode(std::shared_ptr new_attr); + std::shared_ptr removeAttributeNode(std::shared_ptr old_attr) throw(DOMException); + std::unique_ptr getElementsByTagName(const std::string& tag_name) const; + bool hasAttribute(const std::string& name) const; + +protected: + Element(); + friend class Document; +}; + + +}} +#endif // __WEBFRONT_XMLDOC_ELEMENT_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_entity_reference.h b/HTTPServer/xmldoc_entity_reference.h new file mode 100644 index 00000000..83c43165 --- /dev/null +++ b/HTTPServer/xmldoc_entity_reference.h @@ -0,0 +1,17 @@ +#ifndef __WEBFRONT_XMLDOC_ENTITY_REFERENCE_H_ +#define __WEBFRONT_XMLDOC_ENTITY_REFERENCE_H_ + +#include "xmldoc_text.h" + +namespace WebFront { namespace XMLDoc { + +class EntityReference : public Node +{ +protected: + EntityReference() : Node(ENTITY_REFERENCE_NODE) {} + friend class Document; +}; + + +}} +#endif // __WEBFRONT_XMLDOC_ENTITY_REFERENCE_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_named_node_map.cpp b/HTTPServer/xmldoc_named_node_map.cpp new file mode 100644 index 00000000..6964bebe --- /dev/null +++ b/HTTPServer/xmldoc_named_node_map.cpp @@ -0,0 +1,141 @@ +#include "xmldoc_named_node_map.h" +#include "xmldoc_node.h" +#include "xmldoc_attr.h" + +namespace WebFront { namespace XMLDoc +{ + NamedNodeMap::NamedNodeMap() : read_only_(false) + { + } + + + /** + * Retrieves a node specified by name. + * @param[in] name The nodeName of the node to retrieve. + * @return A Node with the specified nodeName of nullptr/ + */ + std::shared_ptr NamedNodeMap::getNamedItem(const std::string& name) const + { + try + { + return nodes_.at(name); + } + catch (std::out_of_range&) + { + return nullptr; + } + } + + + /** + * Adds a node using its nodeName attribute. If a node with + * that name is already present in this map, it is replaced by the new + * one. + * @param[in] node The node to store in the map. + * @return If the new Node replaces an existing node, the replaced node + * is returned, otherwise nullptr is returned. + * @exception DOMException + * WRONG_DOCUMENT_ERR: Raised if node was created from a + * different document than the one that created this map. + *
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. + *
INUSE_ATTRIBUTE_ERR: Raised if node is an + * Attr that is already an attribute of another + * Element object. The DOM user must explicitly clone + * Attr nodes to re-use them in other elements. + */ + std::shared_ptr NamedNodeMap::setNamedItem(std::shared_ptr node) + { + if (node->getOwnerDocument() != owner_document_) + { + throw DOMException(DOMException::WRONG_DOCUMENT_ERR, + "node was created from a different document than the one that created this NamedNodeMap."); + } + + if (read_only_) + { + throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "NamedNodeMap is readonly."); + } + + if (Node::ATTRIBUTE_NODE == node->getNodeType()) + { + if (nullptr != std::static_pointer_cast(node)->getOwnerElement()) + { + throw DOMException(DOMException::INUSE_ATTRIBUTE_ERR, "node is already an attribute of another Element."); + } + } + + auto old_node_iter = nodes_.find(node->getNodeName()); + std::shared_ptr old_node; + if (nodes_.end() == old_node_iter) + { + old_node = nullptr; + } + else + { + old_node = old_node_iter->second; + } + + nodes_[node->getNodeName()] = node; + return old_node; + } + + + /** + * Removes a node specified by name. + * @param[in] name The nodeName of the node to remove. + * @return The node removed from this map if a node with such a name + * exists. + * @exception DOMException + * NOT_FOUND_ERR: Raised if there is no node named name in + * this map. + *
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. + */ + std::shared_ptr NamedNodeMap::removeNamedItem(const std::string& name) + { + if (read_only_) + { + throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "NamedNodeMap is readonly."); + } + auto old_node_iter = nodes_.find(name); + if (nodes_.end() == old_node_iter) + { + throw DOMException(DOMException::NOT_FOUND_ERR, "No node with this name found."); + } + return old_node_iter->second; + + } + + + /** + * Returns the indexth item in the map. If index + * is greater than or equal to the number of nodes in this map, this + * returns nullptr. + * @param[in] index Index into this map. + * @return The node at the indexth position in the map, or + * nullptr if that is not a valid index. + */ + std::shared_ptr NamedNodeMap::item(unsigned int index) const + { + for (auto node : nodes_) + { + if (0 == index) + { + return node.second; + } + else + { + index--; + } + } + return nullptr; + } + + /** + * The number of nodes in this map. + * @return The number of nodes in this map. + */ + unsigned int NamedNodeMap::getLength() const + { + return nodes_.size(); + } +}} \ No newline at end of file diff --git a/HTTPServer/xmldoc_named_node_map.h b/HTTPServer/xmldoc_named_node_map.h new file mode 100644 index 00000000..155ce1f5 --- /dev/null +++ b/HTTPServer/xmldoc_named_node_map.h @@ -0,0 +1,31 @@ +#ifndef __WEBFRONT_XMLDOC_NAMED_NODE_MAP_H_ +#define __WEBFRONT_XMLDOC_NAMED_NODE_MAP_H_ + +#include "xmldoc_dom_exception.h" +#include +#include + +namespace WebFront { namespace XMLDoc +{ +class Node; +class NamedNodeMap +{ +public: + + std::shared_ptr getNamedItem(const std::string& name) const; + std::shared_ptr setNamedItem(std::shared_ptr node) throw(DOMException); + std::shared_ptr removeNamedItem(const std::string& name) throw(DOMException); + std::shared_ptr item(unsigned int index) const; + unsigned int getLength() const; + +private: + NamedNodeMap(); + friend class Document; + + std::shared_ptr owner_document_; + std::unordered_map> nodes_; + bool read_only_; +}; + +}} +#endif // __WEBFRONT_XMLDOC_NAMED_NODE_MAP_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_node.cpp b/HTTPServer/xmldoc_node.cpp new file mode 100644 index 00000000..2e05605a --- /dev/null +++ b/HTTPServer/xmldoc_node.cpp @@ -0,0 +1,195 @@ +#include "xmldoc_node.h" +#include "xmldoc_node_list.h" + +namespace WebFront { namespace XMLDoc { + +Node::Node(short type) : nodeType_(type), flags_(0) +{ +} + + +const std::string& Node::getNodeName() const +{ + return nodeName_; +} + + +const std::string& Node::getNodeValue() const +{ + return nodeValue_; +} + + +void Node::setNodeValue(std::string nodeValue) +{ + if (isReadOnly()) + { + throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "node is read only"); + } + nodeValue_ = nodeValue; +} + + +short Node::getNodeType() const +{ + return nodeType_; +} + + +std::shared_ptr Node::getParentNode() const +{ + return parentNode_; +} + + +std::shared_ptr Node::getFirstChild() const +{ + return firstChild_; +} + + +std::shared_ptr Node::getLastChild() const +{ + return lastChild_; +} + + +std::shared_ptr Node::getPreviousSibling() const +{ + return previousSibling_; +} + + +std::shared_ptr Node::getNextSibling() const +{ + return nextSibling_; +} + + +std::unique_ptr Node::getAttributes() const +{ + // NOT IMPLEMENTED + return nullptr; +} + + +std::shared_ptr Node::getOwnerDocument() const +{ + // NOT IMPLEMENTED + return nullptr; +} + + +std::shared_ptr Node::insertBefore( std::shared_ptr new_child, + std::shared_ptr ref_child) +{ + // NOT IMPLEMENTED + return nullptr; +} + + +std::shared_ptr Node::replaceChild( std::shared_ptr new_child, + std::shared_ptr old_child) +{ + // NOT IMPLEMENTED + return nullptr; +} + + +/** + * Removes the given child node. + * @param[in] old_child The node to remove. + * @return The node that was removed. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + *
NOT_FOUND_ERR: Raised if oldAttr is not an attribute + * of the element. + */ +std::shared_ptr Node::removeChild(std::shared_ptr old_child) +{ + if (isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, "node is read only"); + for (auto node : childNodes_) + { + if (node == old_child) + { + removeChild(old_child); + return node; + } + } + throw DOMException(DOMException::NOT_FOUND_ERR, "not an attribute of the element"); +} + + +std::shared_ptr Node::appendChild(std::shared_ptr new_child) +{ + // NOT IMPLEMENTED + return nullptr; +} + + +bool Node::hasChildNodes() const +{ + return nodes_count_ > 0; +} + + +std::unique_ptr Node::cloneNode(bool deep) const +{ + // NOT IMPLEMENTED + return nullptr; +} + + +void Node::normalize() +{ + // NOT IMPLEMENTED +} + + +bool Node::isSupported(const std::string& feature, const std::string& version) const +{ + // NOT IMPLEMENTED + return false; +} + + +const std::string& Node::getNamespaceURI() const +{ + // NOT IMPLEMENTED + return namespace_uri_; +} + + +const std::string& Node::getPrefix() const +{ + return prefix_; +} + + +void Node::setPrefix(const std::string& prefix) +{ + prefix_ = prefix; +} + + +const std::string& Node::getLocalName() const +{ + // NOT IMPLEMENTED + return nodeName_; +} + + +bool Node::hasAttributes() const +{ + // NOT IMPLEMENTED + return false; +} + + +std::unique_ptr Node::getChildNodes() const +{ + return std::unique_ptr(new NodeList(childNodes_)); +} + + +}} \ No newline at end of file diff --git a/HTTPServer/xmldoc_node.h b/HTTPServer/xmldoc_node.h new file mode 100644 index 00000000..3e8ffacf --- /dev/null +++ b/HTTPServer/xmldoc_node.h @@ -0,0 +1,96 @@ +#ifndef __WEBFRONT_XMLDOC_NODE_H_ +#define __WEBFRONT_XMLDOC_NODE_H_ + +#include +#include +#include +#include "xmldoc_dom_exception.h" +#include "xmldoc_named_node_map.h" + +namespace WebFront { namespace XMLDoc { + +class Document; +class NodeList; +class Node +{ +public: + static const short ELEMENT_NODE = 1, ATTRIBUTE_NODE = 2, TEXT_NODE = 3, CDATA_SECTION_NODE = 4, + ENTITY_REFERENCE_NODE = 5, ENTITY_NODE = 6, PROCESSING_INSTRUCTION_NODE = 7, + COMMENT_NODE = 8, DOCUMENT_NODE = 9, DOCUMENT_TYPE_NODE = 10, + DOCUMENT_FRAGMENT_NODE = 11, NOTATION_NODE = 12; +public: + const std::string& getNodeName() const; + const std::string& getNodeValue() const; + void setNodeValue(std::string nodeValue) throw(DOMException); + short getNodeType() const; + + std::shared_ptr getParentNode() const; + std::unique_ptr getChildNodes() const; + std::shared_ptr getFirstChild() const; + std::shared_ptr getLastChild() const; + std::shared_ptr getPreviousSibling() const; + std::shared_ptr getNextSibling() const; + std::unique_ptr getAttributes() const; + std::shared_ptr getOwnerDocument() const; + std::shared_ptr insertBefore( std::shared_ptr new_child, + std::shared_ptr ref_child) throw(DOMException); + std::shared_ptr replaceChild( std::shared_ptr new_child, + std::shared_ptr old_child) throw(DOMException); + std::shared_ptr removeChild(std::shared_ptr old_child) throw(DOMException); + std::shared_ptr appendChild(std::shared_ptr new_child) throw(DOMException); + bool hasChildNodes() const; + std::unique_ptr cloneNode(bool deep) const; + void normalize(); + bool isSupported(const std::string& feature, const std::string& version) const; + const std::string& getNamespaceURI() const; + const std::string& getPrefix() const; + void setPrefix(const std::string& prefix); + const std::string& getLocalName() const; + bool hasAttributes() const; + + + // std::unique_ptr helpers + template std::shared_ptr appendChild(std::unique_ptr& newChild) throw(DOMException) + { return appendChild(std::shared_ptr(newChild.get())); } + template std::shared_ptr insertBefore(std::unique_ptr& newChild, + std::shared_ptr refChild) throw(DOMException) + { return insertBefore(std::shared_ptr(newChild.get()), refChild); } + template std::shared_ptr replaceChild(std::unique_ptr& newChild, + std::shared_ptr oldChild) throw(DOMException) + { return replaceChild(std::shared_ptr(newChild.get()), oldChild); } + + + +protected: + std::vector> childNodes_; + std::string nodeValue_; + +private: + std::unordered_map attributes_indexes_; + std::string nodeName_; + std::string namespace_uri_; + + std::shared_ptr parentNode_; + std::shared_ptr nextSibling_, previousSibling_; + std::shared_ptr firstChild_, lastChild_; + std::shared_ptr ownerDocument_; + + unsigned int nodes_count_; + short nodeType_; + std::string prefix_; + +private: + enum NodeFlags { kReadOnly = 0x1<<1 }; + unsigned short flags_; + +protected: + friend class DOMImplementation; + Node(short type); + + bool isReadOnly() const { return (flags_ & kReadOnly) !=0; }; + void setReadOnly(bool read_only) { flags_ = (read_only ? flags_ | kReadOnly : flags_ & ~kReadOnly); } + +}; + +}} +#endif // __WEBFRONT_XMLDOC_NODE_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_node_list.h b/HTTPServer/xmldoc_node_list.h new file mode 100644 index 00000000..3a472802 --- /dev/null +++ b/HTTPServer/xmldoc_node_list.h @@ -0,0 +1,23 @@ +#ifndef __WEBFRONT_XMLDOC_NODE_LIST_H_ +#define __WEBFRONT_XMLDOC_NODE_LIST_H_ + +#include "xmldoc.h" +#include +namespace WebFront { namespace XMLDoc +{ +class Node; +class NodeList +{ +public: + template NodeList(const NodesContainer& container) + { nodes_.resize(container.size()); std::copy(container.cbegin(), container.cend(), nodes_.begin()); } + + size_t length() const { return nodes_.size(); } + std::shared_ptr item(size_t index) const { if (index operator[](size_t index) const { return item(index); } +private: + std::vector> nodes_; +}; + +}} +#endif // __WEBFRONT_XMLDOC_NODE_LIST_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_processing_instruction.h b/HTTPServer/xmldoc_processing_instruction.h new file mode 100644 index 00000000..ab68152a --- /dev/null +++ b/HTTPServer/xmldoc_processing_instruction.h @@ -0,0 +1,22 @@ +#ifndef __WEBFRONT_XMLDOC_PROCESSING_INSTRUCTION_H_ +#define __WEBFRONT_XMLDOC_PROCESSING_INSTRUCTION_H_ + +#include "xmldoc_node.h" + +namespace WebFront { namespace XMLDoc { + +class ProcessingInstruction : public Node +{ +public: + const std::string& getTarget() const; + const std::string& getData() const; + void setData(const std::string& data) throw(DOMException); + +protected: + ProcessingInstruction() : Node(PROCESSING_INSTRUCTION_NODE) {} + friend class Document; +}; + + +}} +#endif // __WEBFRONT_XMLDOC_PROCESSING_INSTRUCTION_H_ \ No newline at end of file diff --git a/HTTPServer/xmldoc_text.cpp b/HTTPServer/xmldoc_text.cpp new file mode 100644 index 00000000..f6a546f0 --- /dev/null +++ b/HTTPServer/xmldoc_text.cpp @@ -0,0 +1,29 @@ +#include "xmldoc_text.h" + +namespace WebFront { namespace XMLDoc { + + +/** + * Splits this node into two nodes at the specified offset. + * @param[in] offset The offset at which to split. + * @return The new node. + * @exception DOMException + * INDEX_SIZE_ERR: Raised if the specified offset is out of range. + *
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ +std::shared_ptr Text::splitText(unsigned int offset) +{ + /*NOT IMPLEMENTED*/ +/* +* keeping both in the tree as siblings. After being split, this node +* will contain all the content up to the offset point. A +* new node of the same type, which contains all the content at and +* after the offset point, is returned. If the original +* node had a parent node, the new node is inserted as the next sibling +* of the original node. When the offset is equal to the +* length of this node, the new node has no data. +*/ + return nullptr; +} + +}} \ No newline at end of file diff --git a/HTTPServer/xmldoc_text.h b/HTTPServer/xmldoc_text.h new file mode 100644 index 00000000..949939b5 --- /dev/null +++ b/HTTPServer/xmldoc_text.h @@ -0,0 +1,21 @@ +#ifndef __WEBFRONT_XMLDOC_TEXT_H_ +#define __WEBFRONT_XMLDOC_TEXT_H_ + +#include "xmldoc_character_data.h" + +namespace WebFront { namespace XMLDoc { + + +class Text : public CharacterData +{ +public: + std::shared_ptr splitText(unsigned int offset) throw(DOMException); + +protected: + Text() : CharacterData(TEXT_NODE) {} + friend class Document; +}; + + +}} +#endif // __WEBFRONT_XMLDOC_TEXT_H_ \ No newline at end of file From c76b947b7333074f151d245c587157214b3fb76f Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Fri, 26 Apr 2013 17:54:01 +0200 Subject: [PATCH 003/118] Doxygen support --- Doxyfile | 1903 ++++++++++++++++++++++++++++++++++++++++++++++++ HTTPServer.sln | 20 + 2 files changed, 1923 insertions(+) create mode 100644 Doxyfile create mode 100644 HTTPServer.sln diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 00000000..db15c6fc --- /dev/null +++ b/Doxyfile @@ -0,0 +1,1903 @@ +# Doxyfile 1.8.3.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = WebFront + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 0.0.1 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "WebFront is a C++11 web front-end library." + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = "C:/devel/Projects/WebFront documentation" + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. Note that you specify absolute paths here, but also +# relative paths, which will be relative from the directory where doxygen is +# started. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, +# and language is one of the parsers supported by doxygen: IDL, Java, +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, +# C++. For instance to make doxygen treat .inc files as Fortran files (default +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note +# that for custom extensions you also need to set FILE_PATTERNS otherwise the +# files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented classes, +# or namespaces to their corresponding documentation. Such a link can be +# prevented in individual cases by by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES (the +# default) will make doxygen replace the get and set methods by a property in +# the documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if section-label ... \endif +# and \cond section-label ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. Do not use +# file names with spaces, bibtex cannot handle them. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = NO + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = C:/devel/Projects/HTTPServer/HTTPServer + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = HTTPServer/targetver.h \ + HTTPServer/HTTPServer.cpp + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page (index.html). +# This can be useful if you have a project on for instance GitHub and want reuse +# the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C, C++ and Fortran comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If left blank doxygen will +# generate a default style sheet. Note that it is recommended to use +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this +# tag will in the future become obsolete. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional +# user-defined cascading style sheet that is included after the standard +# style sheets created by doxygen. Using this option one can overrule +# certain style aspects. This is preferred over using HTML_STYLESHEET +# since it does not replace the standard style sheet and is therefor more +# robust against future updates. Doxygen will copy the style sheet file to +# the output directory. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of +# entries shown in the various tree structured indices initially; the user +# can expand and collapse entries dynamically later on. Doxygen will expand +# the tree to such a level that at most the specified number of entries are +# visible (unless a fully collapsed tree already exceeds this amount). +# So setting the number of entries 1 will produce a full collapsed tree by +# default. 0 is a special value representing an infinite number of entries +# and will result in a full expanded tree by default. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely +# identify the documentation publisher. This should be a reverse domain-name +# style string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# thA MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and +# SVG. The default value is HTML-CSS, which is slower, but has the best +# compatibility. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a web server instead of a web client using Javascript. +# There are two flavours of web server based search depending on the +# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for +# searching and an index file used by the script. When EXTERNAL_SEARCH is +# enabled the indexing and searching needs to be provided by external tools. +# See the manual for details. + +SERVER_BASED_SEARCH = NO + +# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP +# script for searching. Instead the search results are written to an XML file +# which needs to be processed by an external indexer. Doxygen will invoke an +# external search engine pointed to by the SEARCHENGINE_URL option to obtain +# the search results. Doxygen ships with an example indexer (doxyindexer) and +# search engine (doxysearch.cgi) which are based on the open source search engine +# library Xapian. See the manual for configuration details. + +EXTERNAL_SEARCH = NO + +# The SEARCHENGINE_URL should point to a search engine hosted by a web server +# which will returned the search results when EXTERNAL_SEARCH is enabled. +# Doxygen ships with an example search engine (doxysearch) which is based on +# the open source search engine library Xapian. See the manual for configuration +# details. + +SEARCHENGINE_URL = + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed +# search data is written to a file for indexing by an external tool. With the +# SEARCHDATA_FILE tag the name of this file can be specified. + +SEARCHDATA_FILE = searchdata.xml + +# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the +# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is +# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple +# projects and redirect the results back to the right project. + +EXTERNAL_SEARCH_ID = + +# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen +# projects other than the one defined by this configuration file, but that are +# all added to the same external search index. Each project needs to have a +# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id +# of to a relative location where the documentation can be found. +# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... + +EXTRA_SEARCH_MAPPINGS = + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/HTTPServer.sln b/HTTPServer.sln new file mode 100644 index 00000000..7d671c3e --- /dev/null +++ b/HTTPServer.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPServer", "HTTPServer\HTTPServer.vcxproj", "{1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}.Debug|Win32.ActiveCfg = Debug|Win32 + {1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}.Debug|Win32.Build.0 = Debug|Win32 + {1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}.Release|Win32.ActiveCfg = Release|Win32 + {1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal From e3daf29aeb23040f545d8be1cb5f3664418c172d Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Thu, 21 Feb 2019 23:07:10 +0100 Subject: [PATCH 004/118] Cleanup --- HTTPServer.sln | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 HTTPServer.sln diff --git a/HTTPServer.sln b/HTTPServer.sln deleted file mode 100644 index 7d671c3e..00000000 --- a/HTTPServer.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPServer", "HTTPServer\HTTPServer.vcxproj", "{1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}.Debug|Win32.ActiveCfg = Debug|Win32 - {1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}.Debug|Win32.Build.0 = Debug|Win32 - {1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}.Release|Win32.ActiveCfg = Release|Win32 - {1B2A103E-BE0B-49C7-BF4F-EBFA98D6EB56}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal From c7ddb133020a24cce96285c978b2c3ebe1cc8ca4 Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Fri, 22 Feb 2019 23:07:10 +0100 Subject: [PATCH 005/118] Cleanup --- {HTTPServer => webfront/DOM}/HTTPServer.cpp | 0 {HTTPServer => webfront/DOM}/HTTPServer.vcxproj | 0 {HTTPServer => webfront/DOM}/HTTPServer.vcxproj.filters | 0 {HTTPServer => webfront/DOM}/ReadMe.txt | 0 {HTTPServer => webfront/DOM}/http_connexion.cpp | 0 {HTTPServer => webfront/DOM}/http_connexion.h | 0 {HTTPServer => webfront/DOM}/http_request.cpp | 0 {HTTPServer => webfront/DOM}/http_request.h | 0 {HTTPServer => webfront/DOM}/page.h | 0 {HTTPServer => webfront/DOM}/socket_helper.h | 0 {HTTPServer => webfront/DOM}/socket_server.cpp | 0 {HTTPServer => webfront/DOM}/socket_server.h | 0 {HTTPServer => webfront/DOM}/thread_pool.cpp | 0 {HTTPServer => webfront/DOM}/thread_pool.h | 0 {HTTPServer => webfront/DOM}/webfront.cpp | 0 {HTTPServer => webfront/DOM}/webfront.h | 0 {HTTPServer => webfront/DOM}/xmldoc.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc.h | 0 {HTTPServer => webfront/DOM}/xmldoc_attr.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc_attr.h | 0 {HTTPServer => webfront/DOM}/xmldoc_c_data_section.h | 0 {HTTPServer => webfront/DOM}/xmldoc_character_data.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc_character_data.h | 0 {HTTPServer => webfront/DOM}/xmldoc_comment.h | 0 {HTTPServer => webfront/DOM}/xmldoc_document.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc_document.h | 0 {HTTPServer => webfront/DOM}/xmldoc_document_fragment.h | 0 {HTTPServer => webfront/DOM}/xmldoc_document_type.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc_document_type.h | 0 {HTTPServer => webfront/DOM}/xmldoc_dom_exception.h | 0 {HTTPServer => webfront/DOM}/xmldoc_dom_implementation.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc_dom_implementation.h | 0 {HTTPServer => webfront/DOM}/xmldoc_element.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc_element.h | 0 {HTTPServer => webfront/DOM}/xmldoc_entity_reference.h | 0 {HTTPServer => webfront/DOM}/xmldoc_named_node_map.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc_named_node_map.h | 0 {HTTPServer => webfront/DOM}/xmldoc_node.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc_node.h | 0 {HTTPServer => webfront/DOM}/xmldoc_node_list.h | 0 {HTTPServer => webfront/DOM}/xmldoc_processing_instruction.h | 0 {HTTPServer => webfront/DOM}/xmldoc_text.cpp | 0 {HTTPServer => webfront/DOM}/xmldoc_text.h | 0 43 files changed, 0 insertions(+), 0 deletions(-) rename {HTTPServer => webfront/DOM}/HTTPServer.cpp (100%) rename {HTTPServer => webfront/DOM}/HTTPServer.vcxproj (100%) rename {HTTPServer => webfront/DOM}/HTTPServer.vcxproj.filters (100%) rename {HTTPServer => webfront/DOM}/ReadMe.txt (100%) rename {HTTPServer => webfront/DOM}/http_connexion.cpp (100%) rename {HTTPServer => webfront/DOM}/http_connexion.h (100%) rename {HTTPServer => webfront/DOM}/http_request.cpp (100%) rename {HTTPServer => webfront/DOM}/http_request.h (100%) rename {HTTPServer => webfront/DOM}/page.h (100%) rename {HTTPServer => webfront/DOM}/socket_helper.h (100%) rename {HTTPServer => webfront/DOM}/socket_server.cpp (100%) rename {HTTPServer => webfront/DOM}/socket_server.h (100%) rename {HTTPServer => webfront/DOM}/thread_pool.cpp (100%) rename {HTTPServer => webfront/DOM}/thread_pool.h (100%) rename {HTTPServer => webfront/DOM}/webfront.cpp (100%) rename {HTTPServer => webfront/DOM}/webfront.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_attr.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc_attr.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_c_data_section.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_character_data.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc_character_data.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_comment.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_document.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc_document.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_document_fragment.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_document_type.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc_document_type.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_dom_exception.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_dom_implementation.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc_dom_implementation.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_element.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc_element.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_entity_reference.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_named_node_map.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc_named_node_map.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_node.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc_node.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_node_list.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_processing_instruction.h (100%) rename {HTTPServer => webfront/DOM}/xmldoc_text.cpp (100%) rename {HTTPServer => webfront/DOM}/xmldoc_text.h (100%) diff --git a/HTTPServer/HTTPServer.cpp b/webfront/DOM/HTTPServer.cpp similarity index 100% rename from HTTPServer/HTTPServer.cpp rename to webfront/DOM/HTTPServer.cpp diff --git a/HTTPServer/HTTPServer.vcxproj b/webfront/DOM/HTTPServer.vcxproj similarity index 100% rename from HTTPServer/HTTPServer.vcxproj rename to webfront/DOM/HTTPServer.vcxproj diff --git a/HTTPServer/HTTPServer.vcxproj.filters b/webfront/DOM/HTTPServer.vcxproj.filters similarity index 100% rename from HTTPServer/HTTPServer.vcxproj.filters rename to webfront/DOM/HTTPServer.vcxproj.filters diff --git a/HTTPServer/ReadMe.txt b/webfront/DOM/ReadMe.txt similarity index 100% rename from HTTPServer/ReadMe.txt rename to webfront/DOM/ReadMe.txt diff --git a/HTTPServer/http_connexion.cpp b/webfront/DOM/http_connexion.cpp similarity index 100% rename from HTTPServer/http_connexion.cpp rename to webfront/DOM/http_connexion.cpp diff --git a/HTTPServer/http_connexion.h b/webfront/DOM/http_connexion.h similarity index 100% rename from HTTPServer/http_connexion.h rename to webfront/DOM/http_connexion.h diff --git a/HTTPServer/http_request.cpp b/webfront/DOM/http_request.cpp similarity index 100% rename from HTTPServer/http_request.cpp rename to webfront/DOM/http_request.cpp diff --git a/HTTPServer/http_request.h b/webfront/DOM/http_request.h similarity index 100% rename from HTTPServer/http_request.h rename to webfront/DOM/http_request.h diff --git a/HTTPServer/page.h b/webfront/DOM/page.h similarity index 100% rename from HTTPServer/page.h rename to webfront/DOM/page.h diff --git a/HTTPServer/socket_helper.h b/webfront/DOM/socket_helper.h similarity index 100% rename from HTTPServer/socket_helper.h rename to webfront/DOM/socket_helper.h diff --git a/HTTPServer/socket_server.cpp b/webfront/DOM/socket_server.cpp similarity index 100% rename from HTTPServer/socket_server.cpp rename to webfront/DOM/socket_server.cpp diff --git a/HTTPServer/socket_server.h b/webfront/DOM/socket_server.h similarity index 100% rename from HTTPServer/socket_server.h rename to webfront/DOM/socket_server.h diff --git a/HTTPServer/thread_pool.cpp b/webfront/DOM/thread_pool.cpp similarity index 100% rename from HTTPServer/thread_pool.cpp rename to webfront/DOM/thread_pool.cpp diff --git a/HTTPServer/thread_pool.h b/webfront/DOM/thread_pool.h similarity index 100% rename from HTTPServer/thread_pool.h rename to webfront/DOM/thread_pool.h diff --git a/HTTPServer/webfront.cpp b/webfront/DOM/webfront.cpp similarity index 100% rename from HTTPServer/webfront.cpp rename to webfront/DOM/webfront.cpp diff --git a/HTTPServer/webfront.h b/webfront/DOM/webfront.h similarity index 100% rename from HTTPServer/webfront.h rename to webfront/DOM/webfront.h diff --git a/HTTPServer/xmldoc.cpp b/webfront/DOM/xmldoc.cpp similarity index 100% rename from HTTPServer/xmldoc.cpp rename to webfront/DOM/xmldoc.cpp diff --git a/HTTPServer/xmldoc.h b/webfront/DOM/xmldoc.h similarity index 100% rename from HTTPServer/xmldoc.h rename to webfront/DOM/xmldoc.h diff --git a/HTTPServer/xmldoc_attr.cpp b/webfront/DOM/xmldoc_attr.cpp similarity index 100% rename from HTTPServer/xmldoc_attr.cpp rename to webfront/DOM/xmldoc_attr.cpp diff --git a/HTTPServer/xmldoc_attr.h b/webfront/DOM/xmldoc_attr.h similarity index 100% rename from HTTPServer/xmldoc_attr.h rename to webfront/DOM/xmldoc_attr.h diff --git a/HTTPServer/xmldoc_c_data_section.h b/webfront/DOM/xmldoc_c_data_section.h similarity index 100% rename from HTTPServer/xmldoc_c_data_section.h rename to webfront/DOM/xmldoc_c_data_section.h diff --git a/HTTPServer/xmldoc_character_data.cpp b/webfront/DOM/xmldoc_character_data.cpp similarity index 100% rename from HTTPServer/xmldoc_character_data.cpp rename to webfront/DOM/xmldoc_character_data.cpp diff --git a/HTTPServer/xmldoc_character_data.h b/webfront/DOM/xmldoc_character_data.h similarity index 100% rename from HTTPServer/xmldoc_character_data.h rename to webfront/DOM/xmldoc_character_data.h diff --git a/HTTPServer/xmldoc_comment.h b/webfront/DOM/xmldoc_comment.h similarity index 100% rename from HTTPServer/xmldoc_comment.h rename to webfront/DOM/xmldoc_comment.h diff --git a/HTTPServer/xmldoc_document.cpp b/webfront/DOM/xmldoc_document.cpp similarity index 100% rename from HTTPServer/xmldoc_document.cpp rename to webfront/DOM/xmldoc_document.cpp diff --git a/HTTPServer/xmldoc_document.h b/webfront/DOM/xmldoc_document.h similarity index 100% rename from HTTPServer/xmldoc_document.h rename to webfront/DOM/xmldoc_document.h diff --git a/HTTPServer/xmldoc_document_fragment.h b/webfront/DOM/xmldoc_document_fragment.h similarity index 100% rename from HTTPServer/xmldoc_document_fragment.h rename to webfront/DOM/xmldoc_document_fragment.h diff --git a/HTTPServer/xmldoc_document_type.cpp b/webfront/DOM/xmldoc_document_type.cpp similarity index 100% rename from HTTPServer/xmldoc_document_type.cpp rename to webfront/DOM/xmldoc_document_type.cpp diff --git a/HTTPServer/xmldoc_document_type.h b/webfront/DOM/xmldoc_document_type.h similarity index 100% rename from HTTPServer/xmldoc_document_type.h rename to webfront/DOM/xmldoc_document_type.h diff --git a/HTTPServer/xmldoc_dom_exception.h b/webfront/DOM/xmldoc_dom_exception.h similarity index 100% rename from HTTPServer/xmldoc_dom_exception.h rename to webfront/DOM/xmldoc_dom_exception.h diff --git a/HTTPServer/xmldoc_dom_implementation.cpp b/webfront/DOM/xmldoc_dom_implementation.cpp similarity index 100% rename from HTTPServer/xmldoc_dom_implementation.cpp rename to webfront/DOM/xmldoc_dom_implementation.cpp diff --git a/HTTPServer/xmldoc_dom_implementation.h b/webfront/DOM/xmldoc_dom_implementation.h similarity index 100% rename from HTTPServer/xmldoc_dom_implementation.h rename to webfront/DOM/xmldoc_dom_implementation.h diff --git a/HTTPServer/xmldoc_element.cpp b/webfront/DOM/xmldoc_element.cpp similarity index 100% rename from HTTPServer/xmldoc_element.cpp rename to webfront/DOM/xmldoc_element.cpp diff --git a/HTTPServer/xmldoc_element.h b/webfront/DOM/xmldoc_element.h similarity index 100% rename from HTTPServer/xmldoc_element.h rename to webfront/DOM/xmldoc_element.h diff --git a/HTTPServer/xmldoc_entity_reference.h b/webfront/DOM/xmldoc_entity_reference.h similarity index 100% rename from HTTPServer/xmldoc_entity_reference.h rename to webfront/DOM/xmldoc_entity_reference.h diff --git a/HTTPServer/xmldoc_named_node_map.cpp b/webfront/DOM/xmldoc_named_node_map.cpp similarity index 100% rename from HTTPServer/xmldoc_named_node_map.cpp rename to webfront/DOM/xmldoc_named_node_map.cpp diff --git a/HTTPServer/xmldoc_named_node_map.h b/webfront/DOM/xmldoc_named_node_map.h similarity index 100% rename from HTTPServer/xmldoc_named_node_map.h rename to webfront/DOM/xmldoc_named_node_map.h diff --git a/HTTPServer/xmldoc_node.cpp b/webfront/DOM/xmldoc_node.cpp similarity index 100% rename from HTTPServer/xmldoc_node.cpp rename to webfront/DOM/xmldoc_node.cpp diff --git a/HTTPServer/xmldoc_node.h b/webfront/DOM/xmldoc_node.h similarity index 100% rename from HTTPServer/xmldoc_node.h rename to webfront/DOM/xmldoc_node.h diff --git a/HTTPServer/xmldoc_node_list.h b/webfront/DOM/xmldoc_node_list.h similarity index 100% rename from HTTPServer/xmldoc_node_list.h rename to webfront/DOM/xmldoc_node_list.h diff --git a/HTTPServer/xmldoc_processing_instruction.h b/webfront/DOM/xmldoc_processing_instruction.h similarity index 100% rename from HTTPServer/xmldoc_processing_instruction.h rename to webfront/DOM/xmldoc_processing_instruction.h diff --git a/HTTPServer/xmldoc_text.cpp b/webfront/DOM/xmldoc_text.cpp similarity index 100% rename from HTTPServer/xmldoc_text.cpp rename to webfront/DOM/xmldoc_text.cpp diff --git a/HTTPServer/xmldoc_text.h b/webfront/DOM/xmldoc_text.h similarity index 100% rename from HTTPServer/xmldoc_text.h rename to webfront/DOM/xmldoc_text.h From b2d8c76feb7109570d83e6a0c078442051ab935b Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Sat, 23 Feb 2019 23:07:10 +0100 Subject: [PATCH 006/118] Cleanup --- webfront/DOM/ReadMe.txt | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 webfront/DOM/ReadMe.txt diff --git a/webfront/DOM/ReadMe.txt b/webfront/DOM/ReadMe.txt deleted file mode 100644 index d2087a53..00000000 --- a/webfront/DOM/ReadMe.txt +++ /dev/null @@ -1,40 +0,0 @@ -======================================================================== - CONSOLE APPLICATION : HTTPServer Project Overview -======================================================================== - -AppWizard has created this HTTPServer application for you. - -This file contains a summary of what you will find in each of the files that -make up your HTTPServer application. - - -HTTPServer.vcxproj - This is the main project file for VC++ projects generated using an Application Wizard. - It contains information about the version of Visual C++ that generated the file, and - information about the platforms, configurations, and project features selected with the - Application Wizard. - -HTTPServer.vcxproj.filters - This is the filters file for VC++ projects generated using an Application Wizard. - It contains information about the association between the files in your project - and the filters. This association is used in the IDE to show grouping of files with - similar extensions under a specific node (for e.g. ".cpp" files are associated with the - "Source Files" filter). - -HTTPServer.cpp - This is the main application source file. - -///////////////////////////////////////////////////////////////////////////// -Other standard files: - -StdAfx.h, StdAfx.cpp - These files are used to build a precompiled header (PCH) file - named HTTPServer.pch and a precompiled types file named StdAfx.obj. - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" comments to indicate parts of the source code you -should add to or customize. - -///////////////////////////////////////////////////////////////////////////// From 81dfd43b0dc8ce8131faba7f70f16e2f4419667e Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Wed, 27 Feb 2019 13:11:00 +0100 Subject: [PATCH 007/118] Delegate class for callbacks --- webfront/utils/Delegate.hpp | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 webfront/utils/Delegate.hpp diff --git a/webfront/utils/Delegate.hpp b/webfront/utils/Delegate.hpp new file mode 100644 index 00000000..a6b3d80c --- /dev/null +++ b/webfront/utils/Delegate.hpp @@ -0,0 +1,59 @@ +/// @data 31/07/2017 19:32:53 +/// @author Ambroise Leclerc +/// @brief Webfront main UI +// +// Copyright (c) 2017, Ambroise Leclerc +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the +// distribution. +// * Neither the name of the copyright holders nor the names of +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +template +class Delegate { +public: + void call(DelegateArgs... args) { + for (auto& callee : delegates) + callee(args...); + } + + Delegate& operator+=(std::function func) { + delegates.push_back(func); + return *this; + } + + Delegate& operator=(std::function func) { + delegates.clear(); + delegates.push_back(func); + return *this; + } + + bool isDefined() const { return !delegates.empty(); } + +private: + std::list> delegates; +}; \ No newline at end of file From 9d3875dc38ff5012760d25c493af5537a83b6479 Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Wed, 6 Mar 2019 13:21:04 +0100 Subject: [PATCH 008/118] StringHash from ETL library --- webfront/utils/StringHash.hpp | 72 +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 webfront/utils/StringHash.hpp diff --git a/webfront/utils/StringHash.hpp b/webfront/utils/StringHash.hpp new file mode 100644 index 00000000..20c97e35 --- /dev/null +++ b/webfront/utils/StringHash.hpp @@ -0,0 +1,72 @@ +/// @data 31/07/2017 19:32:53 +/// @author Ambroise Leclerc +/// @brief StringHash provides constexpr string hash function in order to generate +/// compile-time integer hashes for string : +/// switch (StringHash::calc(command.c_str())) { +/// case "click"_hash : onClick.call(); break; +/// case "mouseup"_hash : onMouseUp.call(); break; +/// } + +// +// Copyright (c) 2017, Ambroise Leclerc +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the +// distribution. +// * Neither the name of the copyright holders nor the names of +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +class StringHash { +public: + using type = uint32_t; + + static type calc(const char* zStr, type seed = 0) { + while (*zStr) { + seed = seed * 101 + *zStr++; + } + return seed; + } + + template + static type calc(Iter first, Iter last, type seed = 0) { + while (first != last) { + seed = seed * 101 + *first++; + } + return seed; + } + + + +private: + static constexpr type compileTime(const char* zStr, type seed = 0) { + return *zStr ? (compileTime(zStr + 1, (seed * 101ull) + *zStr)) : seed; + } + + friend constexpr type operator""_hash(char const* zStr, size_t); +}; + +constexpr StringHash::type operator""_hash(char const* zStr, size_t) { + return StringHash::compileTime(zStr); +} From 1abeb06b2cc6daf55664f2ea634e835e6a2d73a1 Mon Sep 17 00:00:00 2001 From: AM-L <35537869+AM-L@users.noreply.github.com> Date: Sun, 19 Apr 2020 15:52:49 +0200 Subject: [PATCH 009/118] Unit tests structure (#7) --- tests/3rdParty/catch2/catch.hpp | 17618 ++++++++++++++++ .../catch2/catch_reporter_automake.hpp | 62 + .../catch2/catch_reporter_sonarqube.hpp | 181 + tests/3rdParty/catch2/catch_reporter_tap.hpp | 253 + .../catch2/catch_reporter_teamcity.hpp | 219 + tests/fakeit.hpp | 9394 ++++++++ 6 files changed, 27727 insertions(+) create mode 100644 tests/3rdParty/catch2/catch.hpp create mode 100644 tests/3rdParty/catch2/catch_reporter_automake.hpp create mode 100644 tests/3rdParty/catch2/catch_reporter_sonarqube.hpp create mode 100644 tests/3rdParty/catch2/catch_reporter_tap.hpp create mode 100644 tests/3rdParty/catch2/catch_reporter_teamcity.hpp create mode 100644 tests/fakeit.hpp diff --git a/tests/3rdParty/catch2/catch.hpp b/tests/3rdParty/catch2/catch.hpp new file mode 100644 index 00000000..51618b38 --- /dev/null +++ b/tests/3rdParty/catch2/catch.hpp @@ -0,0 +1,17618 @@ +/* + * Catch v2.11.3 + * Generated: 2020-03-19 13:44:21.042491 + * ---------------------------------------------------------- + * This file has been merged from multiple headers. Please don't edit it directly + * Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +// start catch.hpp + + +#define CATCH_VERSION_MAJOR 2 +#define CATCH_VERSION_MINOR 11 +#define CATCH_VERSION_PATCH 3 + +#ifdef __clang__ +# pragma clang system_header +#elif defined __GNUC__ +# pragma GCC system_header +#endif + +// start catch_suppress_warnings.h + +#ifdef __clang__ +# ifdef __ICC // icpc defines the __clang__ macro +# pragma warning(push) +# pragma warning(disable: 161 1682) +# else // __ICC +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wswitch-enum" +# pragma clang diagnostic ignored "-Wcovered-switch-default" +# endif +#elif defined __GNUC__ + // Because REQUIREs trigger GCC's -Wparentheses, and because still + // supported version of g++ have only buggy support for _Pragmas, + // Wparentheses have to be suppressed globally. +# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details + +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-variable" +# pragma GCC diagnostic ignored "-Wpadded" +#endif +// end catch_suppress_warnings.h +#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) +# define CATCH_IMPL +# define CATCH_CONFIG_ALL_PARTS +#endif + +// In the impl file, we want to have access to all parts of the headers +// Can also be used to sanely support PCHs +#if defined(CATCH_CONFIG_ALL_PARTS) +# define CATCH_CONFIG_EXTERNAL_INTERFACES +# if defined(CATCH_CONFIG_DISABLE_MATCHERS) +# undef CATCH_CONFIG_DISABLE_MATCHERS +# endif +# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) +# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER +# endif +#endif + +#if !defined(CATCH_CONFIG_IMPL_ONLY) +// start catch_platform.h + +#ifdef __APPLE__ +# include +# if TARGET_OS_OSX == 1 +# define CATCH_PLATFORM_MAC +# elif TARGET_OS_IPHONE == 1 +# define CATCH_PLATFORM_IPHONE +# endif + +#elif defined(linux) || defined(__linux) || defined(__linux__) +# define CATCH_PLATFORM_LINUX + +#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) +# define CATCH_PLATFORM_WINDOWS +#endif + +// end catch_platform.h + +#ifdef CATCH_IMPL +# ifndef CLARA_CONFIG_MAIN +# define CLARA_CONFIG_MAIN_NOT_DEFINED +# define CLARA_CONFIG_MAIN +# endif +#endif + +// start catch_user_interfaces.h + +namespace Catch { + unsigned int rngSeed(); +} + +// end catch_user_interfaces.h +// start catch_tag_alias_autoregistrar.h + +// start catch_common.h + +// start catch_compiler_capabilities.h + +// Detect a number of compiler features - by compiler +// The following features are defined: +// +// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? +// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? +// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? +// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled? +// **************** +// Note to maintainers: if new toggles are added please document them +// in configuration.md, too +// **************** + +// In general each macro has a _NO_ form +// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature. +// Many features, at point of detection, define an _INTERNAL_ macro, so they +// can be combined, en-mass, with the _NO_ forms later. + +#ifdef __cplusplus + +# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) +# define CATCH_CPP14_OR_GREATER +# endif + +# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) +# define CATCH_CPP17_OR_GREATER +# endif + +#endif + +#if defined(CATCH_CPP17_OR_GREATER) +# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +#endif + +// We have to avoid both ICC and Clang, because they try to mask themselves +// as gcc, and we want only GCC in this block +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" ) + +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) + +#endif + +#if defined(__clang__) + +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" ) + +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) + +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ + _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") + +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" ) + +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-template\"" ) + +#endif // __clang__ + +//////////////////////////////////////////////////////////////////////////////// +// Assume that non-Windows platforms support posix signals by default +#if !defined(CATCH_PLATFORM_WINDOWS) + #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS +#endif + +//////////////////////////////////////////////////////////////////////////////// +// We know some environments not to support full POSIX signals +#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__) + #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +#endif + +#ifdef __OS400__ +# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +# define CATCH_CONFIG_COLOUR_NONE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Android somehow still does not support std::to_string +#if defined(__ANDROID__) +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING +# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Not all Windows environments support SEH properly +#if defined(__MINGW32__) +# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH +#endif + +//////////////////////////////////////////////////////////////////////////////// +// PS4 +#if defined(__ORBIS__) +# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Cygwin +#ifdef __CYGWIN__ + +// Required for some versions of Cygwin to declare gettimeofday +// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin +# define _BSD_SOURCE +// some versions of cygwin (most) do not support std::to_string. Use the libstd check. +// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813 +# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ + && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) + +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING + +# endif +#endif // __CYGWIN__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#if defined(_MSC_VER) + +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) ) + +# if _MSC_VER >= 1900 // Visual Studio 2015 or newer +# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +# endif + +// Universal Windows platform does not support SEH +// Or console colours (or console at all...) +# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) +# define CATCH_CONFIG_COLOUR_NONE +# else +# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH +# endif + +// MSVC traditional preprocessor needs some workaround for __VA_ARGS__ +// _MSVC_TRADITIONAL == 0 means new conformant preprocessor +// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor +# if !defined(__clang__) // Handle Clang masquerading for msvc +# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) +# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +# endif // MSVC_TRADITIONAL +# endif // __clang__ + +#endif // _MSC_VER + +#if defined(_REENTRANT) || defined(_MSC_VER) +// Enable async processing, as -pthread is specified or no additional linking is required +# define CATCH_INTERNAL_CONFIG_USE_ASYNC +#endif // _MSC_VER + +//////////////////////////////////////////////////////////////////////////////// +// Check if we are compiled with -fno-exceptions or equivalent +#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) +# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED +#endif + +//////////////////////////////////////////////////////////////////////////////// +// DJGPP +#ifdef __DJGPP__ +# define CATCH_INTERNAL_CONFIG_NO_WCHAR +#endif // __DJGPP__ + +//////////////////////////////////////////////////////////////////////////////// +// Embarcadero C++Build +#if defined(__BORLANDC__) + #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN +#endif + +//////////////////////////////////////////////////////////////////////////////// + +// Use of __COUNTER__ is suppressed during code analysis in +// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly +// handled by it. +// Otherwise all supported compilers support COUNTER macro, +// but user still might want to turn it off +#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) + #define CATCH_INTERNAL_CONFIG_COUNTER +#endif + +//////////////////////////////////////////////////////////////////////////////// + +// RTX is a special version of Windows that is real time. +// This means that it is detected as Windows, but does not provide +// the same set of capabilities as real Windows does. +#if defined(UNDER_RTSS) || defined(RTX64_BUILD) + #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH + #define CATCH_INTERNAL_CONFIG_NO_ASYNC + #define CATCH_CONFIG_COLOUR_NONE +#endif + +#if !defined(_GLIBCXX_USE_C99_MATH_TR1) +#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER +#endif + +// Various stdlib support checks that require __has_include +#if defined(__has_include) + // Check if string_view is available and usable + #if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW + #endif + + // Check if optional is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if byte is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_BYTE + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if variant is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # if defined(__clang__) && (__clang_major__ < 8) + // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 + // fix should be in clang 8, workaround in libstdc++ 8.2 + # include + # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # define CATCH_CONFIG_NO_CPP17_VARIANT + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__clang__) && (__clang_major__ < 8) + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) +#endif // defined(__has_include) + +#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) +# define CATCH_CONFIG_COUNTER +#endif +#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) +# define CATCH_CONFIG_WINDOWS_SEH +#endif +// This is set by default, because we assume that unix compilers are posix-signal-compatible by default. +#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) +# define CATCH_CONFIG_POSIX_SIGNALS +#endif +// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions. +#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR) +# define CATCH_CONFIG_WCHAR +#endif + +#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) +# define CATCH_CONFIG_CPP11_TO_STRING +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) +# define CATCH_CONFIG_CPP17_OPTIONAL +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) +# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) +# define CATCH_CONFIG_CPP17_STRING_VIEW +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT) +# define CATCH_CONFIG_CPP17_VARIANT +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE) +# define CATCH_CONFIG_CPP17_BYTE +#endif + +#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) +# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE +#endif + +#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE) +# define CATCH_CONFIG_NEW_CAPTURE +#endif + +#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +# define CATCH_CONFIG_DISABLE_EXCEPTIONS +#endif + +#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) +# define CATCH_CONFIG_POLYFILL_ISNAN +#endif + +#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC) +# define CATCH_CONFIG_USE_ASYNC +#endif + +#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE) +# define CATCH_CONFIG_ANDROID_LOGWRITE +#endif + +#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) +# define CATCH_CONFIG_GLOBAL_NEXTAFTER +#endif + +// Even if we do not think the compiler has that warning, we still have +// to provide a macro that can be used by the code. +#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION +#endif +#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS +#endif + +// The goal of this macro is to avoid evaluation of the arguments, but +// still have the compiler warn on problems inside... +#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN) +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) +#endif + +#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#elif defined(__clang__) && (__clang_major__ < 5) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif + +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif + +#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +#define CATCH_TRY if ((true)) +#define CATCH_CATCH_ALL if ((false)) +#define CATCH_CATCH_ANON(type) if ((false)) +#else +#define CATCH_TRY try +#define CATCH_CATCH_ALL catch (...) +#define CATCH_CATCH_ANON(type) catch (type) +#endif + +#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) +#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#endif + +// end catch_compiler_capabilities.h +#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line +#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) +#ifdef CATCH_CONFIG_COUNTER +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) +#else +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) +#endif + +#include +#include +#include + +// We need a dummy global operator<< so we can bring it into Catch namespace later +struct Catch_global_namespace_dummy {}; +std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); + +namespace Catch { + + struct CaseSensitive { enum Choice { + Yes, + No + }; }; + + class NonCopyable { + NonCopyable( NonCopyable const& ) = delete; + NonCopyable( NonCopyable && ) = delete; + NonCopyable& operator = ( NonCopyable const& ) = delete; + NonCopyable& operator = ( NonCopyable && ) = delete; + + protected: + NonCopyable(); + virtual ~NonCopyable(); + }; + + struct SourceLineInfo { + + SourceLineInfo() = delete; + SourceLineInfo( char const* _file, std::size_t _line ) noexcept + : file( _file ), + line( _line ) + {} + + SourceLineInfo( SourceLineInfo const& other ) = default; + SourceLineInfo& operator = ( SourceLineInfo const& ) = default; + SourceLineInfo( SourceLineInfo&& ) noexcept = default; + SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; + + bool empty() const noexcept { return file[0] == '\0'; } + bool operator == ( SourceLineInfo const& other ) const noexcept; + bool operator < ( SourceLineInfo const& other ) const noexcept; + + char const* file; + std::size_t line; + }; + + std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); + + // Bring in operator<< from global namespace into Catch namespace + // This is necessary because the overload of operator<< above makes + // lookup stop at namespace Catch + using ::operator<<; + + // Use this in variadic streaming macros to allow + // >> +StreamEndStop + // as well as + // >> stuff +StreamEndStop + struct StreamEndStop { + std::string operator+() const; + }; + template + T const& operator + ( T const& value, StreamEndStop ) { + return value; + } +} + +#define CATCH_INTERNAL_LINEINFO \ + ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) + +// end catch_common.h +namespace Catch { + + struct RegistrarForTagAliases { + RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); + }; + +} // end namespace Catch + +#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION + +// end catch_tag_alias_autoregistrar.h +// start catch_test_registry.h + +// start catch_interfaces_testcase.h + +#include + +namespace Catch { + + class TestSpec; + + struct ITestInvoker { + virtual void invoke () const = 0; + virtual ~ITestInvoker(); + }; + + class TestCase; + struct IConfig; + + struct ITestCaseRegistry { + virtual ~ITestCaseRegistry(); + virtual std::vector const& getAllTests() const = 0; + virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; + }; + + bool isThrowSafe( TestCase const& testCase, IConfig const& config ); + bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); + std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); + std::vector const& getAllTestCasesSorted( IConfig const& config ); + +} + +// end catch_interfaces_testcase.h +// start catch_stringref.h + +#include +#include +#include +#include + +namespace Catch { + + /// A non-owning string class (similar to the forthcoming std::string_view) + /// Note that, because a StringRef may be a substring of another string, + /// it may not be null terminated. + class StringRef { + public: + using size_type = std::size_t; + using const_iterator = const char*; + + private: + static constexpr char const* const s_empty = ""; + + char const* m_start = s_empty; + size_type m_size = 0; + + public: // construction + constexpr StringRef() noexcept = default; + + StringRef( char const* rawChars ) noexcept; + + constexpr StringRef( char const* rawChars, size_type size ) noexcept + : m_start( rawChars ), + m_size( size ) + {} + + StringRef( std::string const& stdString ) noexcept + : m_start( stdString.c_str() ), + m_size( stdString.size() ) + {} + + explicit operator std::string() const { + return std::string(m_start, m_size); + } + + public: // operators + auto operator == ( StringRef const& other ) const noexcept -> bool; + auto operator != (StringRef const& other) const noexcept -> bool { + return !(*this == other); + } + + auto operator[] ( size_type index ) const noexcept -> char { + assert(index < m_size); + return m_start[index]; + } + + public: // named queries + constexpr auto empty() const noexcept -> bool { + return m_size == 0; + } + constexpr auto size() const noexcept -> size_type { + return m_size; + } + + // Returns the current start pointer. If the StringRef is not + // null-terminated, throws std::domain_exception + auto c_str() const -> char const*; + + public: // substrings and searches + // Returns a substring of [start, start + length). + // If start + length > size(), then the substring is [start, size()). + // If start > size(), then the substring is empty. + auto substr( size_type start, size_type length ) const noexcept -> StringRef; + + // Returns the current start pointer. May not be null-terminated. + auto data() const noexcept -> char const*; + + constexpr auto isNullTerminated() const noexcept -> bool { + return m_start[m_size] == '\0'; + } + + public: // iterators + constexpr const_iterator begin() const { return m_start; } + constexpr const_iterator end() const { return m_start + m_size; } + }; + + auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&; + auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&; + + constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { + return StringRef( rawChars, size ); + } +} // namespace Catch + +constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { + return Catch::StringRef( rawChars, size ); +} + +// end catch_stringref.h +// start catch_preprocessor.hpp + + +#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ +#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) + +#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ +// MSVC needs more evaluations +#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) +#else +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) +#endif + +#define CATCH_REC_END(...) +#define CATCH_REC_OUT + +#define CATCH_EMPTY() +#define CATCH_DEFER(id) id CATCH_EMPTY() + +#define CATCH_REC_GET_END2() 0, CATCH_REC_END +#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 +#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 +#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT +#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) +#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) + +#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) + +#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) + +// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, +// and passes userdata as the first parameter to each invocation, +// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) +#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) +#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ +#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ +#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) +#else +// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) +#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) +#endif + +#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__ +#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name) + +#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper()) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) +#else +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper())) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) +#endif + +#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\ + CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__) + +#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0) +#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1) +#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2) +#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3) +#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4) +#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5) +#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _4, _5, _6) +#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7) +#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8) +#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9) +#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) + +#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N + +#define INTERNAL_CATCH_TYPE_GEN\ + template struct TypeList {};\ + template\ + constexpr auto get_wrapper() noexcept -> TypeList { return {}; }\ + template class...> struct TemplateTypeList{};\ + template class...Cs>\ + constexpr auto get_wrapper() noexcept -> TemplateTypeList { return {}; }\ + template\ + struct append;\ + template\ + struct rewrap;\ + template class, typename...>\ + struct create;\ + template class, typename>\ + struct convert;\ + \ + template \ + struct append { using type = T; };\ + template< template class L1, typename...E1, template class L2, typename...E2, typename...Rest>\ + struct append, L2, Rest...> { using type = typename append, Rest...>::type; };\ + template< template class L1, typename...E1, typename...Rest>\ + struct append, TypeList, Rest...> { using type = L1; };\ + \ + template< template class Container, template class List, typename...elems>\ + struct rewrap, List> { using type = TypeList>; };\ + template< template class Container, template class List, class...Elems, typename...Elements>\ + struct rewrap, List, Elements...> { using type = typename append>, typename rewrap, Elements...>::type>::type; };\ + \ + template