summaryrefslogtreecommitdiffhomepage
path: root/dev/lib/utility
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-10-14 04:35:26 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-10-14 04:35:26 +0200
commita786997f304745ce3766a82be06dc6a5d0c2f02c (patch)
treedb923caaec3762fbb68290fd1ae94cb1465378e7 /dev/lib/utility
parentfa4748e414e9494442f9bcde9c659d3951af19c0 (diff)
feat: scl: major refactors and new version of SCL.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/utility')
-rw-r--r--dev/lib/utility/cgi_writer.hpp28
-rw-r--r--dev/lib/utility/chunk_string.hpp6
-rw-r--r--dev/lib/utility/crc32.hpp10
-rw-r--r--dev/lib/utility/embfs.hpp10
4 files changed, 27 insertions, 27 deletions
diff --git a/dev/lib/utility/cgi_writer.hpp b/dev/lib/utility/cgi_writer.hpp
index 126b299..87354ac 100644
--- a/dev/lib/utility/cgi_writer.hpp
+++ b/dev/lib/utility/cgi_writer.hpp
@@ -4,15 +4,15 @@
* Copyright 2023-2025, Amlal El Mahrouss.
*/
-#ifndef _OCL_CGI_WRITER_HPP
-#define _OCL_CGI_WRITER_HPP
+#ifndef _SCL_CGI_WRITER_HPP
+#define _SCL_CGI_WRITER_HPP
#include <lib/io/print.hpp>
#include <lib/utility/chunk_string.hpp>
#include <sstream>
#include <format>
-namespace ocl
+namespace scl
{
namespace cgi
{
@@ -21,7 +21,7 @@ namespace ocl
class basic_writer
{
private:
- basic_writer& eval_(const ocl::basic_chunk_string<char_type>& mime, const ocl::basic_chunk_string<char_type>& ss) noexcept
+ basic_writer& eval_(const scl::basic_chunk_string<char_type>& mime, const scl::basic_chunk_string<char_type>& ss) noexcept
{
std::basic_stringstream<char_type> ss_out;
@@ -30,50 +30,50 @@ namespace ocl
ss_out << std::format("Content-Length: {}\r\n\r\n", ss.str().size());
ss_out << ss.str();
- ocl::io::print(ss_out.str());
+ scl::io::print(ss_out.str());
return *this;
}
public:
explicit basic_writer() = default;
- ~basic_writer() = default;
+ virtual ~basic_writer() = default;
basic_writer& operator=(const basic_writer&) = default;
basic_writer(const basic_writer&) = default;
public:
- friend void operator<<(basic_writer& self, const ocl::basic_chunk_string<char_type>& ss_in)
+ friend void operator<<(basic_writer& self, const scl::basic_chunk_string<char_type>& ss_in)
{
self = self.eval_("text/plain", ss_in);
}
- basic_writer& binary(const ocl::basic_chunk_string<char_type>& ss_in)
+ basic_writer& binary(const scl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("application/octet-stream", ss_in);
}
- basic_writer& html(const ocl::basic_chunk_string<char_type>& ss_in)
+ basic_writer& html(const scl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("text/html", ss_in);
}
- basic_writer& xml(const ocl::basic_chunk_string<char_type>& ss_in)
+ basic_writer& xml(const scl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("application/xml", ss_in);
}
- basic_writer& json(const ocl::basic_chunk_string<char_type>& ss_in)
+ basic_writer& json(const scl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("application/json", ss_in);
}
- basic_writer& js(const ocl::basic_chunk_string<char_type>& ss_in)
+ basic_writer& js(const scl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("text/javascript", ss_in);
}
};
} // namespace cgi
-} // namespace ocl
+} // namespace scl
-#endif // ifndef _OCL_CGI_WRITER_HPP
+#endif // ifndef _SCL_CGI_WRITER_HPP
diff --git a/dev/lib/utility/chunk_string.hpp b/dev/lib/utility/chunk_string.hpp
index 4fe5cc2..c5bf5c6 100644
--- a/dev/lib/utility/chunk_string.hpp
+++ b/dev/lib/utility/chunk_string.hpp
@@ -10,7 +10,7 @@
#include <lib/core/includes.hpp>
-namespace ocl
+namespace scl
{
template <typename char_type, std::size_t max_chunk_size = 8196>
class basic_chunk_string;
@@ -89,7 +89,7 @@ namespace ocl
void print() noexcept
{
- ocl::io::print(packed_chunks_);
+ scl::io::print(packed_chunks_);
}
};
@@ -98,5 +98,5 @@ namespace ocl
{
fmt.print();
}
-} // namespace ocl
+} // namespace scl
#endif // ifndef OCL_UTILITY_CHUNK_STRING_HPP
diff --git a/dev/lib/utility/crc32.hpp b/dev/lib/utility/crc32.hpp
index ea09b94..93347a8 100644
--- a/dev/lib/utility/crc32.hpp
+++ b/dev/lib/utility/crc32.hpp
@@ -5,8 +5,8 @@
* Copyright 2025, Amlal El Mahrouss.
*/
-#ifndef _OCL_CRC32_HPP
-#define _OCL_CRC32_HPP
+#ifndef _SCL_CRC32_HPP
+#define _SCL_CRC32_HPP
#include <cstdint>
#include <string>
@@ -15,7 +15,7 @@
/// @brief Crc32 implementation in C++
/// @author Amlal EL Mahrouss (amlal@nekernel.org)
-namespace ocl::crc32
+namespace scl::crc32
{
namespace detail
{
@@ -76,6 +76,6 @@ namespace ocl::crc32
{
return detail::crc32(in.c_str(), in.size());
}
-} // namespace ocl::crc32
+} // namespace scl::crc32
-#endif // !_OCL_CRC32_HPP \ No newline at end of file
+#endif // !_SCL_CRC32_HPP \ No newline at end of file
diff --git a/dev/lib/utility/embfs.hpp b/dev/lib/utility/embfs.hpp
index 0f20596..689082c 100644
--- a/dev/lib/utility/embfs.hpp
+++ b/dev/lib/utility/embfs.hpp
@@ -5,8 +5,8 @@
* Copyright 2025, Amlal El Mahrouss.
*/
-#ifndef _OCL_EMBFS_HPP
-#define _OCL_EMBFS_HPP
+#ifndef _SCL_EMBFS_HPP
+#define _SCL_EMBFS_HPP
#include <cstdint>
#include <cstddef>
@@ -14,7 +14,7 @@
/// @brief A filesystem designed for tiny storage medias.
/// @author Amlal EL Mahrouss (amlal@nekernel.org)
-namespace ocl::embfs
+namespace scl::embfs
{
namespace traits
{
@@ -75,6 +75,6 @@ namespace ocl::embfs
/// @brief Indexed node linear array.
typedef embfs_inode embfs_inode_arr_t[_inode_arr_len];
} // namespace traits
-} // namespace ocl::embfs
+} // namespace scl::embfs
-#endif // ifndef _OCL_EMBFS_HPP \ No newline at end of file
+#endif // ifndef _SCL_EMBFS_HPP \ No newline at end of file