summaryrefslogtreecommitdiffhomepage
path: root/dev/lib/utility
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-08-27 12:28:55 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-08-27 12:31:41 +0200
commitb4f35dbe44e07b597c3e7bb6d7562757069a7cb4 (patch)
tree88af99a2cca9c514536b4b61785fa67b3543429c /dev/lib/utility
parentfbda49eea45ce08b9a72744c04761e1556ebd2fa (diff)
feat: moved SOCL into OCL, without SNU's baggage.v1.0.41
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/utility')
-rw-r--r--dev/lib/utility/cgi_writer.hpp26
-rw-r--r--dev/lib/utility/chunk_string.hpp16
-rw-r--r--dev/lib/utility/crc32.hpp12
-rw-r--r--dev/lib/utility/embfs.hpp14
4 files changed, 34 insertions, 34 deletions
diff --git a/dev/lib/utility/cgi_writer.hpp b/dev/lib/utility/cgi_writer.hpp
index 70b32cf..12de9ec 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 _SNU_CGI_WRITER_HPP
-#define _SNU_CGI_WRITER_HPP
+#ifndef _OCL_CGI_WRITER_HPP
+#define _OCL_CGI_WRITER_HPP
#include <lib/io/print.hpp>
#include <lib/utility/chunk_string.hpp>
#include <sstream>
#include <format>
-namespace snu
+namespace ocl
{
namespace cgi
{
@@ -21,7 +21,7 @@ namespace snu
class basic_writer
{
private:
- basic_writer& eval_(const snu::basic_chunk_string<char_type>& mime, const snu::basic_chunk_string<char_type>& ss) noexcept
+ basic_writer& eval_(const ocl::basic_chunk_string<char_type>& mime, const ocl::basic_chunk_string<char_type>& ss) noexcept
{
std::basic_stringstream<char_type> ss_out;
@@ -30,7 +30,7 @@ namespace snu
ss_out << std::format("Content-Length: {}\r\n\r\n", ss.str().size());
ss_out << ss.str();
- snu::io::print(ss_out.str());
+ ocl::io::print(ss_out.str());
return *this;
}
@@ -43,37 +43,37 @@ namespace snu
basic_writer(const basic_writer&) = default;
public:
- friend void operator<<(basic_writer& self, const snu::basic_chunk_string<char_type>& ss_in)
+ friend void operator<<(basic_writer& self, const ocl::basic_chunk_string<char_type>& ss_in)
{
self = self.eval_("text/plain", ss_in);
}
- basic_writer& binary(const snu::basic_chunk_string<char_type>& ss_in)
+ basic_writer& binary(const ocl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("application/octet-stream", ss_in);
}
- basic_writer& html(const snu::basic_chunk_string<char_type>& ss_in)
+ basic_writer& html(const ocl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("text/html", ss_in);
}
- basic_writer& xml(const snu::basic_chunk_string<char_type>& ss_in)
+ basic_writer& xml(const ocl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("application/xml", ss_in);
}
- basic_writer& json(const snu::basic_chunk_string<char_type>& ss_in)
+ basic_writer& json(const ocl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("application/json", ss_in);
}
- basic_writer& js(const snu::basic_chunk_string<char_type>& ss_in)
+ basic_writer& js(const ocl::basic_chunk_string<char_type>& ss_in)
{
return this->eval_("text/javascript", ss_in);
}
};
} // namespace cgi
-} // namespace snu
+} // namespace ocl
-#endif // ifndef _SNU_CGI_WRITER_HPP
+#endif // ifndef _OCL_CGI_WRITER_HPP
diff --git a/dev/lib/utility/chunk_string.hpp b/dev/lib/utility/chunk_string.hpp
index 79e0dd6..79a3881 100644
--- a/dev/lib/utility/chunk_string.hpp
+++ b/dev/lib/utility/chunk_string.hpp
@@ -1,17 +1,17 @@
/*
* File: core/chunk_string.hpp
* Purpose: String implementation for the SOCL C++ library.
- * Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp.
+ * Author: Amlal El Mahrouss (amlal@nekernel.org)
+ * Copyright 2025, Amlal El Mahrouss
*/
-#ifndef SOCL_UTILITY_CHUNK_STRING_HPP
-#define SOCL_UTILITY_CHUNK_STRING_HPP
+#ifndef OCL_UTILITY_CHUNK_STRING_HPP
+#define OCL_UTILITY_CHUNK_STRING_HPP
#include <lib/core/includes.hpp>
#include <boost/container/flat_set.hpp>
-namespace snu
+namespace ocl
{
template <typename char_type>
class basic_chunk_string;
@@ -74,7 +74,7 @@ namespace snu
void print() noexcept
{
- snu::io::print(packed_chunks_);
+ ocl::io::print(packed_chunks_);
if (next_chunk_string_)
this->next_chunk_string_->print();
@@ -86,5 +86,5 @@ namespace snu
{
fmt.print();
}
-} // namespace snu
-#endif // ifndef SOCL_UTILITY_CHUNK_STRING_HPP \ No newline at end of file
+} // namespace ocl
+#endif // ifndef OCL_UTILITY_CHUNK_STRING_HPP \ No newline at end of file
diff --git a/dev/lib/utility/crc32.hpp b/dev/lib/utility/crc32.hpp
index f7e5fc9..ea09b94 100644
--- a/dev/lib/utility/crc32.hpp
+++ b/dev/lib/utility/crc32.hpp
@@ -5,17 +5,17 @@
* Copyright 2025, Amlal El Mahrouss.
*/
-#ifndef _SNU_CRC32_HPP
-#define _SNU_CRC32_HPP
+#ifndef _OCL_CRC32_HPP
+#define _OCL_CRC32_HPP
#include <cstdint>
#include <string>
#include <cstddef>
/// @brief Crc32 implementation in C++
-/// @author Amlal EL Mahrouss (founder@snu.systems)
+/// @author Amlal EL Mahrouss (amlal@nekernel.org)
-namespace snu::crc32
+namespace ocl::crc32
{
namespace detail
{
@@ -76,6 +76,6 @@ namespace snu::crc32
{
return detail::crc32(in.c_str(), in.size());
}
-} // namespace snu::crc32
+} // namespace ocl::crc32
-#endif // !_SNU_CRC32_HPP \ No newline at end of file
+#endif // !_OCL_CRC32_HPP \ No newline at end of file
diff --git a/dev/lib/utility/embfs.hpp b/dev/lib/utility/embfs.hpp
index 3acc867..0f20596 100644
--- a/dev/lib/utility/embfs.hpp
+++ b/dev/lib/utility/embfs.hpp
@@ -1,20 +1,20 @@
/*
* File: embfs.hpp
* Purpose: Embedded File System.
- * Author: Amlal El Mahrouss (founder@snu.systems)
+ * Author: Amlal El Mahrouss (amlal@nekernel.org)
* Copyright 2025, Amlal El Mahrouss.
*/
-#ifndef _SNU_EMBFS_HPP
-#define _SNU_EMBFS_HPP
+#ifndef _OCL_EMBFS_HPP
+#define _OCL_EMBFS_HPP
#include <cstdint>
#include <cstddef>
/// @brief A filesystem designed for tiny storage medias.
-/// @author Amlal EL Mahrouss (founder@snu.systems)
+/// @author Amlal EL Mahrouss (amlal@nekernel.org)
-namespace snu::embfs
+namespace ocl::embfs
{
namespace traits
{
@@ -75,6 +75,6 @@ namespace snu::embfs
/// @brief Indexed node linear array.
typedef embfs_inode embfs_inode_arr_t[_inode_arr_len];
} // namespace traits
-} // namespace snu::embfs
+} // namespace ocl::embfs
-#endif // ifndef _SNU_EMBFS_HPP \ No newline at end of file
+#endif // ifndef _OCL_EMBFS_HPP \ No newline at end of file