-
Notifications
You must be signed in to change notification settings - Fork 15
Home
DK edited this page Mar 6, 2024
·
9 revisions
Some utilitarian headers to help with x64 native plugin development
-
Config
- abstracted and contained config layer
-
ini,toml,jsonfile support -
bool,int64_t,double,stringtype support - built in array support
- multiple file loads & generate default file
- custom formatted string parser to c++ structure
- Hook
-
Logger
- logging macros
-
Utility
- function
-
constevalhelper functions retrieving the argument count of a function.
-
- model
-
Singletondata model abstract class to save boilerplate code. -
enumerationaddition to the originalRE::stl::enumeration.- static reflection for enum name, type name and value name, support value_type(
n) and flag_type(1<<n) -
std::rangesiterator for value_range(n) and flag_range(1<<n)
- static reflection for enum name, type name and value name, support value_type(
-
conceptsuseful concepts for contraining function templates -
struct_cast,tuple_castcompile time conversion for same aligned structs/tuples using structure binding (up to 9 bindable members) -
vector_cast,range_castconstexpr conversion forstd::ranges::rangeandstd::vector
-
- numbers
- FNV-1A compile time string hashing with 32bit/64bit implementation.
- string
-
to_wstringmethod -
concatcompile time string concatenation. - various string related functions using
std::ranges
-
- function
-
Extra(For SKSE)
-
CONSOLElogging macro but for in-game console. -
serializablepainless, all-in-one serialization solution for SKSE plugins.(Planned to move to general support instead of strict SKSE)
-
All dependencies should be handled by vcpkg.
Clone a copy of DKUtil onto your local environment, in your target project's CMakeLists.txt, add:
add_subdirectory("Path/To/Local/Copy/Of/DKUtil" DKUtil)
target_link_libraries(
"YOUR PROJECT NAME"
INTERFACE
DKUtil::DKUtil
)Or using git submodule, within your target project's root directory, add:
git submodule add https://github.com/gottyduke/DKUtil.git extern/DKUtil
git submodule update -f --initAnd in your target project's CMakeLists.txt, add:
# dependency macros
macro(find_dependency_path DEPENDENCY FILE)
# searches extern for dependencies and if not checks the environment variable
if(NOT ${DEPENDENCY} STREQUAL "")
# Check extern
message(
STATUS
"Searching for ${DEPENDENCY} using file ${FILE}"
)
find_path("${DEPENDENCY}Path"
${FILE}
PATHS "extern/${DEPENDENCY}")
if("${${DEPENDENCY}Path}" STREQUAL "${DEPENDENCY}Path-NOTFOUND")
# Check path
message(
STATUS
"Getting environment for ${DEPENDENCY}Path: $ENV{${DEPENDENCY}Path}"
)
set("${DEPENDENCY}Path" "$ENV{${DEPENDENCY}Path}")
endif()
message(
STATUS
"Found ${DEPENDENCY} in ${${DEPENDENCY}Path}; adding"
)
add_subdirectory("${${DEPENDENCY}Path}" ${DEPENDENCY})
endif()
endmacro()
# dependencies
find_dependency_path(DKUtil include/DKUtil/Logger.hpp)