summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-07-10 12:08:19 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-07-10 12:08:19 +0200
commitf0a21e78764fd17747033b596b640bbcaf517f49 (patch)
tree564ef37556e9a0c351a5aea874a1e315e67d8d9b /lib
parent1c4bcb0ca012bebe7c7b9408aa85bb5b089e4619 (diff)
feat&fix: Reorganize library, and remove junk CMake files.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/detail/.keep0
-rw-r--r--lib/detail/error.hpp17
-rw-r--r--lib/fix/network.hpp8
-rw-r--r--lib/fix/parser.hpp2
-rw-r--r--lib/logic/equiv.hpp (renamed from lib/equiv.hpp)0
-rw-r--r--lib/logic/math.hpp (renamed from lib/math.hpp)0
-rw-r--r--lib/logic/opt.hpp (renamed from lib/opt.hpp)32
-rw-r--r--lib/utility/cgi.hpp (renamed from lib/cgi.hpp)4
-rw-r--r--lib/utility/crc32.hpp (renamed from lib/crc32.hpp)4
-rw-r--r--lib/utility/embfs.hpp (renamed from lib/embfs.hpp)0
10 files changed, 42 insertions, 25 deletions
diff --git a/lib/detail/.keep b/lib/detail/.keep
deleted file mode 100644
index e69de29..0000000
--- a/lib/detail/.keep
+++ /dev/null
diff --git a/lib/detail/error.hpp b/lib/detail/error.hpp
new file mode 100644
index 0000000..85a5e25
--- /dev/null
+++ b/lib/detail/error.hpp
@@ -0,0 +1,17 @@
+/*
+ * File: opt.hpp
+ * Author: Amlal El Mahrouss,
+ * Copyright 2023-2025, Amlal El Mahrouss/SNU Systems Corp all rights reserved.
+ */
+
+#ifndef _SNU_ERR_HPP
+#define _SNU_ERR_HPP
+
+#include <stdexcept>
+
+namespace snu
+{
+ using runtime_error = std::runtime_error;
+}
+
+#endif // _SNU_ERR_HPP \ No newline at end of file
diff --git a/lib/fix/network.hpp b/lib/fix/network.hpp
index a99ba05..9186b15 100644
--- a/lib/fix/network.hpp
+++ b/lib/fix/network.hpp
@@ -1,6 +1,6 @@
/*
* File: fix/netowrk.hpp
- * Purpose: Financial Information Protocol network implementation in C++.
+ * Purpose: Financial Information Exchange in C++
* Author: Amlal El Mahrouss (founder@snu.systems)
* Copyright 2025, Amlal El Mahrouss and SNU Systems Corp all rights reserved.
*/
@@ -13,8 +13,8 @@
namespace snu::fix
{
- class network_rx;
- class network_tx;
-}
+ class network_rx;
+ class network_tx;
+} // namespace snu::fix
#endif // ifndef _SNU_FIX_NETWORK_HPP \ No newline at end of file
diff --git a/lib/fix/parser.hpp b/lib/fix/parser.hpp
index bca5353..f643241 100644
--- a/lib/fix/parser.hpp
+++ b/lib/fix/parser.hpp
@@ -1,6 +1,6 @@
/*
* File: fix/parser.hpp
- * Purpose: Financial Information Protocol parser implementation in C++.
+ * Purpose: Financial Information Exchange parser in C++
* Author: Amlal El Mahrouss (founder@snu.systems)
* Copyright 2025, Amlal El Mahrouss and SNU Systems Corp all rights reserved.
*/
diff --git a/lib/equiv.hpp b/lib/logic/equiv.hpp
index 4bb5904..4bb5904 100644
--- a/lib/equiv.hpp
+++ b/lib/logic/equiv.hpp
diff --git a/lib/math.hpp b/lib/logic/math.hpp
index 2613799..2613799 100644
--- a/lib/math.hpp
+++ b/lib/logic/math.hpp
diff --git a/lib/opt.hpp b/lib/logic/opt.hpp
index f4f62a2..d2a9150 100644
--- a/lib/opt.hpp
+++ b/lib/logic/opt.hpp
@@ -7,12 +7,12 @@
#ifndef _SNU_OPT_HPP
#define _SNU_OPT_HPP
-#include <stdexcept>
+#include <lib/detail/error.hpp>
#include <utility>
-namespace snu
+namespace snu::opt
{
- enum class ret
+ enum class return_type
{
invalid = 0,
okay = 100,
@@ -22,14 +22,14 @@ namespace snu
struct opt final
{
- explicit opt(const ret& ret)
- : m_ret(ret)
+ explicit opt(const return_type& return_type)
+ : m_ret(return_type)
{
}
opt& expect(const char* input)
{
- if (m_ret == ret::err)
+ if (m_ret == return_type::err)
{
throw std::runtime_error(input);
}
@@ -38,13 +38,13 @@ namespace snu
}
private:
- ret m_ret;
+ return_type m_ret;
};
template <typename Teller, typename... Lst>
- inline snu::ret eval(Teller tell, Lst&&... arg)
+ inline return_type eval(Teller tell, Lst&&... arg)
{
- return tell(std::forward<Lst>(arg)...) ? snu::ret::okay : snu::ret::err;
+ return tell(std::forward<Lst>(arg)...) ? return_type::okay : return_type::err;
}
namespace traits
@@ -87,26 +87,26 @@ namespace snu
} // namespace traits
template <typename... Lst>
- inline ret eval_less_than(Lst&&... arg)
+ inline return_type eval_less_than(Lst&&... arg)
{
static traits::int_less_than_teller eq;
- return eq(std::forward<Lst>(arg)...) ? ret::okay : ret::err;
+ return eq(std::forward<Lst>(arg)...) ? return_type::okay : return_type::err;
}
template <typename... Lst>
- inline ret eval_eq(Lst&&... arg)
+ inline return_type eval_eq(Lst&&... arg)
{
static traits::int_eq_teller less_than;
- return less_than(std::forward<Lst>(arg)...) ? ret::okay : ret::err;
+ return less_than(std::forward<Lst>(arg)...) ? return_type::okay : return_type::err;
}
template <typename... Lst>
- inline ret eval_greater_than(Lst&&... arg)
+ inline return_type eval_greater_than(Lst&&... arg)
{
static traits::int_greater_than_teller greater_than;
- return greater_than(std::forward<Lst>(arg)...) ? ret::okay : ret::err;
+ return greater_than(std::forward<Lst>(arg)...) ? return_type::okay : return_type::err;
}
-} /* namespace snu */
+} // namespace snu::opt
#endif /* ifndef _SNU_OPT_HPP */
diff --git a/lib/cgi.hpp b/lib/utility/cgi.hpp
index e171eed..b93cde7 100644
--- a/lib/cgi.hpp
+++ b/lib/utility/cgi.hpp
@@ -13,7 +13,7 @@
namespace snu
{
- namespace web
+ namespace cgi
{
/// @brief CGI Writer class, writes to stdout; as CGI expects.
class cgi_writer final
@@ -56,7 +56,7 @@ namespace snu
return this->eval_("text/javascript", ss_html);
}
};
- } // namespace web
+ } // namespace cgi
} // namespace snu
#endif // ifndef _SNU_CGI_HPP \ No newline at end of file
diff --git a/lib/crc32.hpp b/lib/utility/crc32.hpp
index bbdb15c..de78d4e 100644
--- a/lib/crc32.hpp
+++ b/lib/utility/crc32.hpp
@@ -14,7 +14,7 @@
/// @brief Crc32 implementation in C++
/// @author Amlal EL Mahrouss (founder@snu.systems)
-namespace snu
+namespace snu::crc32
{
namespace details
{
@@ -69,6 +69,6 @@ namespace snu
return ~crc;
}
} // namespace details
-} // namespace snu
+} // namespace snu::crc32
#endif // !_SNU_CRC32_HPP \ No newline at end of file
diff --git a/lib/embfs.hpp b/lib/utility/embfs.hpp
index 7beb1db..7beb1db 100644
--- a/lib/embfs.hpp
+++ b/lib/utility/embfs.hpp