Skip to content

Commit

Permalink
Add doxygen-awesome-css submodule and update Doxyfile
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryKogan committed Dec 21, 2023
1 parent 10b5254 commit bdbaac1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
docs
doxygen-awesome-css
.vscode
.DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "doxygen-awesome-css"]
path = doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
10 changes: 6 additions & 4 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,8 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.

USE_MDFILE_AS_MAINPAGE =
INPUT += README.md
USE_MDFILE_AS_MAINPAGE = README.md

# The Fortran standard specifies that for fixed formatted Fortran code all
# characters from position 72 are to be considered as comment. A common
Expand Down Expand Up @@ -1357,7 +1358,8 @@ HTML_STYLESHEET =
# documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_EXTRA_STYLESHEET =
HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css \
doxygen-awesome-css/doxygen-awesome-sidebar-only.css

# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
Expand All @@ -1380,7 +1382,7 @@ HTML_EXTRA_FILES =
# The default value is: AUTO_LIGHT.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_COLORSTYLE = AUTO_LIGHT
HTML_COLORSTYLE = LIGHT

# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
Expand Down Expand Up @@ -1688,7 +1690,7 @@ DISABLE_INDEX = NO
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

GENERATE_TREEVIEW = NO
GENERATE_TREEVIEW = YES

# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# result-cpp

Result-CPP is a C++ library that provides a `Result<T, E>` type, which can be used to return and propagate errors. It's inspired by Rust's `std::Result` type.

## Features

- `Result<T, E>` type for returning and propagating errors.
- `Ok` and `Err` static methods for creating successful and unsuccessful `Result` objects respectively.
- `is_ok` and `is_err` methods for checking if the `Result` is successful or unsuccessful.
- `unwrap` and `unwrap_err` methods for extracting the value or error from the `Result`.

## Usage

```cpp
#include <iostream>
#include "result.h"

res::Result<int, std::string> divide(int a, int b) {
if (b == 0) {
return res::Result<int, std::string>::Err("Division by zero");
} else {
return res::Result<int, std::string>::Ok(a / b);
}
}

int main() {
auto result = divide(10, 2);

if (result.is_ok()) {
std::cout << "Result: " << result.unwrap() << '\n';
} else {
std::cout << "Error: " << result.unwrap_err() << '\n';
}
}
```

0 comments on commit bdbaac1

Please sign in to comment.