Commit 17256447 authored by Mathieu Stefani's avatar Mathieu Stefani

Deploy website - based on 2ef5b865

parent 1a07f80f
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
This diff is collapsed.
(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{94:function(e,t,a){"use strict";a.r(t);var n=a(0),o=a.n(n),l=a(92);t.default=function(){return o.a.createElement(l.a,{title:"Page Not Found"},o.a.createElement("main",{className:"container margin-vert--xl"},o.a.createElement("div",{className:"row"},o.a.createElement("div",{className:"col col--6 col--offset-3"},o.a.createElement("h1",{className:"hero__title"},"Page Not Found"),o.a.createElement("p",null,"We could not find what you were looking for."),o.a.createElement("p",null,"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))}}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{82:function(e,t,a){"use strict";a.r(t);var n=a(0),l=a.n(n),r=a(24),c=a(83),i=a(22),o=a(87),m=a(86);var s=function(e){var t=e.metadata;return l.a.createElement("nav",{className:"pagination-nav","aria-label":"Blog list page navigation"},l.a.createElement("div",{className:"pagination-nav__item"},t.previous&&l.a.createElement(m.a,{className:"pagination-nav__link",to:t.previous.permalink},l.a.createElement("div",{className:"pagination-nav__sublabel"},"Previous"),l.a.createElement("div",{className:"pagination-nav__label"},"\xab ",t.previous.title))),l.a.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},t.next&&l.a.createElement(m.a,{className:"pagination-nav__link",to:t.next.permalink},l.a.createElement("div",{className:"pagination-nav__sublabel"},"Next"),l.a.createElement("div",{className:"pagination-nav__label"},t.next.title," \xbb"))))},d=a(85);var u=function(){var e=Object(i.default)().siteConfig.title,t=Object(d.useActivePlugin)({failfast:!0}).pluginId,a=Object(c.useDocsPreferredVersion)(t).savePreferredVersionName,n=Object(d.useActiveVersion)(t),r=Object(d.useDocVersionSuggestions)(t),o=r.latestDocSuggestion,s=r.latestVersionSuggestion;if(!s)return l.a.createElement(l.a.Fragment,null);var u,v=null!=o?o:(u=s).docs.find((function(e){return e.id===u.mainDocId}));return l.a.createElement("div",{className:"alert alert--warning margin-bottom--md",role:"alert"},"current"===n.name?l.a.createElement("div",null,"This is unreleased documentation for ",e," ",l.a.createElement("strong",null,n.label)," version."):l.a.createElement("div",null,"This is documentation for ",e," ",l.a.createElement("strong",null,n.label),", which is no longer actively maintained."),l.a.createElement("div",{className:"margin-top--md"},"For up-to-date documentation, see the"," ",l.a.createElement("strong",null,l.a.createElement(m.a,{to:v.path,onClick:function(){return a(s.name)}},"latest version"))," ","(",s.label,")."))},v=a(84);var E=function(e,t,a){var l=Object(n.useState)(void 0),r=l[0],c=l[1];Object(n.useEffect)((function(){function n(){var n=function(){var e=Array.from(document.getElementsByClassName("anchor")),t=e.find((function(e){return e.getBoundingClientRect().top>=a}));if(t){if(t.getBoundingClientRect().top>=a){var n=e[e.indexOf(t)-1];return null!=n?n:t}return t}return e[e.length-1]}();if(n)for(var l=0,i=!1,o=document.getElementsByClassName(e);l<o.length&&!i;){var m=o[l],s=m.href,d=decodeURIComponent(s.substring(s.indexOf("#")+1));n.id===d&&(r&&r.classList.remove(t),m.classList.add(t),c(m),i=!0),l+=1}}return document.addEventListener("scroll",n),document.addEventListener("resize",n),n(),function(){document.removeEventListener("scroll",n),document.removeEventListener("resize",n)}}))},g=a(63),f=a.n(g),p="table-of-contents__link";function b(e){var t=e.toc,a=e.isChild;return t.length?l.a.createElement("ul",{className:a?"":"table-of-contents table-of-contents__left-border"},t.map((function(e){return l.a.createElement("li",{key:e.id},l.a.createElement("a",{href:"#"+e.id,className:p,dangerouslySetInnerHTML:{__html:e.value}}),l.a.createElement(b,{isChild:!0,toc:e.children}))}))):null}var N=function(e){var t=e.toc;return E(p,"table-of-contents__link--active",100),l.a.createElement("div",{className:Object(v.a)(f.a.tableOfContents,"thin-scrollbar")},l.a.createElement(b,{toc:t}))},h=a(3),_=a(7),O=a(64),j=a.n(O),w=function(e){var t=e.className,a=Object(_.a)(e,["className"]);return l.a.createElement("svg",Object(h.a)({fill:"currentColor",height:"1.2em",width:"1.2em",preserveAspectRatio:"xMidYMid meet",role:"img",viewBox:"0 0 40 40",className:Object(v.a)(j.a.iconEdit,t)},a),l.a.createElement("g",null,l.a.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})))},k=a(65),y=a.n(k);t.default=function(e){var t,a=Object(i.default)().siteConfig.url,n=e.content,m=n.metadata,E=n.frontMatter,g=E.image,f=E.keywords,p=E.hide_title,b=E.hide_table_of_contents,h=m.description,_=m.title,O=m.permalink,j=m.editUrl,k=m.lastUpdatedAt,C=m.lastUpdatedBy,x=Object(d.useActivePlugin)({failfast:!0}).pluginId,L=Object(d.useVersions)(x),I=Object(d.useActiveVersion)(x),A=L.length>1,S=Object(c.useTitleFormatter)(_),V=Object(o.a)(g,{absolute:!0});return l.a.createElement(l.a.Fragment,null,l.a.createElement(r.a,null,l.a.createElement("title",null,S),l.a.createElement("meta",{property:"og:title",content:S}),h&&l.a.createElement("meta",{name:"description",content:h}),h&&l.a.createElement("meta",{property:"og:description",content:h}),f&&f.length&&l.a.createElement("meta",{name:"keywords",content:f.join(",")}),g&&l.a.createElement("meta",{property:"og:image",content:V}),g&&l.a.createElement("meta",{name:"twitter:image",content:V}),g&&l.a.createElement("meta",{name:"twitter:image:alt",content:"Image for "+_}),O&&l.a.createElement("meta",{property:"og:url",content:a+O}),O&&l.a.createElement("link",{rel:"canonical",href:a+O})),l.a.createElement("div",{className:"row"},l.a.createElement("div",{className:Object(v.a)("col",(t={},t[y.a.docItemCol]=!b,t))},l.a.createElement(u,null),l.a.createElement("div",{className:y.a.docItemContainer},l.a.createElement("article",null,A&&l.a.createElement("div",null,l.a.createElement("span",{className:"badge badge--secondary"},"Version: ",I.label)),!p&&l.a.createElement("header",null,l.a.createElement("h1",{className:y.a.docTitle},_)),l.a.createElement("div",{className:"markdown"},l.a.createElement(n,null))),(j||k||C)&&l.a.createElement("div",{className:"margin-vert--xl"},l.a.createElement("div",{className:"row"},l.a.createElement("div",{className:"col"},j&&l.a.createElement("a",{href:j,target:"_blank",rel:"noreferrer noopener"},l.a.createElement(w,null),"Edit this page")),(k||C)&&l.a.createElement("div",{className:"col text--right"},l.a.createElement("em",null,l.a.createElement("small",null,"Last updated"," ",k&&l.a.createElement(l.a.Fragment,null,"on"," ",l.a.createElement("time",{dateTime:new Date(1e3*k).toISOString(),className:y.a.docLastUpdatedAt},new Date(1e3*k).toLocaleDateString()),C&&" "),C&&l.a.createElement(l.a.Fragment,null,"by ",l.a.createElement("strong",null,C)),!1))))),l.a.createElement("div",{className:"margin-vert--lg"},l.a.createElement(s,{metadata:m})))),!b&&n.toc&&l.a.createElement("div",{className:"col col--3"},l.a.createElement(N,{toc:n.toc}))))}}}]);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{72:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return s})),n.d(t,"metadata",(function(){return r})),n.d(t,"toc",(function(){return c})),n.d(t,"default",(function(){return p}));var a=n(3),l=n(7),i=(n(0),n(88)),s={title:"Getting started",slug:"/"},r={unversionedId:"quickstart",id:"quickstart",isDocsHomePage:!1,title:"Getting started",description:"Pistache is a web framework written in Modern C++ that focuses on performance and provides an elegant and asynchronous API.",source:"@site/docs/quickstart.md",slug:"/",permalink:"/docs/",editUrl:"https://github.com/pistacheio/pistache/edit/master/pistache.io/docs/quickstart.md",version:"current",sidebar:"leftSidebar",next:{title:"HTTP handler",permalink:"/docs/http-handler"}},c=[{value:"Installing Pistache",id:"installing-pistache",children:[]},{value:"Serving requests",id:"serving-requests",children:[{value:"Include",id:"include",children:[]},{value:"Hello world",id:"hello-world",children:[]},{value:"Final touch",id:"final-touch",children:[]}]}],o={toc:c};function p(e){var t=e.components,n=Object(l.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},o,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)("p",null,"Pistache is a web framework written in Modern C++ that focuses on performance and provides an elegant and asynchronous API."),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-cpp"},"#include <pistache/pistache.h>\n")),Object(i.b)("h2",{id:"installing-pistache"},"Installing Pistache"),Object(i.b)("p",null,Object(i.b)("a",{parentName:"p",href:"https://git-scm.com"},"git")," is needed to retrieve the sources. Compiling the sources will require ",Object(i.b)("a",{parentName:"p",href:"https://cmake.org"},"CMake")," to generate build files and a recent compiler that supports C++17."),Object(i.b)("p",null,"If you're on Ubuntu and want to skip the compilation process you can add the official PPA providing nightly builds:"),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-shell"},"sudo add-apt-repository ppa:pistache+team/unstable\nsudo apt update\nsudo apt install libpistache-dev\n")),Object(i.b)("p",null,"Otherwise, here's how to build and install the latest release:"),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-shell"},"git clone --recurse-submodules https://github.com/pistacheio/pistache.git\ncd pistache\nmkdir build && cd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\nmake\nsudo make install\n")),Object(i.b)("p",null,"Also, Pistache does not support Windows yet, but should work fine under ",Object(i.b)("a",{parentName:"p",href:"https://docs.microsoft.com/windows/wsl/about"},"WSL"),"."),Object(i.b)("h2",{id:"serving-requests"},"Serving requests"),Object(i.b)("h3",{id:"include"},"Include"),Object(i.b)("p",null,"First, let\u2019s start by including the right header."),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-cpp"},"#include <pistache/endpoint.h>\n")),Object(i.b)("h3",{id:"hello-world"},"Hello world"),Object(i.b)("p",null,"Requests received by Pistache are handled with an ",Object(i.b)("inlineCode",{parentName:"p"},"Http::Handler"),"."),Object(i.b)("p",null,"Let\u2019s start by defining a simple ",Object(i.b)("inlineCode",{parentName:"p"},"HelloHandler"),":"),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-cpp"},'using namespace Pistache;\n\nclass HelloHandler : public Http::Handler {\npublic:\n\n HTTP_PROTOTYPE(HelloHandler)\n\n void onRequest(const Http::Request& request, Http::ResponseWriter response) {\n response.send(Http::Code::Ok, "Hello, World\\n");\n }\n};\n')),Object(i.b)("p",null,"Handlers must inherit the ",Object(i.b)("inlineCode",{parentName:"p"},"Http::Handler")," class and at least define the ",Object(i.b)("inlineCode",{parentName:"p"},"onRequest")," member function. They must also define a ",Object(i.b)("inlineCode",{parentName:"p"},"clone()")," member function. Simple handlers can use the special ",Object(i.b)("inlineCode",{parentName:"p"},"HTTP_PROTOTYPE")," macro, passing in the name of the class. The macro will take care of defining the ",Object(i.b)("inlineCode",{parentName:"p"},"clone()")," member function for you."),Object(i.b)("h3",{id:"final-touch"},"Final touch"),Object(i.b)("p",null,"After defining the handler, the server can now be started:"),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-cpp"},"int main() {\n Address addr(Ipv4::any(), Port(9080));\n\n auto opts = Http::Endpoint::options().threads(1);\n Http::Endpoint server(addr);\n server.init(opts);\n server.setHandler(Http::make_handler<HelloHandler>());\n server.serve();\n}\n")),Object(i.b)("p",null,"For simplicity, you can also use the special ",Object(i.b)("inlineCode",{parentName:"p"},"listenAndServe")," function that will automatically create an endpoint and instantiate your handler:"),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-cpp"},'int main() {\n Http::listenAndServe<HelloHandler>("*:9080");\n}\n')),Object(i.b)("p",null,"And that\u2019s it, now you can fire up your favorite curl request and observe the final result:"),Object(i.b)("pre",null,Object(i.b)("code",{parentName:"pre",className:"language-shell"},"curl http://localhost:9080/\nHello, World\n")),Object(i.b)("p",null,"Complete code for this example can be found on GitHub: ",Object(i.b)("a",{parentName:"p",href:"https://github.com/pistacheio/pistache/blob/master/examples/hello_server.cc"},"examples/hello_server.cc")))}p.isMDXComponent=!0}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{73:function(t,e,i){"use strict";i.r(e),i.d(e,"frontMatter",(function(){return n})),i.d(e,"metadata",(function(){return c})),i.d(e,"toc",(function(){return p})),i.d(e,"default",(function(){return d}));var r=i(3),s=i(7),o=(i(0),i(88)),n={title:"REST description"},c={unversionedId:"rest-description",id:"rest-description",isDocsHomePage:!1,title:"REST description",description:"Documentation writing for this part is still in progress, please refer to the restdescription example.",source:"@site/docs/rest-description.md",slug:"/rest-description",permalink:"/docs/rest-description",editUrl:"https://github.com/pistacheio/pistache/edit/master/pistache.io/docs/rest-description.md",version:"current"},p=[],a={toc:p};function d(t){var e=t.components,i=Object(s.a)(t,["components"]);return Object(o.b)("wrapper",Object(r.a)({},a,i,{components:e,mdxType:"MDXLayout"}),Object(o.b)("p",null,"Documentation writing for this part is still in progress, please refer to the ",Object(o.b)("a",{parentName:"p",href:"https://github.com/pistacheio/pistache/blob/master/examples/rest_description.cc"},"rest_description")," example."))}d.isMDXComponent=!0}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{74:function(e){e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","isLast":true,"docsSidebars":{"leftSidebar":[{"collapsed":true,"type":"category","label":"Pistache","items":[{"type":"link","label":"Getting started","href":"/docs/"},{"type":"link","label":"HTTP handler","href":"/docs/http-handler"},{"type":"link","label":"Asynchronous HTTP programming","href":"/docs/asynchronous-http-programming"},{"type":"link","label":"Headers","href":"/docs/headers"},{"type":"link","label":"Routing","href":"/docs/routing"}]}]},"permalinkToSidebar":{"/docs/asynchronous-http-programming":"leftSidebar","/docs/headers":"leftSidebar","/docs/http-handler":"leftSidebar","/docs/":"leftSidebar","/docs/routing":"leftSidebar"}}')}}]);
\ No newline at end of file
cmake_minimum_required (VERSION 2.8.7)
project (restgear)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
file(GLOB HEADER_FILES "include/*.h")
install(FILES ${HEADER_FILES} DESTINATION include/rest)
add_subdirectory (src)
include_directories (src)
add_subdirectory (examples)
ADD_SUBDIRECTORY (googletest-release-1.7.0)
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
add_subdirectory(tests)
pistache.io
pistache.io
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="7px" height="7px" viewBox="0 0 7 7" enable-background="new 0 0 7 7" xml:space="preserve">
<rect fill="#666766" width="7" height="7"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="224px" height="64px" viewBox="0 0 224 64" enable-background="new 0 0 224 64" xml:space="preserve">
<path fill="#383838" d="M24,11c-0.6,0.3-1.2,0.4-1.9,0.5c0.7-0.4,1.2-1,1.4-1.8c-0.6,0.4-1.3,0.6-2.1,0.8c-0.6-0.6-1.5-1-2.4-1
c-1.8,0-3.3,1.5-3.3,3.3c0,0.3,0,0.5,0.1,0.7c-2.7-0.1-5.1-1.4-6.8-3.4c-0.3,0.5-0.4,1-0.4,1.7c0,1.1,0.6,2.1,1.5,2.7
c-0.5,0-1-0.2-1.5-0.4l0,0c0,1.6,1.1,2.9,2.6,3.2c-0.4,0.3-1,0.3-1.5,0c0.4,1.3,1.6,2.3,3.1,2.3c-1.1,0.9-2.5,1.4-4.1,1.4
c-0.3,0-0.5,0-0.8,0c1.5,0.9,3.2,1.5,5,1.5c6,0,9.3-5,9.3-9.3c0-0.1,0-0.3,0-0.4C23,12.3,23.6,11.7,24,11z"/>
<path fill="#383838" d="M78,16v8h3v-8h2l1-3h-3c0,0,0-0.5,0-1.3c0-0.3,0.2-0.7,0.7-0.7c1,0,2.9,0,2.3,0V8c0,0-1.6,0-3.3,0
C79,8,78,9.3,78,10.8s0,2.3,0,2.3h-2v3h2V16z"/>
<path fill="#383838" d="M112,24c-4.4,0-8-3.6-8-8s3.6-8,8-8s8,3.6,8,8S116.4,24,112,24z M118.7,17.1c-0.2-0.1-2.1-0.6-4.3-0.3
c0.9,2.5,1.1,3.7,1.3,4.9C117.4,20.6,118.4,19,118.7,17.1z M114.7,22.3c-0.2-1.2-0.5-2.7-1.5-5.2l0,0c-3.9,1.3-5.2,4-5.4,4.3
C109.4,22.7,112,23.2,114.7,22.3z M106.9,20.6c1.6-3.1,5.8-4.6,5.9-4.6c-0.2-0.4-0.4-0.8-0.6-1.2c-3.4,1-6.7,1-7,1
C105.1,17.7,105.8,19.4,106.9,20.6z M105.3,14.6c0.3,0,3.1,0,6.3-0.8c-1.1-2-2.3-3.7-2.5-4C107.2,10.7,105.8,12.5,105.3,14.6z
M110.4,9.4c0.2,0.3,1.4,1.9,2.5,4c2.4-0.9,3.5-2.3,3.6-2.5C115.3,9.8,113,8.9,110.4,9.4z M117.3,11.7c-0.1,0.2-1.3,1.7-3.8,2.7
c0.2,0.3,0.4,0.9,0.6,1.4c2.3-0.3,4,0,4.8,0.2C118.9,14.2,118.2,12.8,117.3,11.7z"/>
<path fill="#383838" d="M170,20c-1.1,0-2,0.9-2,2c0,1.1,0.9,2,2,2c1.1,0,2-0.9,2-2C172.1,21,171.1,20,170,20z M168,13.4v3.1
c4.2,0,7.5,3.6,7.5,7.5h3.1C178.6,18.2,173.8,13.4,168,13.4z M168,8v3.1c7.1,0,12.9,5.8,12.9,12.9h3.1C184,15.2,176.8,8,168,8z"/>
<path fill="#383838" d="M50.8,17.1c-0.6,0-1.1,0.7-1.1,1.6c0,0.9,0.5,1.6,1.1,1.6c0.6,0,1.1-0.7,1.1-1.6
C51.9,17.8,51.4,17.1,50.8,17.1z M54.7,13.1c0.1-0.3,0.1-2.1-0.6-3.8c0,0-1.6,0.2-4,1.8c-0.5-0.1-1.3-0.2-2.2-0.2s-1.7,0.1-2.2,0.2
c-2.4-1.6-4-1.8-4-1.8c-0.7,1.7-0.7,3.5-0.6,3.8C40.5,13.9,40,15,40,16.4c0,6.2,5.2,6.3,6.5,6.3c0.3,0,0.9,0,1.5,0
c0.6,0,1.2,0,1.5,0c1.3,0,6.5-0.1,6.5-6.3C56,15,55.5,13.9,54.7,13.1z M48,22L48,22c-3.3,0-5.9-0.4-5.9-3.6c0-0.8,0.3-1.5,0.9-2.1
c1.1-1,2.9-0.5,4.9-0.5c0,0,0,0,0,0c0,0,0,0,0,0c2.1,0,3.9-0.5,4.9,0.5c0.6,0.6,0.9,1.3,0.9,2.1C53.9,21.6,51.3,22,48,22z
M45.2,17.1c-0.6,0-1.1,0.7-1.1,1.6c0,0.9,0.5,1.6,1.1,1.6c0.6,0,1.1-0.7,1.1-1.6C46.4,17.8,45.9,17.1,45.2,17.1z"/>
<path fill="#383838" d="M143.1,11.8c-0.2-1.7-1.4-3-2.5-3s-2,1.3-1.8,2.9c0.2,1.7,1.4,3,2.5,3.1C142.4,14.8,143.2,13.4,143.1,11.8z
M141.2,18c-1.8,0-3.4,1.1-3.4,2.6s1.3,2.6,3,2.6c2.5,0,3.4-1.1,3.4-2.6c0-0.2,0-0.3-0.1-0.5c-0.2-0.8-0.9-1.2-1.8-1.9
C142,18.1,141.6,18,141.2,18z M143.2,8.8c1,0.4,1.5,1.6,1.5,2.9c0,1-0.6,1.9-1.3,2.6c-0.7,0.6-0.9,0.9-0.9,1.4
c0,0.5,0.8,1.2,1.2,1.5c1.2,1,1.6,1.8,1.6,3.2c0,1.8-1.6,3.6-4.5,3.6c-2.6,0-4.7-1.1-4.7-2.9c0-1.8,2-3.6,4.5-3.6h0.8
c-0.3-0.4-0.6-0.8-0.6-1.4c0-0.3,0.1-0.6,0.2-1c-0.2,0-0.3,0-0.4,0c-2.1,0-3.5-1.6-3.5-3.6c0-1.9,1.9-3.6,4-3.6h4.6l-1,0.8H143.2
L143.2,8.8z M151,12h-2v2h-1v-2h-2v-1h2V9h1v2h2V12z"/>
<path fill="#383838" d="M206.9,18.6c-0.4,2.2-0.9,4.3-2.5,5.4c-0.5-3.3,0.7-5.8,1.2-8.5c-0.9-1.5,0.1-4.6,2-3.9
c2.4,0.9-2.1,5.7,0.9,6.3c3.1,0.6,4.4-5.4,2.5-7.4c-2.8-2.8-8.1-0.1-7.5,4c0.2,1,1.2,1.3,0.4,2.7c-1.8-0.4-2.3-1.8-2.2-3.7
c0.1-3.1,2.8-5.2,5.4-5.5c3.4-0.4,6.5,1.2,7,4.4c0.5,3.6-1.5,7.4-5.1,7.2C208.1,19.5,207.7,19,206.9,18.6z"/>
<path fill="#FFFFFF" d="M24,43c-0.6,0.3-1.2,0.4-1.9,0.5c0.7-0.4,1.2-1,1.4-1.8c-0.6,0.4-1.3,0.6-2.1,0.8c-0.6-0.6-1.5-1-2.4-1
c-1.8,0-3.3,1.5-3.3,3.3c0,0.3,0,0.5,0.1,0.7c-2.7-0.1-5.1-1.4-6.8-3.4c-0.3,0.5-0.4,1-0.4,1.7c0,1.1,0.6,2.1,1.5,2.7
c-0.5,0-1-0.2-1.5-0.4l0,0c0,1.6,1.1,2.9,2.6,3.2c-0.4,0.3-1,0.3-1.5,0c0.4,1.3,1.6,2.3,3.1,2.3c-1.1,0.9-2.5,1.4-4.1,1.4
c-0.3,0-0.5,0-0.8,0c1.5,0.9,3.2,1.5,5,1.5c6,0,9.3-5,9.3-9.3c0-0.1,0-0.3,0-0.4C23,44.3,23.6,43.7,24,43z"/>
<path fill="#FFFFFF" d="M78,48v8h3v-8h2l1-3h-3c0,0,0-0.5,0-1.3c0-0.3,0.2-0.7,0.7-0.7c1,0,2.9,0,2.3,0v-3c0,0-1.6,0-3.3,0
C79,40,78,41.3,78,42.8s0,2.3,0,2.3h-2v3L78,48L78,48z"/>
<path fill="#FFFFFF" d="M112,56c-4.4,0-8-3.6-8-8s3.6-8,8-8s8,3.6,8,8S116.4,56,112,56z M118.7,49.1c-0.2-0.1-2.1-0.6-4.3-0.3
c0.9,2.5,1.1,3.7,1.3,4.9C117.4,52.6,118.4,51,118.7,49.1z M114.7,54.3c-0.2-1.2-0.5-2.7-1.5-5.2l0,0c-3.9,1.3-5.2,4-5.4,4.3
C109.4,54.7,112,55.2,114.7,54.3z M106.9,52.6c1.6-3.1,5.8-4.6,5.9-4.6c-0.2-0.4-0.4-0.8-0.6-1.2c-3.4,1-6.7,1-7,1
C105.1,49.7,105.8,51.4,106.9,52.6z M105.3,46.6c0.3,0,3.1,0,6.3-0.8c-1.1-2-2.3-3.7-2.5-4C107.2,42.7,105.8,44.5,105.3,46.6z
M110.4,41.4c0.2,0.3,1.4,1.9,2.5,4c2.4-0.9,3.5-2.3,3.6-2.5C115.3,41.8,113,40.9,110.4,41.4z M117.3,43.7c-0.1,0.2-1.3,1.7-3.8,2.7
c0.2,0.3,0.4,0.9,0.6,1.4c2.3-0.3,4,0,4.8,0.2C118.9,46.2,118.2,44.8,117.3,43.7z"/>
<path fill="#FFFFFF" d="M170,52c-1.1,0-2,0.9-2,2c0,1.1,0.9,2,2,2c1.1,0,2-0.9,2-2C172.1,53,171.1,52,170,52z M168,45.4v3.1
c4.2,0,7.5,3.6,7.5,7.5h3.1C178.6,50.2,173.8,45.4,168,45.4z M168,40v3.1c7.1,0,12.9,5.8,12.9,12.9h3.1C184,47.2,176.8,40,168,40z"
/>
<path fill="#FFFFFF" d="M50.8,49.1c-0.6,0-1.1,0.7-1.1,1.6c0,0.9,0.5,1.6,1.1,1.6c0.6,0,1.1-0.7,1.1-1.6
C51.9,49.8,51.4,49.1,50.8,49.1z M54.7,45.1c0.1-0.3,0.1-2.1-0.6-3.8c0,0-1.6,0.2-4,1.8c-0.5-0.1-1.3-0.2-2.2-0.2s-1.7,0.1-2.2,0.2
c-2.4-1.6-4-1.8-4-1.8c-0.7,1.7-0.7,3.5-0.6,3.8C40.5,45.9,40,47,40,48.4c0,6.2,5.2,6.3,6.5,6.3c0.3,0,0.9,0,1.5,0
c0.6,0,1.2,0,1.5,0c1.3,0,6.5-0.1,6.5-6.3C56,47,55.5,45.9,54.7,45.1z M48,54L48,54c-3.3,0-5.9-0.4-5.9-3.6c0-0.8,0.3-1.5,0.9-2.1
c1.1-1,2.9-0.5,4.9-0.5c0,0,0,0,0,0c0,0,0,0,0,0c2.1,0,3.9-0.5,4.9,0.5c0.6,0.6,0.9,1.3,0.9,2.1C53.9,53.6,51.3,54,48,54z
M45.2,49.1c-0.6,0-1.1,0.7-1.1,1.6c0,0.9,0.5,1.6,1.1,1.6c0.6,0,1.1-0.7,1.1-1.6C46.4,49.8,45.9,49.1,45.2,49.1z"/>
<path fill="#FFFFFF" d="M143.1,43.8c-0.2-1.7-1.4-3-2.5-3s-2,1.3-1.8,2.9c0.2,1.7,1.4,3,2.5,3.1C142.4,46.8,143.2,45.4,143.1,43.8z
M141.2,50c-1.8,0-3.4,1.1-3.4,2.6c0,1.4,1.3,2.6,3,2.6c2.5,0,3.4-1.1,3.4-2.6c0-0.2,0-0.3-0.1-0.5c-0.2-0.8-0.9-1.2-1.8-1.9
C142,50.1,141.6,50,141.2,50z M143.2,40.8c1,0.4,1.5,1.6,1.5,2.9c0,1-0.6,1.9-1.3,2.6c-0.7,0.6-0.9,0.9-0.9,1.4
c0,0.5,0.8,1.2,1.2,1.5c1.2,1,1.6,1.8,1.6,3.2c0,1.8-1.6,3.6-4.5,3.6c-2.6,0-4.7-1.1-4.7-2.9c0-1.8,2-3.6,4.5-3.6h0.8
c-0.3-0.4-0.6-0.8-0.6-1.4c0-0.3,0.1-0.6,0.2-1c-0.2,0-0.3,0-0.4,0c-2.1,0-3.5-1.6-3.5-3.6c0-1.9,1.9-3.6,4-3.6h4.6l-1,0.8H143.2
L143.2,40.8z M151,44h-2v2h-1v-2h-2v-1h2v-2h1v2h2V44z"/>
<path fill="#FFFFFF" d="M206.9,50.6c-0.4,2.2-0.9,4.3-2.5,5.4c-0.5-3.3,0.7-5.8,1.2-8.5c-0.9-1.5,0.1-4.6,2-3.9
c2.4,0.9-2.1,5.7,0.9,6.3c3.1,0.6,4.4-5.4,2.5-7.4c-2.8-2.8-8.1-0.1-7.5,4c0.2,1,1.2,1.3,0.4,2.7c-1.8-0.4-2.3-1.8-2.2-3.7
c0.1-3.1,2.8-5.2,5.4-5.5c3.4-0.4,6.5,1.2,7,4.4c0.5,3.6-1.5,7.4-5.1,7.2C208.1,51.5,207.7,51,206.9,50.6z"/>
</svg>
This diff is collapsed.
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, main {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
\ No newline at end of file
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
jQuery(document).ready(function($){
// todo: jquery stuff should need to put here.
});
This diff is collapsed.
/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-borderradius-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load
*/
;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.borderradius=function(){return F("borderRadius")};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://pistache.io/blog</id>
<title>Pistache Blog</title>
<updated>2015-10-25T23:29:00.000Z</updated>
<generator>https://github.com/jpmonette/feed</generator>
<link rel="alternate" href="https://pistache.io/blog"/>
<subtitle>Pistache Blog</subtitle>
<icon>https://pistache.io/img/logo.png</icon>
</feed>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Pistache Blog</title>
<link>https://pistache.io/blog</link>
<description>Pistache Blog</description>
<lastBuildDate>Sun, 25 Oct 2015 23:29:00 GMT</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator>https://github.com/jpmonette/feed</generator>
</channel>
</rss>
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{75:function(e,t,a){"use strict";a.r(t);var n=a(3),l=a(0),r=a.n(l),i=a(84),c=a(92),s=a(86),m=a(22),o=a(87),u=a(76),d=a.n(u),h=[{title:"Modern API",imageUrl:"img/undraw_futuristic_interface.svg",description:r.a.createElement(r.a.Fragment,null,"Written in pure C++17 and providing a low-level HTTP abstraction, Pistache makes playing with its modern API fun and easy, just take a look at the quickstart")},{title:"What's in the box",imageUrl:"img/undraw_accept_request.svg",description:r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",null,r.a.createElement("li",null,"A multi-threaded HTTP server to build your APIs"),r.a.createElement("li",null,"An asynchronous HTTP client to request APIs"),r.a.createElement("li",null,"An HTTP router to dispatch requests to C++ functions"),r.a.createElement("li",null,"A REST description DSL to easily define your APIs"),r.a.createElement("li",null,"Type-safe headers and MIME types implementation")))},{title:"Use it",imageUrl:"img/undraw_version_control.svg",description:r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",null,r.a.createElement("li",null,"Clone it on ",r.a.createElement("a",{href:"https://github.com/pistacheio/pistache"},"GitHub")),r.a.createElement("li",null,"Start with the ",r.a.createElement("a",{href:"docs/"},"quickstart")),r.a.createElement("li",null,"Read the full user's ",r.a.createElement("a",{href:"docs/http-handler"},"guide")),r.a.createElement("li",null,"Have issues with it? Fill an ",r.a.createElement("a",{href:"https://github.com/pistacheio/pistache/issues"},"issue"))))}];function E(e){var t=e.imageUrl,a=e.title,n=e.description,l=Object(o.a)(t);return r.a.createElement("div",{className:Object(i.a)("col col--4",d.a.feature)},l&&r.a.createElement("div",{className:"text--center"},r.a.createElement("img",{className:d.a.featureImage,src:l,alt:a})),r.a.createElement("h3",null,a),r.a.createElement("p",null,n))}t.default=function(){var e=Object(m.default)().siteConfig,t=void 0===e?{}:e;return r.a.createElement(c.a,{description:"Description will go into a meta tag in <head />"},r.a.createElement("header",{className:Object(i.a)("hero hero--primary",d.a.heroBanner)},r.a.createElement("div",{className:"container"},r.a.createElement("h1",{className:"hero__title"},t.title),r.a.createElement("p",{className:"hero__subtitle"},t.tagline),r.a.createElement("div",{className:d.a.buttons},r.a.createElement(s.a,{className:Object(i.a)("button button--outline button--secondary button--lg",d.a.getStarted),to:Object(o.a)("docs/")},"Get Started")))),r.a.createElement("main",null,h&&h.length>0&&r.a.createElement("section",{className:d.a.features},r.a.createElement("div",{className:"container"},r.a.createElement("div",{className:"row"},h.map((function(e,t){return r.a.createElement(E,Object(n.a)({key:t},e))})))))))}}}]);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-alpha.70">
<link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="Pistache Blog RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="Pistache Blog Atom Feed"><title data-react-helmet="true">REST description | Pistache</title><meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" name="docusaurus_locale" content="en"><meta data-react-helmet="true" name="docusaurus_version" content="current"><meta data-react-helmet="true" name="docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:title" content="REST description | Pistache"><meta data-react-helmet="true" name="description" content="Documentation writing for this part is still in progress, please refer to the restdescription example."><meta data-react-helmet="true" property="og:description" content="Documentation writing for this part is still in progress, please refer to the restdescription example."><meta data-react-helmet="true" property="og:url" content="https://pistache.io/docs/rest-description"><link data-react-helmet="true" rel="shortcut icon" href="/img/logo.png"><link data-react-helmet="true" rel="canonical" href="https://pistache.io/docs/rest-description"><link rel="stylesheet" href="/styles.e3bb9643.css">
<link rel="preload" href="/styles.fd3ca948.js" as="script">
<link rel="preload" href="/runtime~main.339e39a4.js" as="script">
<link rel="preload" href="/main.eb9a4ed1.js" as="script">
<link rel="preload" href="/common.a2a55ec7.js" as="script">
<link rel="preload" href="/2.e17bc1b5.js" as="script">
<link rel="preload" href="/14.9edccfba.js" as="script">
<link rel="preload" href="/15.55b6c0e6.js" as="script">
<link rel="preload" href="/935f2afb.0694187a.js" as="script">
<link rel="preload" href="/17896441.be510e19.js" as="script">
<link rel="preload" href="/88aa539f.7d88fb54.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<nav aria-label="Skip navigation links"><button type="button" tabindex="0" class="skipToContent_11B0">Skip to main content</button></nav><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><div aria-label="Navigation bar toggle" class="navbar__toggle" role="button" tabindex="0"><svg aria-label="Menu" width="30" height="30" viewBox="0 0 30 30" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></div><a class="navbar__brand" href="/"><img src="/img/logo.png" alt="Pistache logo" class="themedImage_YANc themedImage--light_3CMI navbar__logo"><img src="/img/logo.png" alt="Pistache logo" class="themedImage_YANc themedImage--dark_3ARp navbar__logo"><strong class="navbar__title">Pistache</strong></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/">Docs</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/pistacheio/pistache" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-github-link" aria-label="GitHub repository"></a><div class="react-toggle react-toggle--disabled displayOnlyInLargeViewport_2N3Q"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_3NWk">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_3NWk">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" disabled="" aria-label="Dark mode toggle" class="react-toggle-screenreader-only"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/"><img src="/img/logo.png" alt="Pistache logo" class="themedImage_YANc themedImage--light_3CMI navbar__logo"><img src="/img/logo.png" alt="Pistache logo" class="themedImage_YANc themedImage--dark_3ARp navbar__logo"><strong class="navbar__title">Pistache</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a aria-current="page" class="menu__link navbar__link--active" href="/docs/">Docs</a></li><li class="menu__list-item"><a href="https://github.com/pistacheio/pistache" target="_blank" rel="noopener noreferrer" class="menu__link header-github-link" aria-label="GitHub repository"></a></li></ul></div></div></div></nav><div class="main-wrapper"><div class="docPage_vMrn"><main class="docMainContainer_2iGs"><div class="container padding-vert--lg docItemWrapper_1bxp"><div class="row"><div class="col docItemCol_U38p"><div class="docItemContainer_a7m4"><article><header><h1 class="docTitle_Oumm">REST description</h1></header><div class="markdown"><p>Documentation writing for this part is still in progress, please refer to the <a href="https://github.com/pistacheio/pistache/blob/master/examples/rest_description.cc" target="_blank" rel="noopener noreferrer">rest_description</a> example.</p></div></article><div class="margin-vert--xl"><div class="row"><div class="col"><a href="https://github.com/pistacheio/pistache/edit/master/pistache.io/docs/rest-description.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="1.2em" width="1.2em" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 40 40" class="iconEdit_2LL7"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div></div></div><div class="margin-vert--lg"><nav class="pagination-nav" aria-label="Blog list page navigation"><div class="pagination-nav__item"></div><div class="pagination-nav__item pagination-nav__item--next"></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_2xL- thin-scrollbar"></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">Docs</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/docs/">Quickstart</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/http-handler/">User guide</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Community</h4><ul class="footer__items"><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/pistache" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stack Overflow</a></li><li class="footer__item"><a href="irc://chat.freenode.net" target="_blank" rel="noopener noreferrer" class="footer__link-item">#pistache on Freenode</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Pistache, 2015 - 2021</div></div></div></footer></div>
<script src="/styles.fd3ca948.js"></script>
<script src="/runtime~main.339e39a4.js"></script>
<script src="/main.eb9a4ed1.js"></script>
<script src="/common.a2a55ec7.js"></script>
<script src="/2.e17bc1b5.js"></script>
<script src="/14.9edccfba.js"></script>
<script src="/15.55b6c0e6.js"></script>
<script src="/935f2afb.0694187a.js"></script>
<script src="/17896441.be510e19.js"></script>
<script src="/88aa539f.7d88fb54.js"></script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{78:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return c})),n.d(t,"default",(function(){return p}));var a=n(3),o=n(7),r=(n(0),n(88)),i={title:"Asynchronous HTTP programming"},s={unversionedId:"asynchronous-http-programming",id:"asynchronous-http-programming",isDocsHomePage:!1,title:"Asynchronous HTTP programming",description:"Interfaces provided by Pistaches are asynchronous and non-blocking. Asynchronous programming allows for code to continue executing even if the result of a given call is not available yet. Calls that provide an asynchronous interface are referred to asynchronous calls.",source:"@site/docs/asynchronous-http-programming.md",slug:"/asynchronous-http-programming",permalink:"/docs/asynchronous-http-programming",editUrl:"https://github.com/pistacheio/pistache/edit/master/pistache.io/docs/asynchronous-http-programming.md",version:"current",sidebar:"leftSidebar",previous:{title:"HTTP handler",permalink:"/docs/http-handler"},next:{title:"Headers",permalink:"/docs/headers"}},c=[],l={toc:c};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)("p",null,"Interfaces provided by Pistaches are ",Object(r.b)("em",{parentName:"p"},"asynchronous")," and ",Object(r.b)("em",{parentName:"p"},"non-blocking"),". Asynchronous programming allows for code to continue executing even if the result of a given call is not available yet. Calls that provide an asynchronous interface are referred to ",Object(r.b)("em",{parentName:"p"},"asynchronous calls"),"."),Object(r.b)("p",null,"An example of such a call is the ",Object(r.b)("inlineCode",{parentName:"p"},"send()")," function provided by the ",Object(r.b)("inlineCode",{parentName:"p"},"ResponseWriter")," interface. This function returns the number of bytes written to the socket file descriptor associated to the connection. However, instead of returning directly the value to the caller and thus blocking the caller, it wraps the value into a component called a ",Object(r.b)("inlineCode",{parentName:"p"},"Promise"),"."),Object(r.b)("p",null,"A ",Object(r.b)("inlineCode",{parentName:"p"},"Promise")," is the Pistache\u2019s implementation of the ",Object(r.b)("a",{parentName:"p",href:"https://promisesaplus.com"},"Promises/A+")," standard available in many JavaScript implementations. Simply put, during an asynchronous call, a ",Object(r.b)("inlineCode",{parentName:"p"},"Promise")," separates the launch of an asynchronous operation from the retrieval of its result. While the asynchronous might still be running, a ",Object(r.b)("inlineCode",{parentName:"p"},"Promise<T>")," is directly returned to the caller to retrieve the final result when it becomes available. A so called continuation can be attach to a ",Object(r.b)("inlineCode",{parentName:"p"},"Promise")," to execute a callback when the result becomes available (when the ",Object(r.b)("inlineCode",{parentName:"p"},"Promise")," has been resolved or fulfilled)."),Object(r.b)("pre",null,Object(r.b)("code",{parentName:"pre",className:"language-cpp"},'auto res = response.send(Http::Code::Ok, "Hello World");\nres.then(\n [](ssize_t bytes) { std::cout << bytes << " bytes have been sent\\n" },\n Async::NoExcept\n);\n')),Object(r.b)("p",null,"The ",Object(r.b)("inlineCode",{parentName:"p"},"then()")," member is used to attach a callback to the ",Object(r.b)("inlineCode",{parentName:"p"},"Promise"),". The first argument is a callable that will be called when the ",Object(r.b)("inlineCode",{parentName:"p"},"Promise")," has been ",Object(r.b)("strong",{parentName:"p"},"succesfully")," resolved. If, for some reason, an error occurs during the asynchronous operation, a ",Object(r.b)("inlineCode",{parentName:"p"},"Promise")," can be ",Object(r.b)("strong",{parentName:"p"},"rejected")," and will then fail. In this case, the second callable will be called. ",Object(r.b)("inlineCode",{parentName:"p"},"Async::NoExcept")," is a special callback that will call ",Object(r.b)("a",{parentName:"p",href:"https://en.cppreference.com/w/cpp/error/terminate"},Object(r.b)("inlineCode",{parentName:"a"},"std::terminate()"))," if the promise failed. This is the equivalent of the ",Object(r.b)("inlineCode",{parentName:"p"},"noexcept")," keyword."),Object(r.b)("p",null,"Other generic callbacks can also be used in this case:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Async::IgnoreException")," will simply ignore the exception and let the program continue"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Async::Throw"),' will "rethrow" the exception up to an eventual promise call-chain. This has the same effect than the ',Object(r.b)("inlineCode",{parentName:"li"},"throw")," keyword, except that it is suitable for promises")),Object(r.b)("p",null,"Exceptions in promises callbacks are propagated through an ",Object(r.b)("inlineCode",{parentName:"p"},"exception_ptr"),". Promises can also be chained together to create a whole asynchronous pipeline:"),Object(r.b)("pre",null,Object(r.b)("code",{parentName:"pre",className:"language-cpp"},'auto fetchOp = fetchDatabase();\nfetchOp\n .then(\n [](const User& user) { return fetchUserInfo(user); },\n Async::Throw)\n .then(\n [](const UserInfo& info) { std::cout << "User name = " << info.name << std::endl; },\n [](exception_ptr ptr) { std::cout << "An exception occured during user retrieval" << std::endl;}\n);\n')),Object(r.b)("p",null,"Line 5 will propagate the exception if ",Object(r.b)("inlineCode",{parentName:"p"},"fetchDatabase()")," failed and rejected the promise."))}p.isMDXComponent=!0}}]);
\ No newline at end of file
This diff is collapsed.
add_executable(http_server http_server.cc)
target_link_libraries(http_server net)
add_executable(http_client http_client.cc)
target_link_libraries(http_client net)
add_executable(rest_server rest_server.cc)
target_link_libraries(rest_server net)
/*
Mathieu Stefani, 07 février 2016
* Http client example
*/
#include "net.h"
#include "http.h"
#include "client.h"
#include <atomic>
using namespace Net;
using namespace Net::Http;
int main(int argc, char *argv[]) {
if (argc < 2) {
std::cerr << "Usage: http_client host [page]" << std::endl;
return 1;
}
std::string host = argv[1];
std::string page;
if (argc == 3)
page = argv[2];
else
page = "/";
Experimental::Client client(host);
auto opts = Http::Experimental::Client::options()
.threads(1)
.maxConnections(64);
client.init(opts);
auto resp = client.get(page).cookie(Cookie("FOO", "bar")).send();
resp.then([](Response response) {
std::cout << "Response code = " << response.code() << std::endl;
auto body = response.body();
if (!body.empty())
std::cout << "Response body = " << body << std::endl;
}, Async::NoExcept);
std::this_thread::sleep_for(std::chrono::seconds(1));
client.shutdown();
}
/* http_server.cc
Mathieu Stefani, 07 février 2016
Example of an http server
*/
#include "net.h"
#include "http.h"
#include "peer.h"
#include "http_headers.h"
#include "cookie.h"
#include "endpoint.h"
using namespace std;
using namespace Net;
struct PrintException {
void operator()(std::exception_ptr exc) const {
try {
std::rethrow_exception(exc);
} catch (const std::exception& e) {
std::cerr << "An exception occured: " << e.what() << std::endl;
}
}
};
struct LoadMonitor {
LoadMonitor(const std::shared_ptr<Net::Http::Endpoint>& endpoint)
: endpoint_(endpoint)
, interval(std::chrono::seconds(1))
{ }
void setInterval(std::chrono::seconds secs) {
interval = secs;
}
void start() {
shutdown_ = false;
thread.reset(new std::thread(std::bind(&LoadMonitor::run, this)));
}
void shutdown() {
shutdown_ = true;
}
~LoadMonitor() {
shutdown_ = true;
if (thread) thread->join();
}
private:
std::shared_ptr<Net::Http::Endpoint> endpoint_;
std::unique_ptr<std::thread> thread;
std::chrono::seconds interval;
std::atomic<bool> shutdown_;
void run() {
Net::Tcp::Listener::Load old;
while (!shutdown_) {
if (!endpoint_->isBound()) continue;
endpoint_->requestLoad(old).then([&](const Net::Tcp::Listener::Load& load) {
old = load;
double global = load.global;
if (global > 100) global = 100;
if (global > 1)
std::cout << "Global load is " << global << "%" << std::endl;
else
std::cout << "Global load is 0%" << std::endl;
},
Async::NoExcept);
std::this_thread::sleep_for(std::chrono::seconds(interval));
}
}
};
class MyHandler : public Net::Http::Handler {
HTTP_PROTOTYPE(MyHandler)
void onRequest(
const Net::Http::Request& req,
Net::Http::ResponseWriter response) {
if (req.resource() == "/ping") {
if (req.method() == Net::Http::Method::Get) {
using namespace Net::Http;
auto query = req.query();
if (query.has("chunked")) {
std::cout << "Using chunked encoding" << std::endl;
response.headers()
.add<Header::Server>("lys")
.add<Header::ContentType>(MIME(Text, Plain));
response.cookies()
.add(Cookie("lang", "en-US"));
auto stream = response.stream(Net::Http::Code::Ok);
stream << "PO";
stream << "NG";
stream << ends;
}
else {
response.send(Net::Http::Code::Ok, "PONG");
}
}
}
else if (req.resource() == "/echo") {
if (req.method() == Net::Http::Method::Post) {
response.send(Net::Http::Code::Ok, req.body(), MIME(Text, Plain));
}
}
else if (req.resource() == "/exception") {
throw std::runtime_error("Exception thrown in the handler");
}
else if (req.resource() == "/timeout") {
response.timeoutAfter(std::chrono::seconds(2));
}
#if 0
else if (req.resource() == "/async") {
std::thread([](Net::Http::Response response) {
std::this_thread::sleep_for(std::chrono::seconds(1));
response.send(Net::Http::Code::Ok, "Async response");
}, std::move(response)).detach();
}
#endif
else if (req.resource() == "/static") {
if (req.method() == Net::Http::Method::Get) {
Net::Http::serveFile(response, "README.md").then([](ssize_t bytes) {;
std::cout << "Sent " << bytes << " bytes" << std::endl;
}, Async::NoExcept);
}
}
}
void onTimeout(const Net::Http::Request& req, Net::Http::ResponseWriter response) {
response
.send(Net::Http::Code::Request_Timeout, "Timeout")
.then([=](ssize_t) { }, PrintException());
}
};
int main(int argc, char *argv[]) {
Net::Port port(9080);
int thr = 2;
if (argc >= 2) {
port = std::stol(argv[1]);
if (argc == 3)
thr = std::stol(argv[2]);
}
Net::Address addr(Net::Ipv4::any(), port);
static constexpr size_t Workers = 4;
cout << "Cores = " << hardware_concurrency() << endl;
cout << "Using " << thr << " threads" << endl;
auto server = std::make_shared<Net::Http::Endpoint>(addr);
auto opts = Net::Http::Endpoint::options()
.threads(thr)
.flags(Net::Tcp::Options::InstallSignalHandler);
server->init(opts);
server->setHandler(std::make_shared<MyHandler>());
server->serve();
std::cout << "Shutdowning server" << std::endl;
server->shutdown();
}
/*
Mathieu Stefani, 07 février 2016
Example of a REST endpoint with routing
*/
#include "http.h"
#include "router.h"
#include "endpoint.h"
#include <algorithm>
using namespace std;
using namespace Net;
void printCookies(const Net::Http::Request& req) {
auto cookies = req.cookies();
std::cout << "Cookies: [" << std::endl;
const std::string indent(4, ' ');
for (const auto& c: cookies) {
std::cout << indent << c.name << " = " << c.value << std::endl;
}
std::cout << "]" << std::endl;
}
namespace Generic {
void handleReady(const Rest::Request&, Http::ResponseWriter response) {
response.send(Http::Code::Ok, "1");
}
}
class StatsEndpoint {
public:
StatsEndpoint(Net::Address addr)
: httpEndpoint(std::make_shared<Net::Http::Endpoint>(addr))
{ }
void init(size_t thr = 2) {
auto opts = Net::Http::Endpoint::options()
.threads(thr)
.flags(Net::Tcp::Options::InstallSignalHandler);
httpEndpoint->init(opts);
setupRoutes();
}
void start() {
httpEndpoint->setHandler(router.handler());
httpEndpoint->serve();
}
void shutdown() {
httpEndpoint->shutdown();
}
private:
void setupRoutes() {
using namespace Net::Rest;
Routes::Post(router, "/record/:name/:value?", Routes::bind(&StatsEndpoint::doRecordMetric, this));
Routes::Get(router, "/value/:name", Routes::bind(&StatsEndpoint::doGetMetric, this));
Routes::Get(router, "/ready", Routes::bind(&Generic::handleReady));
Routes::Get(router, "/auth", Routes::bind(&StatsEndpoint::doAuth, this));
}
void doRecordMetric(const Rest::Request& request, Net::Http::ResponseWriter response) {
auto name = request.param(":name").as<std::string>();
auto it = std::find_if(metrics.begin(), metrics.end(), [&](const Metric& metric) {
return metric.name() == name;
});
int val = 1;
if (request.hasParam(":value")) {
auto value = request.param(":value");
val = value.as<int>();
}
if (it == std::end(metrics)) {
metrics.push_back(Metric(std::move(name), val));
response.send(Http::Code::Created, std::to_string(val));
}
else {
auto &metric = *it;
metric.incr(val);
response.send(Http::Code::Ok, std::to_string(metric.value()));
}
}
void doGetMetric(const Rest::Request& request, Net::Http::ResponseWriter response) {
auto name = request.param(":name").as<std::string>();
auto it = std::find_if(metrics.begin(), metrics.end(), [&](const Metric& metric) {
return metric.name() == name;
});
if (it == std::end(metrics)) {
response.send(Http::Code::Not_Found, "Metric does not exist");
} else {
const auto& metric = *it;
response.send(Http::Code::Ok, std::to_string(metric.value()));
}
}
void doAuth(const Rest::Request& request, Net::Http::ResponseWriter response) {
printCookies(request);
response.cookies()
.add(Http::Cookie("lang", "en-US"));
response.send(Http::Code::Ok);
}
class Metric {
public:
Metric(std::string name, int initialValue = 1)
: name_(std::move(name))
, value_(initialValue)
{ }
int incr(int n = 1) {
int old = value_;
value_ += n;
return old;
}
int value() const {
return value_;
}
std::string name() const {
return name_;
}
private:
std::string name_;
int value_;
};
std::vector<Metric> metrics;
std::shared_ptr<Net::Http::Endpoint> httpEndpoint;
Rest::Router router;
};
int main(int argc, char *argv[]) {
Net::Port port(9080);
int thr = 2;
if (argc >= 2) {
port = std::stol(argv[1]);
if (argc == 3)
thr = std::stol(argv[2]);
}
Net::Address addr(Net::Ipv4::any(), port);
cout << "Cores = " << hardware_concurrency() << endl;
cout << "Using " << thr << " threads" << endl;
StatsEndpoint stats(addr);
stats.init(thr);
stats.start();
stats.shutdown();
}
This diff is collapsed.
Changes for 1.7.0:
* New feature: death tests are supported on OpenBSD and in iOS
simulator now.
* New feature: Google Test now implements a protocol to allow
a test runner to detect that a test program has exited
prematurely and report it as a failure (before it would be
falsely reported as a success if the exit code is 0).
* New feature: Test::RecordProperty() can now be used outside of the
lifespan of a test method, in which case it will be attributed to
the current test case or the test program in the XML report.
* New feature (potentially breaking): --gtest_list_tests now prints
the type parameters and value parameters for each test.
* Improvement: char pointers and char arrays are now escaped properly
in failure messages.
* Improvement: failure summary in XML reports now includes file and
line information.
* Improvement: the <testsuites> XML element now has a timestamp attribute.
* Improvement: When --gtest_filter is specified, XML report now doesn't
contain information about tests that are filtered out.
* Fixed the bug where long --gtest_filter flag values are truncated in
death tests.
* Potentially breaking change: RUN_ALL_TESTS() is now implemented as a
function instead of a macro in order to work better with Clang.
* Compatibility fixes with C++ 11 and various platforms.
* Bug/warning fixes.
Changes for 1.6.0:
* New feature: ADD_FAILURE_AT() for reporting a test failure at the
given source location -- useful for writing testing utilities.
* New feature: the universal value printer is moved from Google Mock
to Google Test.
* New feature: type parameters and value parameters are reported in
the XML report now.
* A gtest_disable_pthreads CMake option.
* Colored output works in GNU Screen sessions now.
* Parameters of value-parameterized tests are now printed in the
textual output.
* Failures from ad hoc test assertions run before RUN_ALL_TESTS() are
now correctly reported.
* Arguments of ASSERT_XY and EXPECT_XY no longer need to support << to
ostream.
* More complete handling of exceptions.
* GTEST_ASSERT_XY can be used instead of ASSERT_XY in case the latter
name is already used by another library.
* --gtest_catch_exceptions is now true by default, allowing a test
program to continue after an exception is thrown.
* Value-parameterized test fixtures can now derive from Test and
WithParamInterface<T> separately, easing conversion of legacy tests.
* Death test messages are clearly marked to make them more
distinguishable from other messages.
* Compatibility fixes for Android, Google Native Client, MinGW, HP UX,
PowerPC, Lucid autotools, libCStd, Sun C++, Borland C++ Builder (Code Gear),
IBM XL C++ (Visual Age C++), and C++0x.
* Bug fixes and implementation clean-ups.
* Potentially incompatible changes: disables the harmful 'make install'
command in autotools.
Changes for 1.5.0:
* New feature: assertions can be safely called in multiple threads
where the pthreads library is available.
* New feature: predicates used inside EXPECT_TRUE() and friends
can now generate custom failure messages.
* New feature: Google Test can now be compiled as a DLL.
* New feature: fused source files are included.
* New feature: prints help when encountering unrecognized Google Test flags.
* Experimental feature: CMake build script (requires CMake 2.6.4+).
* Experimental feature: the Pump script for meta programming.
* double values streamed to an assertion are printed with enough precision
to differentiate any two different values.
* Google Test now works on Solaris and AIX.
* Build and test script improvements.
* Bug fixes and implementation clean-ups.
Potentially breaking changes:
* Stopped supporting VC++ 7.1 with exceptions disabled.
* Dropped support for 'make install'.
Changes for 1.4.0:
* New feature: the event listener API
* New feature: test shuffling
* New feature: the XML report format is closer to junitreport and can
be parsed by Hudson now.
* New feature: when a test runs under Visual Studio, its failures are
integrated in the IDE.
* New feature: /MD(d) versions of VC++ projects.
* New feature: elapsed time for the tests is printed by default.
* New feature: comes with a TR1 tuple implementation such that Boost
is no longer needed for Combine().
* New feature: EXPECT_DEATH_IF_SUPPORTED macro and friends.
* New feature: the Xcode project can now produce static gtest
libraries in addition to a framework.
* Compatibility fixes for Solaris, Cygwin, minGW, Windows Mobile,
Symbian, gcc, and C++Builder.
* Bug fixes and implementation clean-ups.
Changes for 1.3.0:
* New feature: death tests on Windows, Cygwin, and Mac.
* New feature: ability to use Google Test assertions in other testing
frameworks.
* New feature: ability to run disabled test via
--gtest_also_run_disabled_tests.
* New feature: the --help flag for printing the usage.
* New feature: access to Google Test flag values in user code.
* New feature: a script that packs Google Test into one .h and one
.cc file for easy deployment.
* New feature: support for distributing test functions to multiple
machines (requires support from the test runner).
* Bug fixes and implementation clean-ups.
Changes for 1.2.1:
* Compatibility fixes for Linux IA-64 and IBM z/OS.
* Added support for using Boost and other TR1 implementations.
* Changes to the build scripts to support upcoming release of Google C++
Mocking Framework.
* Added Makefile to the distribution package.
* Improved build instructions in README.
Changes for 1.2.0:
* New feature: value-parameterized tests.
* New feature: the ASSERT/EXPECT_(NON)FATAL_FAILURE(_ON_ALL_THREADS)
macros.
* Changed the XML report format to match JUnit/Ant's.
* Added tests to the Xcode project.
* Added scons/SConscript for building with SCons.
* Added src/gtest-all.cc for building Google Test from a single file.
* Fixed compatibility with Solaris and z/OS.
* Enabled running Python tests on systems with python 2.3 installed,
e.g. Mac OS X 10.4.
* Bug fixes.
Changes for 1.1.0:
* New feature: type-parameterized tests.
* New feature: exception assertions.
* New feature: printing elapsed time of tests.
* Improved the robustness of death tests.
* Added an Xcode project and samples.
* Adjusted the output format on Windows to be understandable by Visual Studio.
* Minor bug fixes.
Changes for 1.0.1:
* Added project files for Visual Studio 7.1.
* Fixed issues with compiling on Mac OS X.
* Fixed issues with compiling on Cygwin.
Changes for 1.0.0:
* Initial Open Source release of Google Test
########################################################################
# CMake build script for Google Test.
#
# To run the tests for Google Test itself on Linux, use 'make test' or
# ctest. You can select which tests to run using 'ctest -R regex'.
# For more options, run 'ctest --help'.
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
# make it prominent in the GUI.
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
# When other libraries are using a shared version of runtime libraries,
# Google Test also has to use one.
option(
gtest_force_shared_crt
"Use shared (DLL) run-time lib even when Google Test is built as static lib."
OFF)
option(gtest_build_tests "Build all of gtest's own tests." OFF)
option(gtest_build_samples "Build gtest's sample programs." OFF)
option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
include(cmake/hermetic_build.cmake OPTIONAL)
if (COMMAND pre_project_set_up_hermetic_build)
pre_project_set_up_hermetic_build()
endif()
########################################################################
#
# Project-wide settings
# Name of the project.
#
# CMake files in this project can refer to the root source directory
# as ${gtest_SOURCE_DIR} and to the root binary directory as
# ${gtest_BINARY_DIR}.
# Language "C" is required for find_package(Threads).
project(gtest CXX C)
cmake_minimum_required(VERSION 2.6.2)
if (COMMAND set_up_hermetic_build)
set_up_hermetic_build()
endif()
# Define helper functions and macros used by Google Test.
include(cmake/internal_utils.cmake)
config_compiler_and_linker() # Defined in internal_utils.cmake.
# Where Google Test's .h files can be found.
include_directories(
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR})
# Where Google Test's libraries can be found.
link_directories(${gtest_BINARY_DIR}/src)
########################################################################
#
# Defines the gtest & gtest_main libraries. User tests should link
# with one of them.
# Google Test libraries. We build them using more strict warnings than what
# are used for other targets, to ensure that gtest can be compiled by a user
# aggressive about warnings.
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
target_link_libraries(gtest_main gtest)
########################################################################
#
# Samples on how to link user tests with gtest or gtest_main.
#
# They are not built by default. To build them, set the
# gtest_build_samples option to ON. You can do it by running ccmake
# or specifying the -Dgtest_build_samples=ON flag when running cmake.
if (gtest_build_samples)
cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc)
cxx_executable(sample2_unittest samples gtest_main samples/sample2.cc)
cxx_executable(sample3_unittest samples gtest_main)
cxx_executable(sample4_unittest samples gtest_main samples/sample4.cc)
cxx_executable(sample5_unittest samples gtest_main samples/sample1.cc)
cxx_executable(sample6_unittest samples gtest_main)
cxx_executable(sample7_unittest samples gtest_main)
cxx_executable(sample8_unittest samples gtest_main)
cxx_executable(sample9_unittest samples gtest)
cxx_executable(sample10_unittest samples gtest)
endif()
########################################################################
#
# Google Test's own tests.
#
# You can skip this section if you aren't interested in testing
# Google Test itself.
#
# The tests are not built by default. To build them, set the
# gtest_build_tests option to ON. You can do it by running ccmake
# or specifying the -Dgtest_build_tests=ON flag when running cmake.
if (gtest_build_tests)
# This must be set in the root directory for the tests to be run by
# 'make test' or ctest.
enable_testing()
############################################################
# C++ tests built with standard compiler flags.
cxx_test(gtest-death-test_test gtest_main)
cxx_test(gtest_environment_test gtest)
cxx_test(gtest-filepath_test gtest_main)
cxx_test(gtest-linked_ptr_test gtest_main)
cxx_test(gtest-listener_test gtest_main)
cxx_test(gtest_main_unittest gtest_main)
cxx_test(gtest-message_test gtest_main)
cxx_test(gtest_no_test_unittest gtest)
cxx_test(gtest-options_test gtest_main)
cxx_test(gtest-param-test_test gtest
test/gtest-param-test2_test.cc)
cxx_test(gtest-port_test gtest_main)
cxx_test(gtest_pred_impl_unittest gtest_main)
cxx_test(gtest_premature_exit_test gtest
test/gtest_premature_exit_test.cc)
cxx_test(gtest-printers_test gtest_main)
cxx_test(gtest_prod_test gtest_main
test/production.cc)
cxx_test(gtest_repeat_test gtest)
cxx_test(gtest_sole_header_test gtest_main)
cxx_test(gtest_stress_test gtest)
cxx_test(gtest-test-part_test gtest_main)
cxx_test(gtest_throw_on_failure_ex_test gtest)
cxx_test(gtest-typed-test_test gtest_main
test/gtest-typed-test2_test.cc)
cxx_test(gtest_unittest gtest_main)
cxx_test(gtest-unittest-api_test gtest)
############################################################
# C++ tests built with non-standard compiler flags.
# MSVC 7.1 does not support STL with exceptions disabled.
if (NOT MSVC OR MSVC_VERSION GREATER 1310)
cxx_library(gtest_no_exception "${cxx_no_exception}"
src/gtest-all.cc)
cxx_library(gtest_main_no_exception "${cxx_no_exception}"
src/gtest-all.cc src/gtest_main.cc)
endif()
cxx_library(gtest_main_no_rtti "${cxx_no_rtti}"
src/gtest-all.cc src/gtest_main.cc)
cxx_test_with_flags(gtest-death-test_ex_nocatch_test
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0"
gtest test/gtest-death-test_ex_test.cc)
cxx_test_with_flags(gtest-death-test_ex_catch_test
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1"
gtest test/gtest-death-test_ex_test.cc)
cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
gtest_main_no_rtti test/gtest_unittest.cc)
cxx_shared_library(gtest_dll "${cxx_default}"
src/gtest-all.cc src/gtest_main.cc)
cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
gtest_dll test/gtest_all_test.cc)
set_target_properties(gtest_dll_test_
PROPERTIES
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
if (NOT MSVC OR NOT MSVC_VERSION EQUAL 1600)
# The C++ Standard specifies tuple_element<int, class>.
# Yet MSVC 10's <utility> declares tuple_element<size_t, class>.
# That declaration conflicts with our own standard-conforming
# tuple implementation. Therefore using our own tuple with
# MSVC 10 doesn't compile.
cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}"
src/gtest-all.cc src/gtest_main.cc)
cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}"
gtest_main_use_own_tuple test/gtest-tuple_test.cc)
cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}"
gtest_main_use_own_tuple
test/gtest-param-test_test.cc test/gtest-param-test2_test.cc)
endif()
############################################################
# Python tests.
cxx_executable(gtest_break_on_failure_unittest_ test gtest)
py_test(gtest_break_on_failure_unittest)
# MSVC 7.1 does not support STL with exceptions disabled.
if (NOT MSVC OR MSVC_VERSION GREATER 1310)
cxx_executable_with_flags(
gtest_catch_exceptions_no_ex_test_
"${cxx_no_exception}"
gtest_main_no_exception
test/gtest_catch_exceptions_test_.cc)
endif()
cxx_executable_with_flags(
gtest_catch_exceptions_ex_test_
"${cxx_exception}"
gtest_main
test/gtest_catch_exceptions_test_.cc)
py_test(gtest_catch_exceptions_test)
cxx_executable(gtest_color_test_ test gtest)
py_test(gtest_color_test)
cxx_executable(gtest_env_var_test_ test gtest)
py_test(gtest_env_var_test)
cxx_executable(gtest_filter_unittest_ test gtest)
py_test(gtest_filter_unittest)
cxx_executable(gtest_help_test_ test gtest_main)
py_test(gtest_help_test)
cxx_executable(gtest_list_tests_unittest_ test gtest)
py_test(gtest_list_tests_unittest)
cxx_executable(gtest_output_test_ test gtest)
py_test(gtest_output_test)
cxx_executable(gtest_shuffle_test_ test gtest)
py_test(gtest_shuffle_test)
# MSVC 7.1 does not support STL with exceptions disabled.
if (NOT MSVC OR MSVC_VERSION GREATER 1310)
cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception)
set_target_properties(gtest_throw_on_failure_test_
PROPERTIES
COMPILE_FLAGS "${cxx_no_exception}")
py_test(gtest_throw_on_failure_test)
endif()
cxx_executable(gtest_uninitialized_test_ test gtest)
py_test(gtest_uninitialized_test)
cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
py_test(gtest_xml_outfiles_test)
cxx_executable(gtest_xml_output_unittest_ test gtest)
py_test(gtest_xml_output_unittest)
endif()
# This file contains a list of people who've made non-trivial
# contribution to the Google C++ Testing Framework project. People
# who commit code to the project are encouraged to add their names
# here. Please keep the list sorted by first names.
Ajay Joshi <jaj@google.com>
Balázs Dán <balazs.dan@gmail.com>
Bharat Mediratta <bharat@menalto.com>
Chandler Carruth <chandlerc@google.com>
Chris Prince <cprince@google.com>
Chris Taylor <taylorc@google.com>
Dan Egnor <egnor@google.com>
Eric Roman <eroman@chromium.org>
Hady Zalek <hady.zalek@gmail.com>
Jeffrey Yasskin <jyasskin@google.com>
Jói Sigurðsson <joi@google.com>
Keir Mierle <mierle@gmail.com>
Keith Ray <keith.ray@gmail.com>
Kenton Varda <kenton@google.com>
Manuel Klimek <klimek@google.com>
Markus Heule <markus.heule@gmail.com>
Mika Raento <mikie@iki.fi>
Miklós Fazekas <mfazekas@szemafor.com>
Pasi Valminen <pasi.valminen@gmail.com>
Patrick Hanna <phanna@google.com>
Patrick Riley <pfr@google.com>
Peter Kaminski <piotrk@google.com>
Preston Jackson <preston.a.jackson@gmail.com>
Rainer Klaffenboeck <rainer.klaffenboeck@dynatrace.com>
Russ Cox <rsc@google.com>
Russ Rufer <russ@pentad.com>
Sean Mcafee <eefacm@gmail.com>
Sigurður Ásgeirsson <siggi@google.com>
Tracy Bialik <tracy@pentad.com>
Vadim Berman <vadimb@google.com>
Vlad Losev <vladl@google.com>
Zhanyong Wan <wan@google.com>
Copyright 2008, Google Inc.
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 Google Inc. nor the names of its
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.
# Automake file
ACLOCAL_AMFLAGS = -I m4
# Nonstandard package files for distribution
EXTRA_DIST = \
CHANGES \
CONTRIBUTORS \
LICENSE \
include/gtest/gtest-param-test.h.pump \
include/gtest/internal/gtest-param-util-generated.h.pump \
include/gtest/internal/gtest-tuple.h.pump \
include/gtest/internal/gtest-type-util.h.pump \
make/Makefile \
scripts/fuse_gtest_files.py \
scripts/gen_gtest_pred_impl.py \
scripts/pump.py \
scripts/test/Makefile
# gtest source files that we don't compile directly. They are
# #included by gtest-all.cc.
GTEST_SRC = \
src/gtest-death-test.cc \
src/gtest-filepath.cc \
src/gtest-internal-inl.h \
src/gtest-port.cc \
src/gtest-printers.cc \
src/gtest-test-part.cc \
src/gtest-typed-test.cc \
src/gtest.cc
EXTRA_DIST += $(GTEST_SRC)
# Sample files that we don't compile.
EXTRA_DIST += \
samples/prime_tables.h \
samples/sample2_unittest.cc \
samples/sample3_unittest.cc \
samples/sample4_unittest.cc \
samples/sample5_unittest.cc \
samples/sample6_unittest.cc \
samples/sample7_unittest.cc \
samples/sample8_unittest.cc \
samples/sample9_unittest.cc
# C++ test files that we don't compile directly.
EXTRA_DIST += \
test/gtest-death-test_ex_test.cc \
test/gtest-death-test_test.cc \
test/gtest-filepath_test.cc \
test/gtest-linked_ptr_test.cc \
test/gtest-listener_test.cc \
test/gtest-message_test.cc \
test/gtest-options_test.cc \
test/gtest-param-test2_test.cc \
test/gtest-param-test2_test.cc \
test/gtest-param-test_test.cc \
test/gtest-param-test_test.cc \
test/gtest-param-test_test.h \
test/gtest-port_test.cc \
test/gtest_premature_exit_test.cc \
test/gtest-printers_test.cc \
test/gtest-test-part_test.cc \
test/gtest-tuple_test.cc \
test/gtest-typed-test2_test.cc \
test/gtest-typed-test_test.cc \
test/gtest-typed-test_test.h \
test/gtest-unittest-api_test.cc \
test/gtest_break_on_failure_unittest_.cc \
test/gtest_catch_exceptions_test_.cc \
test/gtest_color_test_.cc \
test/gtest_env_var_test_.cc \
test/gtest_environment_test.cc \
test/gtest_filter_unittest_.cc \
test/gtest_help_test_.cc \
test/gtest_list_tests_unittest_.cc \
test/gtest_main_unittest.cc \
test/gtest_no_test_unittest.cc \
test/gtest_output_test_.cc \
test/gtest_pred_impl_unittest.cc \
test/gtest_prod_test.cc \
test/gtest_repeat_test.cc \
test/gtest_shuffle_test_.cc \
test/gtest_sole_header_test.cc \
test/gtest_stress_test.cc \
test/gtest_throw_on_failure_ex_test.cc \
test/gtest_throw_on_failure_test_.cc \
test/gtest_uninitialized_test_.cc \
test/gtest_unittest.cc \
test/gtest_unittest.cc \
test/gtest_xml_outfile1_test_.cc \
test/gtest_xml_outfile2_test_.cc \
test/gtest_xml_output_unittest_.cc \
test/production.cc \
test/production.h
# Python tests that we don't run.
EXTRA_DIST += \
test/gtest_break_on_failure_unittest.py \
test/gtest_catch_exceptions_test.py \
test/gtest_color_test.py \
test/gtest_env_var_test.py \
test/gtest_filter_unittest.py \
test/gtest_help_test.py \
test/gtest_list_tests_unittest.py \
test/gtest_output_test.py \
test/gtest_output_test_golden_lin.txt \
test/gtest_shuffle_test.py \
test/gtest_test_utils.py \
test/gtest_throw_on_failure_test.py \
test/gtest_uninitialized_test.py \
test/gtest_xml_outfiles_test.py \
test/gtest_xml_output_unittest.py \
test/gtest_xml_test_utils.py
# CMake script
EXTRA_DIST += \
CMakeLists.txt \
cmake/internal_utils.cmake
# MSVC project files
EXTRA_DIST += \
msvc/gtest-md.sln \
msvc/gtest-md.vcproj \
msvc/gtest.sln \
msvc/gtest.vcproj \
msvc/gtest_main-md.vcproj \
msvc/gtest_main.vcproj \
msvc/gtest_prod_test-md.vcproj \
msvc/gtest_prod_test.vcproj \
msvc/gtest_unittest-md.vcproj \
msvc/gtest_unittest.vcproj
# xcode project files
EXTRA_DIST += \
xcode/Config/DebugProject.xcconfig \
xcode/Config/FrameworkTarget.xcconfig \
xcode/Config/General.xcconfig \
xcode/Config/ReleaseProject.xcconfig \
xcode/Config/StaticLibraryTarget.xcconfig \
xcode/Config/TestTarget.xcconfig \
xcode/Resources/Info.plist \
xcode/Scripts/runtests.sh \
xcode/Scripts/versiongenerate.py \
xcode/gtest.xcodeproj/project.pbxproj
# xcode sample files
EXTRA_DIST += \
xcode/Samples/FrameworkSample/Info.plist \
xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj \
xcode/Samples/FrameworkSample/runtests.sh \
xcode/Samples/FrameworkSample/widget.cc \
xcode/Samples/FrameworkSample/widget.h \
xcode/Samples/FrameworkSample/widget_test.cc
# C++Builder project files
EXTRA_DIST += \
codegear/gtest.cbproj \
codegear/gtest.groupproj \
codegear/gtest_all.cc \
codegear/gtest_link.cc \
codegear/gtest_main.cbproj \
codegear/gtest_unittest.cbproj
# Distribute and install M4 macro
m4datadir = $(datadir)/aclocal
m4data_DATA = m4/gtest.m4
EXTRA_DIST += $(m4data_DATA)
# We define the global AM_CPPFLAGS as everything we compile includes from these
# directories.
AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/include
# Modifies compiler and linker flags for pthreads compatibility.
if HAVE_PTHREADS
AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1
AM_LIBS = @PTHREAD_LIBS@
else
AM_CXXFLAGS = -DGTEST_HAS_PTHREAD=0
endif
# Build rules for libraries.
lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la
lib_libgtest_la_SOURCES = src/gtest-all.cc
pkginclude_HEADERS = \
include/gtest/gtest-death-test.h \
include/gtest/gtest-message.h \
include/gtest/gtest-param-test.h \
include/gtest/gtest-printers.h \
include/gtest/gtest-spi.h \
include/gtest/gtest-test-part.h \
include/gtest/gtest-typed-test.h \
include/gtest/gtest.h \
include/gtest/gtest_pred_impl.h \
include/gtest/gtest_prod.h
pkginclude_internaldir = $(pkgincludedir)/internal
pkginclude_internal_HEADERS = \
include/gtest/internal/gtest-death-test-internal.h \
include/gtest/internal/gtest-filepath.h \
include/gtest/internal/gtest-internal.h \
include/gtest/internal/gtest-linked_ptr.h \
include/gtest/internal/gtest-param-util-generated.h \
include/gtest/internal/gtest-param-util.h \
include/gtest/internal/gtest-port.h \
include/gtest/internal/gtest-string.h \
include/gtest/internal/gtest-tuple.h \
include/gtest/internal/gtest-type-util.h
lib_libgtest_main_la_SOURCES = src/gtest_main.cc
lib_libgtest_main_la_LIBADD = lib/libgtest.la
# Bulid rules for samples and tests. Automake's naming for some of
# these variables isn't terribly obvious, so this is a brief
# reference:
#
# TESTS -- Programs run automatically by "make check"
# check_PROGRAMS -- Programs built by "make check" but not necessarily run
noinst_LTLIBRARIES = samples/libsamples.la
samples_libsamples_la_SOURCES = \
samples/sample1.cc \
samples/sample1.h \
samples/sample2.cc \
samples/sample2.h \
samples/sample3-inl.h \
samples/sample4.cc \
samples/sample4.h
TESTS=
TESTS_ENVIRONMENT = GTEST_SOURCE_DIR="$(srcdir)/test" \
GTEST_BUILD_DIR="$(top_builddir)/test"
check_PROGRAMS=
# A simple sample on using gtest.
TESTS += samples/sample1_unittest
check_PROGRAMS += samples/sample1_unittest
samples_sample1_unittest_SOURCES = samples/sample1_unittest.cc
samples_sample1_unittest_LDADD = lib/libgtest_main.la \
lib/libgtest.la \
samples/libsamples.la
# Another sample. It also verifies that libgtest works.
TESTS += samples/sample10_unittest
check_PROGRAMS += samples/sample10_unittest
samples_sample10_unittest_SOURCES = samples/sample10_unittest.cc
samples_sample10_unittest_LDADD = lib/libgtest.la
# This tests most constructs of gtest and verifies that libgtest_main
# and libgtest work.
TESTS += test/gtest_all_test
check_PROGRAMS += test/gtest_all_test
test_gtest_all_test_SOURCES = test/gtest_all_test.cc
test_gtest_all_test_LDADD = lib/libgtest_main.la \
lib/libgtest.la
# Tests that fused gtest files compile and work.
FUSED_GTEST_SRC = \
fused-src/gtest/gtest-all.cc \
fused-src/gtest/gtest.h \
fused-src/gtest/gtest_main.cc
if HAVE_PYTHON
TESTS += test/fused_gtest_test
check_PROGRAMS += test/fused_gtest_test
test_fused_gtest_test_SOURCES = $(FUSED_GTEST_SRC) \
samples/sample1.cc samples/sample1_unittest.cc
test_fused_gtest_test_CPPFLAGS = -I"$(srcdir)/fused-src"
# Build rules for putting fused Google Test files into the distribution
# package. The user can also create those files by manually running
# scripts/fuse_gtest_files.py.
$(test_fused_gtest_test_SOURCES): fused-gtest
fused-gtest: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
$(GTEST_SRC) src/gtest-all.cc src/gtest_main.cc \
scripts/fuse_gtest_files.py
mkdir -p "$(srcdir)/fused-src"
chmod -R u+w "$(srcdir)/fused-src"
rm -f "$(srcdir)/fused-src/gtest/gtest-all.cc"
rm -f "$(srcdir)/fused-src/gtest/gtest.h"
"$(srcdir)/scripts/fuse_gtest_files.py" "$(srcdir)/fused-src"
cp -f "$(srcdir)/src/gtest_main.cc" "$(srcdir)/fused-src/gtest/"
maintainer-clean-local:
rm -rf "$(srcdir)/fused-src"
endif
# Death tests may produce core dumps in the build directory. In case
# this happens, clean them to keep distcleancheck happy.
CLEANFILES = core
# Disables 'make install' as installing a compiled version of Google
# Test can lead to undefined behavior due to violation of the
# One-Definition Rule.
install-exec-local:
echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
false
install-data-local:
echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
false
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "gtest.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_main", "gtest_main.vcproj", "{3AF54C8A-10BF-4332-9147-F68ED9862032}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_unittest", "gtest_unittest.vcproj", "{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_prod_test", "gtest_prod_test.vcproj", "{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.ActiveCfg = Debug|Win32
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.Build.0 = Debug|Win32
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.ActiveCfg = Release|Win32
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.Build.0 = Release|Win32
{3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.ActiveCfg = Debug|Win32
{3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.Build.0 = Debug|Win32
{3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.ActiveCfg = Release|Win32
{3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.Build.0 = Release|Win32
{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.ActiveCfg = Debug|Win32
{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.Build.0 = Debug|Win32
{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.ActiveCfg = Release|Win32
{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.Build.0 = Release|Win32
{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.ActiveCfg = Debug|Win32
{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.Build.0 = Debug|Win32
{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.ActiveCfg = Release|Win32
{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment