summaryrefslogtreecommitdiff
path: root/project2/cgi
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-02-07 19:06:43 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-02-07 19:06:43 +0000
commit115f6dd6e6bd7be6173effec94a4b48289328d70 (patch)
tree6f21e91216f6db2f5875635b66737b69761f4a48 /project2/cgi
parentGCC-8.2 and libadhocutil-0.6 compat fixes (diff)
downloadproject2-115f6dd6e6bd7be6173effec94a4b48289328d70.tar.bz2
project2-115f6dd6e6bd7be6173effec94a4b48289328d70.tar.xz
project2-115f6dd6e6bd7be6173effec94a4b48289328d70.zip
Remove boost::filesystem in favour of std::filesystem
Diffstat (limited to 'project2/cgi')
-rw-r--r--project2/cgi/Jamfile.jam8
-rw-r--r--project2/cgi/cgiProgRouter.cpp14
-rw-r--r--project2/cgi/cgiSimpleRouter.cpp10
-rw-r--r--project2/cgi/p2webFCgi.cpp5
4 files changed, 19 insertions, 18 deletions
diff --git a/project2/cgi/Jamfile.jam b/project2/cgi/Jamfile.jam
index 2de7856..9f47a72 100644
--- a/project2/cgi/Jamfile.jam
+++ b/project2/cgi/Jamfile.jam
@@ -2,7 +2,7 @@ alias glibmm : : : :
<cflags>"`pkg-config --cflags glibmm-2.4`"
<linkflags>"`pkg-config --libs glibmm-2.4`"
;
-lib boost_filesystem : : <name>boost_filesystem ;
+lib stdc++fs ;
lib cgicc : : <name>cgicc ;
lib fcgi : : <name>fcgi ;
lib fcgi++ : : <name>fcgi++ ;
@@ -12,7 +12,7 @@ cpp-pch pch : pch.hpp :
<library>cgicc
<library>glibmm
<library>../common//p2common
- <library>boost_filesystem
+ <library>stdc++fs
<library>../xml//p2xml
;
lib p2cgicommon :
@@ -24,7 +24,7 @@ lib p2cgicommon :
<library>glibmm
<library>../common//p2common
<library>..//adhocutil
- <library>boost_filesystem
+ <library>stdc++fs
<library>../xml//p2xml
<library>gcrypt
: :
@@ -45,7 +45,7 @@ exe p2fcgi :
fcgi
:
<library>p2cgicommon
- <library>boost_filesystem
+ <library>stdc++fs
;
exe testCgi :
diff --git a/project2/cgi/cgiProgRouter.cpp b/project2/cgi/cgiProgRouter.cpp
index 983e8cd..3070c91 100644
--- a/project2/cgi/cgiProgRouter.cpp
+++ b/project2/cgi/cgiProgRouter.cpp
@@ -1,5 +1,5 @@
#include <pch.hpp>
-#include <boost/filesystem/path.hpp>
+#include <filesystem>
#include <boost/algorithm/string/predicate.hpp>
#include "cgiRequestContext.h"
#include "commonObjects.h"
@@ -91,8 +91,8 @@ class RoutingTable {
present(s->value("present", NULL).as<std::string>()),
path(s->value("path", NULL).as<std::string>())
{
- boost::filesystem::path fspath = path;
- boost::filesystem::path::iterator p = fspath.begin();
+ std::filesystem::path fspath = path;
+ std::filesystem::path::iterator p = fspath.begin();
p++;
while(p != fspath.end() && p->string() != ".") {
switch (p->string().front()) {
@@ -106,8 +106,8 @@ class RoutingTable {
p++;
}
}
- bool matches(const boost::filesystem::path & path, VarMap & vars) const {
- boost::filesystem::path::iterator p = path.begin();
+ bool matches(const std::filesystem::path & path, VarMap & vars) const {
+ std::filesystem::path::iterator p = path.begin();
p++;
for (RouteElems::const_iterator re = routeElems.begin(); re != routeElems.end() || p != path.end(); re++) {
if (re == routeElems.end() || p == path.end() || !(*re)->matches(p->string(), vars)) {
@@ -172,8 +172,8 @@ class ProgRouter : public Router {
}
void present(const MultiRowSetPresenter * p) const {
p->addNewArray("uriElem", true);
- boost::filesystem::path y(path);
- boost::filesystem::path::iterator pathPart = y.begin();
+ std::filesystem::path y(path);
+ std::filesystem::path::iterator pathPart = y.begin();
while(++pathPart != y.end()) {
p->addNamedValue("uriElem", pathPart->string());
}
diff --git a/project2/cgi/cgiSimpleRouter.cpp b/project2/cgi/cgiSimpleRouter.cpp
index bc8c544..0eaea0f 100644
--- a/project2/cgi/cgiSimpleRouter.cpp
+++ b/project2/cgi/cgiSimpleRouter.cpp
@@ -1,15 +1,15 @@
#include "cgiRequestContext.h"
-#include <boost/filesystem/path.hpp>
+#include <filesystem>
#include "scriptLoader.h"
#include "presenter.h"
SimpleNumericException(UriElementOutOfRange);
std::vector<std::string>
-makeVector(const boost::filesystem::path & y)
+makeVector(const std::filesystem::path & y)
{
std::vector<std::string> r;
- boost::filesystem::path::iterator p = y.begin();
+ std::filesystem::path::iterator p = y.begin();
p++;
while(p != y.end()) {
r.push_back((p++)->string());
@@ -41,8 +41,8 @@ class SimpleRouter : public Router {
}
void present(const MultiRowSetPresenter * p) const {
p->addNewArray("uriElem", true);
- boost::filesystem::path y(path);
- boost::filesystem::path::iterator pathPart = y.begin();
+ std::filesystem::path y(path);
+ std::filesystem::path::iterator pathPart = y.begin();
while(++pathPart != y.end()) {
p->addNamedValue("uriElem", pathPart->string());
}
diff --git a/project2/cgi/p2webFCgi.cpp b/project2/cgi/p2webFCgi.cpp
index fae6cca..1a63346 100644
--- a/project2/cgi/p2webFCgi.cpp
+++ b/project2/cgi/p2webFCgi.cpp
@@ -1,7 +1,7 @@
#include "FCgiIO.h"
#include "cgiAppEngine.h"
#include <boost/bind.hpp>
-#include <boost/filesystem/convenience.hpp>
+#include <filesystem>
time_t lastPeriodic = 0;
time_t periodicDelay = 600;
@@ -40,12 +40,13 @@ main(void)
fprintf(stderr, "Failed to set signal handler\n");
}
alarm(60);
+ auto initial_path(std::filesystem::current_path());
LifeCycle::onAllComponents(boost::bind(&LifeCycle::onBegin, _1));
CgiApplicationEngine app;
while (FCGX_Accept_r(&request) == 0) {
alarm(0);
cgicc::FCgiIO IO(request);
- boost::filesystem::current_path(boost::filesystem::initial_path());
+ std::filesystem::current_path(initial_path);
app.process(IO, &IO, IO);
FCGX_Finish_r(&request);
LifeCycle::onAllComponents(boost::bind(&LifeCycle::onIteration, _1));