updated documentation version and license year

This commit is contained in:
The-EDev 2022-03-30 15:41:38 +03:00
parent acf4db8d52
commit f52ba6120e
No known key found for this signature in database
GPG Key ID: 51C45DC0C413DCD9
10 changed files with 9 additions and 158 deletions

View File

@ -38,7 +38,7 @@ PROJECT_NAME = Crow
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 0.3
PROJECT_NUMBER = 1.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -1,7 +1,7 @@
BSD 3-Clause License
Copyright (c) 2014-2017, ipkn
2020-2021, CrowCpp
2020-2022, CrowCpp
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -29,4 +29,4 @@ 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.
The Crow logo and other graphic material (excluding third party logos) used are under exclusive Copyright (c) 2021, Farook Al-Sammarraie (The-EDev), All rights reserved.
The Crow logo and other graphic material (excluding third party logos) used are under exclusive Copyright (c) 2021-2022, Farook Al-Sammarraie (The-EDev), All rights reserved.

View File

@ -1,146 +0,0 @@
This page explains how to set Crow up for use with your project (***For versions 0.3+4 and lower***).
##Requirements
- C++ compiler with C++11 support.
- Crow's CI uses g++-9.3 and clang-7.0 running on AMD64 (x86_64) and ARM64v8
- boost library (1.64 or later).
- **(optional)** ZLib for HTTP Compression.
- **(optional)** CMake and Python3 to build tests and/or examples.
<br><br>
##Installing Requirements
!!! note
The Linux requirements are for developing and compiling a Crow application. Running a built application requires the actual libraries rather than just the development headers.
###Ubuntu
`sudo apt-get install build-essential libboost-all-dev`
###Arch
`sudo pacman -S python boost boost-libs`
###Non Debian based GNU/Linux
Use your package manager to install the following:
- GCC and G++ (or Clang and Clang++)
- Boost Development headers (sometimes part of the Boost package itself)
###OSX
`brew install boost`
###Windows
Microsoft Visual Studio 2019 (older versions not tested)
##Downloading
Either run `git clone https://github.com/crowcpp/crow.git` or download `crow_all.h` from the releases section. You can also download a zip of the project on Github.
##Includes folder
1. Copy the `/includes` folder to your project's root folder.
2. Add `#!cpp #include "path/to/includes/crow.h"` to your `.cpp` file.
3. For any middlewares, add `#!cpp #include "path/to/includes/middlewares/some_middleware.h"`.
<br><br>
##Single header file
If you've downloaded `crow_all.h`, you can skip to step **4**.
1. Make sure you have python 3 installed.
2. Open a terminal (or `cmd.exe`) instance in `/path/to/crow/scripts`.
3. Run `python merge_all.py ../include crow_all.h` (replace `/` with `\` if you're on Windows).
4. Copy the `crow_all.h` file to where you put your libraries (if you don't know where this is, you can put it anywhere).
5. Add `#!cpp #include "path/to/crow_all.h"` to your `.cpp` file.
<br><br>
**Note**: All middlewares are included with the merged header file, if you would like to include or exclude middlewares use the `-e` or `-i` arguments.
<br><br>
##building via CLI
To build a crow Project, do the following:
###GCC (G++)
- Release: `g++ main.cpp -lpthread -lboost_system`.
- Debug: `g++ main.cpp -ggdb -lpthread -lboost_system -DCROW_ENABLE_DEBUG`.
- SSL: `g++ main.cpp -lssl -lcrypto -lpthread -lboost_system -DCROW_ENABLE_SSL`.
###Clang
- Release: `clang++ main.cpp -lpthread -lboost_system`.
- Debug: `clang++ main.cpp -g -lpthread -lboost_system -DCROW_ENABLE_DEBUG`.
- SSL: `clang++ main.cpp -lssl -lcrypto -lpthread -lboost_system -DCROW_ENABLE_SSL`.
###Microsoft Visual Studio 2019
The following guide will use `example_with_all.cpp` as the Crow application for demonstration purposes.
1. Generate `crow_all.h` following [Single header file](#single-header-file).
2. `git clone https://github.com/microsoft/vcpkg.git`
3. `.\vcpkg\bootstrap-vcpkg.bat`
4. `.\vcpkg\vcpkg integrate install`
5. Create empty Visual Studio project.
6. In solution explorer, right click the name of your project then click `Open Folder in File Explorer`.
7. Copy `crow_all.h`, `example_with_all.cpp`, `vcpkg.json` to opened folder.
8. Add `crow_all.h` to `Header Files` and `example_with_all.cpp` to `Source Files`.
9. In solution explorer, right click the name of your project then click `Properties`.
10. Under `vcpkg`, set `Use Vcpkg Manifest` to `Yes` and `Additional Options` to `--feature-flags="versions"`.
11. Set `Debug/Release` and `x64/x86`.
12. Run.
##building via CMake
Add the following to your `CMakeLists.txt`:
``` cmake linenums="1"
find_package(Threads)
find_package(ZLIB)
find_package(OpenSSL)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
if (MSVC)
set(Boost_USE_STATIC_LIBS "On")
find_package( Boost 1.70 COMPONENTS system thread regex REQUIRED )
else()
find_package( Boost 1.70 COMPONENTS system thread REQUIRED )
endif()
include_directories(${Boost_INCLUDE_DIR})
set(PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
include_directories("${PROJECT_INCLUDE_DIR}")
```
!!!note
The last 2 lines are unnecessary if you're using `crow_all.h`.
##Building Crow tests and examples
Out-of-source build with CMake is recommended.
```
mkdir build
cd build
cmake ..
make
```
Running CMake will create `crow_all.h` file and place it in the build directory.<br>
You can run tests with following command:
```
ctest -V
```
##Installing Crow
if you wish to use Crow globally without copying `crow_all.h` in your projects, you can install Crow on your machine with the procedure below.
```
mkdir build
cd build
cmake ..
make install
```
`make install` will copy `crow_all.h` automatically in your `/usr/local/include` thus making it available globally for use.<br>

View File

@ -3,6 +3,6 @@
Using `#!cpp crow::utility::base64encode(mystring, mystring.size())` will return a Base64 encoded string. For URL safe Base64 `#!cpp crow::utility::base64encode_urlsafe(mystring, mystring.size())` can be used. The key used in the encoding process can be changed, it is a string containing all 64 characters to be used.
## Decoding
**Introduced in: `master`**<br><br>
**Introduced in: `v1.0`**<br><br>
Using `#!cpp crow::utility::base64decode(mystring, mystring.size())` with `mystring` being a Base64 encoded string will return a plain-text string. The function works with both normal and URL safe Base64. However it cannot decode a Base64 string encoded with a custom key.

View File

@ -1,6 +1,4 @@
!!! Warning
This feature is currently only available on the "master" branch.
**Introduced in: `v1.0`**<br><br>
Crow supports flask style blueprints.<br>
A blueprint is a limited app. It cannot handle networking. But it can handle routes.<br>

View File

@ -33,7 +33,7 @@ A `wvalue` can be treated as an object or even a list (setting a value by using
!!! warning
JSON does not allow floating point values like `NaN` or `INF`, Crow will output `null` instead of `NaN` or `INF` when converting `wvalue` to a string. (`{"Key": NaN}` becomes `{"Key": null}`) (master and later)
JSON does not allow floating point values like `NaN` or `INF`, Crow will output `null` instead of `NaN` or `INF` when converting `wvalue` to a string. (`{"Key": NaN}` becomes `{"Key": null}`)
<br><br>

View File

@ -31,7 +31,7 @@ Writing a log is as simple as `#!cpp CROW_LOG_<LOG LEVEL> << "Hello";` (replace&
Log times are reported in GMT timezone by default. This is because HTTP requires all reported times for requests and responses to be in GMT. This can be changed by using the macro `CROW_USE_LOCALTIMEZONE` which will set **only the log timezone** to the server's local timezone.
## Creating A custom logger
**Introduced in: `master`**<br><br>
**Introduced in: `v1.0`**<br><br>
Assuming you have an existing logger or Crow's default format just doesn't work for you. Crow allows you to use a custom logger for any log made using the `CROW_LOG_<LOG LEVEL>` macro.<br>
All you need is a class extending `#!cpp crow::ILogHandler` containing the method `#!cpp void log(std::string, crow::LogLevel)`.<br>

View File

@ -21,7 +21,7 @@ A message can be created either by defining the headers, boundary, and individua
Once a multipart message has been made, the individual parts can be accessed throughout `msg.parts`, `parts` is an `std::vector`.<br><br>
**Introduced in: `master`**<br><br>
**Introduced in: `v1.0`**<br><br>
Part headers are organized in a similar way to request and response headers, and can be retrieved via `crow::multipart::get_header_object("header-key")`. This function returns a `crow::multipart::header` object.<br><br>

View File

@ -75,7 +75,7 @@ class a : public crow::returnable
<br><br>
## Response codes
**Introduced in: `master`**<br><br>
**Introduced in: `v1.0`**<br><br>
Instead of assigning a response code, you can use the `crow::status` enum, for example you can replace `crow::response(200)` with `crow::response(crow::status::OK)`

View File

@ -35,7 +35,6 @@ nav:
- Linux: getting_started/setup/linux.md
- MacOS: getting_started/setup/macos.md
- Windows: getting_started/setup/windows.md
- Legacy: getting_started/setup/legacy.md
- Your First Application: getting_started/your_first_application.md
- Guides:
- Different parts of Crow: