Skip to content

Commit

Permalink
Merge pull request #1 from PhilipDeegan/updates
Browse files Browse the repository at this point in the history
updates etc
  • Loading branch information
PhilipDeegan committed May 8, 2023
2 parents bba3c4c + be13748 commit adbf813
Show file tree
Hide file tree
Showing 19 changed files with 244 additions and 239 deletions.
7 changes: 7 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
IndentWidth: 2
BasedOnStyle: 'google'
ColumnLimit: 100
SortIncludes: false
UseTab: Never
DerivePointerAlignment: false
PointerAlignment: Left
19 changes: 19 additions & 0 deletions .github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: ubuntu-latest

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: "Build/Test"
run: |
curl -Lo mkn https://github.com/PhilipDeegan/mkn/releases/download/latest/mkn_nix
chmod +x mkn
KLOG=3 ./mkn clean build run -dtOp test -a "-std=c++17 -fPIC"
17 changes: 17 additions & 0 deletions .sublime-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"folders" :
[
{
"path" : "."
}
],
"settings" :
{
"ClangFormat" :
{
"binary" : "clang-format-13",
"format_on_save" : true,
"style" : "file"
}
}
}
3 changes: 3 additions & 0 deletions .sublime-project.sublime-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"project": ".sublime-project"
}
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013, Philip Deegan.
Copyright (c) 2023, Philip Deegan.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
**Cross platform http/https C++ object web server**


[README](https://raw.githubusercontent.com/Dekken/httplus/master/README.noformat)
[README](https://raw.githubusercontent.com/PhilipDeegan/httplus/master/README.noformat)

6 changes: 3 additions & 3 deletions httplus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# threads: 4

http:
- root: /var/www/global # no default, mandatory
- root: res/www # no default, mandatory
host: localhost # missing assumed default for port
port: 8888 # default 80
home: index # optional default page/generator
# header:
# Content-Type: text/html
- root: /var/www/global # no default, mandatory
- root: res/www # no default, mandatory
port: 8888 # default 80
home: index # optional default page/generator

# https:
# - root: /var/www/global # no default, mandatory
# - root: res/www # no default, mandatory
# host: localhost # no default, mandatory
# port: 443 # default 443
# home: index # optional default page/generator
Expand Down
16 changes: 8 additions & 8 deletions inc/httplus.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016, Philip Deegan.
Copyright (c) 2023, Philip Deegan.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -31,19 +31,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef _HTTPLUS_HPP_
#define _HTTPLUS_HPP_

#include "kul/log.hpp"
#include "kul/threads.hpp"
#include "mkn/kul/log.hpp"
#include "mkn/kul/threads.hpp"

#include "httplus/html.hpp"
#include "httplus/http.hpp"
#include "httplus/yaml.hpp"

namespace httplus {

class Exception : public kul::Exception {
class Exception : public mkn::kul::Exception {
public:
Exception(const char* f, const uint16_t& l, const std::string& s)
: kul::Exception(f, l, s) {}
: mkn::kul::Exception(f, l, s) {}
};

class App {
Expand All @@ -52,9 +52,9 @@ class App {

public:
App() : config(httplus::yaml::Conf::CREATE()) {}
void load(kul::hash::map::S2T<std::shared_ptr<http::AServer>>& http,
Sites& sites) throw(httplus::Exception);
void load(mkn::kul::hash::map::S2T<std::shared_ptr<http::AServer>>& http, Sites& sites)
KTHROW(httplus::Exception);
};
}
} // namespace httplus

#endif /* _HTTPLUS_HPP_ */
2 changes: 1 addition & 1 deletion inc/httplus/def.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016, Philip Deegan.
Copyright (c) 2023, Philip Deegan.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
29 changes: 15 additions & 14 deletions inc/httplus/html.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016, Philip Deegan.
Copyright (c) 2023, Philip Deegan.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -31,34 +31,35 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef _HTTPLUS_PAGE_HPP_
#define _HTTPLUS_PAGE_HPP_

#include "kul/html4.hpp"
#include "kul/http.hpp"
#include "kul/log.hpp"
#include "kul/threads.hpp"
#include "mkn/kul/log.hpp"
#include "mkn/kul/threads.hpp"

#include "mkn/ram/http.hpp"
#include "mkn/ram/html4.hpp"

namespace httplus {

class Page : public kul::html4::Page {
class Page : public mkn::ram::html4::Page {
protected:
template <class T>
std::shared_ptr<T> clone(const T& src) {
std::shared_ptr<T> clone(const T& /*src*/) {
return std::make_shared<T>();
}

public:
virtual std::shared_ptr<Page> clone() = 0; //{ return clone(*this); }
virtual void pre(const kul::http::A1_1Request& req) {}
virtual void post(const kul::http::A1_1Request& req,
kul::http::Response& res) {}
virtual void pre(const mkn::ram::http::A1_1Request& /*req*/) {}
virtual void post(const mkn::ram::http::A1_1Request& /*req*/, mkn::ram::http::Response& /*res*/) {
}
};
typedef kul::hash::map::S2T<std::shared_ptr<Page>> Pages;
typedef mkn::kul::hash::map::S2T<std::shared_ptr<Page>> Pages;

class XXXError {
public:
virtual void recover(Page& e) = 0;
};

typedef kul::hash::map::S2T<std::shared_ptr<Page>> Pages;
typedef kul::hash::map::S2T<Pages> Sites;
}
typedef mkn::kul::hash::map::S2T<std::shared_ptr<Page>> Pages;
typedef mkn::kul::hash::map::S2T<Pages> Sites;
} // namespace httplus
#endif /* _HTTPLUS_PAGE_HPP_ */
Loading

0 comments on commit adbf813

Please sign in to comment.