1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Add UTF8 library.

This commit is contained in:
Sandu Liviu Catalin 2021-09-19 14:23:47 +03:00
parent cae745378d
commit 4a8a7172d4
9 changed files with 1738 additions and 1 deletions

View File

@ -85,6 +85,7 @@ add_library(SqModule MODULE SqBase.hpp Main.cpp
Library/System/Dir.cpp Library/System/Dir.hpp Library/System/Dir.cpp Library/System/Dir.hpp
Library/System/Env.cpp Library/System/Env.hpp Library/System/Env.cpp Library/System/Env.hpp
Library/System/Path.cpp Library/System/Path.hpp Library/System/Path.cpp Library/System/Path.hpp
Library/UTF8.cpp Library/UTF8.hpp
Library/Utils.cpp Library/Utils.hpp Library/Utils.cpp Library/Utils.hpp
Library/Utils/Announce.cpp Library/Utils/Announce.hpp Library/Utils/Announce.cpp Library/Utils/Announce.hpp
Library/Utils/String.cpp Library/Utils/String.hpp Library/Utils/String.cpp Library/Utils/String.hpp
@ -131,7 +132,7 @@ if(WIN32 OR MINGW)
target_link_libraries(SqModule wsock32 ws2_32 shlwapi) target_link_libraries(SqModule wsock32 ws2_32 shlwapi)
endif() endif()
# Link to base libraries # Link to base libraries
target_link_libraries(SqModule Squirrel fmt::fmt SimpleINI TinyDir xxHash ConcurrentQueue SAJSON CPR PUGIXML CivetWeb maxminddb libzmq-static) target_link_libraries(SqModule Squirrel fmt::fmt SimpleINI TinyDir xxHash ConcurrentQueue SAJSON CPR UTF8Lib PUGIXML CivetWeb maxminddb libzmq-static)
# Enable built-in Discord support # Enable built-in Discord support
if(ENABLE_DISCORD) if(ENABLE_DISCORD)
target_link_libraries(SqModule DPP) target_link_libraries(SqModule DPP)

19
module/Library/UTF8.cpp Normal file
View File

@ -0,0 +1,19 @@
// ------------------------------------------------------------------------------------------------
#include "Library/UTF8.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------
// ================================================================================================
void Register_UTF8(HSQUIRRELVM vm)
{
Table ns(vm);
RootTable(vm).Bind(_SC("SqUTF8"), ns);
}
} // Namespace:: SqMod

14
module/Library/UTF8.hpp Normal file
View File

@ -0,0 +1,14 @@
#pragma once
// ------------------------------------------------------------------------------------------------
#include "Core/Utility.hpp"
// ------------------------------------------------------------------------------------------------
#include <utf8.h>
// ------------------------------------------------------------------------------------------------
namespace SqMod {
} // Namespace:: SqMod

View File

@ -41,6 +41,7 @@ extern void Register_Net(HSQUIRRELVM vm);
extern void Register_Numeric(HSQUIRRELVM vm); extern void Register_Numeric(HSQUIRRELVM vm);
extern void Register_String(HSQUIRRELVM vm); extern void Register_String(HSQUIRRELVM vm);
extern void Register_System(HSQUIRRELVM vm); extern void Register_System(HSQUIRRELVM vm);
extern void Register_UTF8(HSQUIRRELVM vm);
extern void Register_Utils(HSQUIRRELVM vm); extern void Register_Utils(HSQUIRRELVM vm);
extern void Register_XML(HSQUIRRELVM vm); extern void Register_XML(HSQUIRRELVM vm);
extern void Register_ZMQ(HSQUIRRELVM vm); extern void Register_ZMQ(HSQUIRRELVM vm);
@ -110,6 +111,7 @@ bool RegisterAPI(HSQUIRRELVM vm)
Register_Numeric(vm); Register_Numeric(vm);
Register_String(vm); Register_String(vm);
Register_System(vm); Register_System(vm);
Register_UTF8(vm);
Register_Utils(vm); Register_Utils(vm);
Register_XML(vm); Register_XML(vm);
Register_ZMQ(vm); Register_ZMQ(vm);

View File

@ -6,6 +6,7 @@ add_subdirectory(SimpleIni)
add_subdirectory(TinyDir) add_subdirectory(TinyDir)
add_subdirectory(SAJSON) add_subdirectory(SAJSON)
add_subdirectory(CPR) add_subdirectory(CPR)
add_subdirectory(UTF8)
add_subdirectory(PUGIXML) add_subdirectory(PUGIXML)
add_subdirectory(CivetWeb) add_subdirectory(CivetWeb)
set(BUILD_TESTING OFF CACHE INTERNAL "" FORCE) set(BUILD_TESTING OFF CACHE INTERNAL "" FORCE)

13
vendor/UTF8/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,13 @@
# Create the UTF8Lib library
add_library(UTF8Lib STATIC
utf8.h
utf8.c
)
# Set speciffic options
target_compile_options(UTF8Lib PRIVATE -fvisibility=hidden)
# Includes
target_include_directories(UTF8Lib PUBLIC ${CMAKE_CURRENT_LIST_DIR})
# Private library defines
#target_compile_definitions(UTF8Lib PRIVATE )
# Public library defines
# target_compile_definitions(UTF8Lib PUBLIC )

24
vendor/UTF8/LICENSE vendored Normal file
View File

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

1
vendor/UTF8/utf8.c vendored Normal file
View File

@ -0,0 +1 @@
#include "utf8.h"

1662
vendor/UTF8/utf8.h vendored Normal file

File diff suppressed because it is too large Load Diff