Loading LICENSE→LICENSE.txt +0 −0 File moved. View file examples/httpsysinfo.cpp +44 −0 Original line number Diff line number Diff line Loading @@ -118,7 +118,51 @@ public: if(sysdiv) /*append table to dom element sysdiv*/ sysdiv->appendChild(div); #else /*create htmltable widget*/ libhtmlpp::HtmlTable htmltable; OSVERSIONINFOW info; memset(&info,0,sizeof(OSVERSIONINFOW)); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&info); SYSTEM_INFO usysinfo; memset(&usysinfo, 0, sizeof(SYSTEM_INFO)); GetSystemInfo(&usysinfo); libhtmlpp::HtmlString rver; rver << (size_t)info.dwMajorVersion << "." << (size_t)info.dwMinorVersion << "(" << (size_t)info.dwBuildNumber << ")"; /*create table rows*/ htmltable << libhtmlpp::HtmlTable::Row() << "Operating system: " << "Windows"; htmltable << libhtmlpp::HtmlTable::Row() << "Release Version: " << rver; htmltable << libhtmlpp::HtmlTable::Row() << "Hardware: " << usysinfo.wProcessorArchitecture; libhtmlpp::HtmlElement table; /*convert htmltable to dom HtmlElement*/ htmltable.insert(&table); /*set css class for the table*/ table.setAttribute("class", "kinfo"); /*HtmlString Accepts Html Raw input*/ libhtmlpp::HtmlString html; html << "<div><span>KernelInfo:</span> <br/> </div> "; /*convert Htmlstring to Html Dom element*/ libhtmlpp::HtmlElement* div = (libhtmlpp::HtmlElement*)html.parse(); /*append table to dom element div*/ div->appendChild(&table); /* search HtmlElement with id sysinfo */ libhtmlpp::HtmlElement* sysdiv = index.getElementbyID("sysinfo"); if (sysdiv) /*append table to dom element sysdiv*/ sysdiv->appendChild(div); #endif } Loading src/CMakeLists.txt +14 −0 Original line number Diff line number Diff line Loading @@ -94,3 +94,17 @@ install( COMPONENT Devel ) if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows") set(CPACK_GENERATOR WIX) set(CPACK_PACKAGE_NAME "libhttppp") set(CPACK_PACKAGE_VENDOR "tuxist.de") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libhttppp - A C++ Http Library") set(CPACK_PACKAGE_VERSION "1.0.0") set(CPACK_PACKAGE_VERSION_MAJOR "1") set(CPACK_PACKAGE_VERSION_MINOR "0") set(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_INSTALL_DIRECTORY "libhttppp") INCLUDE(CPack) endif() No newline at end of file src/http.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -389,7 +389,7 @@ size_t libhttppp::HttpResponse::parse(const char *data,size_t inlen){ --ve; std::copy(data+v,data+ve,std::begin(_State)); std::copy(data+v,data+ve,std::back_inserter(_State)); ++ve; Loading Loading
examples/httpsysinfo.cpp +44 −0 Original line number Diff line number Diff line Loading @@ -118,7 +118,51 @@ public: if(sysdiv) /*append table to dom element sysdiv*/ sysdiv->appendChild(div); #else /*create htmltable widget*/ libhtmlpp::HtmlTable htmltable; OSVERSIONINFOW info; memset(&info,0,sizeof(OSVERSIONINFOW)); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&info); SYSTEM_INFO usysinfo; memset(&usysinfo, 0, sizeof(SYSTEM_INFO)); GetSystemInfo(&usysinfo); libhtmlpp::HtmlString rver; rver << (size_t)info.dwMajorVersion << "." << (size_t)info.dwMinorVersion << "(" << (size_t)info.dwBuildNumber << ")"; /*create table rows*/ htmltable << libhtmlpp::HtmlTable::Row() << "Operating system: " << "Windows"; htmltable << libhtmlpp::HtmlTable::Row() << "Release Version: " << rver; htmltable << libhtmlpp::HtmlTable::Row() << "Hardware: " << usysinfo.wProcessorArchitecture; libhtmlpp::HtmlElement table; /*convert htmltable to dom HtmlElement*/ htmltable.insert(&table); /*set css class for the table*/ table.setAttribute("class", "kinfo"); /*HtmlString Accepts Html Raw input*/ libhtmlpp::HtmlString html; html << "<div><span>KernelInfo:</span> <br/> </div> "; /*convert Htmlstring to Html Dom element*/ libhtmlpp::HtmlElement* div = (libhtmlpp::HtmlElement*)html.parse(); /*append table to dom element div*/ div->appendChild(&table); /* search HtmlElement with id sysinfo */ libhtmlpp::HtmlElement* sysdiv = index.getElementbyID("sysinfo"); if (sysdiv) /*append table to dom element sysdiv*/ sysdiv->appendChild(div); #endif } Loading
src/CMakeLists.txt +14 −0 Original line number Diff line number Diff line Loading @@ -94,3 +94,17 @@ install( COMPONENT Devel ) if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows") set(CPACK_GENERATOR WIX) set(CPACK_PACKAGE_NAME "libhttppp") set(CPACK_PACKAGE_VENDOR "tuxist.de") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libhttppp - A C++ Http Library") set(CPACK_PACKAGE_VERSION "1.0.0") set(CPACK_PACKAGE_VERSION_MAJOR "1") set(CPACK_PACKAGE_VERSION_MINOR "0") set(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_INSTALL_DIRECTORY "libhttppp") INCLUDE(CPack) endif() No newline at end of file
src/http.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -389,7 +389,7 @@ size_t libhttppp::HttpResponse::parse(const char *data,size_t inlen){ --ve; std::copy(data+v,data+ve,std::begin(_State)); std::copy(data+v,data+ve,std::back_inserter(_State)); ++ve; Loading