Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests

on:
push:

jobs:
tests:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/master' }}
tags: iantorres/expressions:latest
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.28)
CMAKE_MINIMUM_REQUIRED(VERSION 3.25)
PROJECT(Expressions VERSION 1.0.0 LANGUAGES CXX)

SET(CMAKE_CXX_STANDARD 23)
SET(CMAKE_CXX_STANDARD_REQUIRED True)

OPTION(BUILD_TESTS "Build tests" ON)
OPTION(BUILD_TESTS "Build tests" OFF)

INCLUDE(FetchContent)

Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM iantorres/boosted:amd64-latest

COPY . .

RUN cmake . -DBUILD_TESTS=ON \
&& make \
&& cd bin \
&& ./tests
15 changes: 15 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ZenAlgorithms Expressions
Copyright (C) 2024 Ian Torres <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Expressions

## Build

```shell
git clone [email protected]:ZenAlgorithms/Expressions.git
cd Expressions
cmake .
make
make install
```

## Usage

```c++
#include <expression/expression.hpp>

using namespace std;

auto it = expression::from_string("/api/servers/{server}/status");

auto result = it->query("/api/servers/production/status");

cout << result->matches() << endl;
// 1

cout << result->bindings()->at("server") << endl;
// production
```