nlib
Config.h File Reference

A file that contains the configuration information for each development environment. More...

#include "nn/nlib/Platform.h"
#include "nn/nlib/Config_linux.h"
#include <wchar.h>
#include <utility>

Go to the source code of this file.

Classes

struct  nn::nlib::move_tag
 An empty structure indicating that an argument to a function needs to be moved. More...
 
class  nn::nlib::ErrnoT
 Class that wraps errno_t. This class improves visual representations in the Visual Studio debugger. More...
 
class  nn::nlib::Utf8Ptr
 Class that wraps const char* storing UTF-8. This class improves visual representations of UTF-8 in the Visual Studio debugger. More...
 
class  nn::nlib::Utf8Array< N >
 Class that wraps the char array storing UTF-8. This class improves visual representations of UTF-8 in the Visual Studio debugger. More...
 

Namespaces

 nn::nlib
 Implements stream-related classes usually commonly used, various containers, and other gadget classes. nlib_ns is an alias.
 

Macros

#define NLIB_CEXPR   constexpr
 Defines constexpr if it is available for use. If not, holds an empty string.
 
#define NLIB_NOEXCEPT   noexcept
 Defines noexcept geared to the environment, or the equivalent. More...
 
#define NLIB_TRY   if (true)
 Defines try if exceptions are enabled. If not, defines if (true).
 
#define NLIB_CATCH(x)   if (false)
 Defines catch(x) if exceptions are enabled. If not, defines if (true). More...
 
#define NLIB_THROW
 Defines throw if exceptions are enabled. If not, defines a space.
 
#define NLIB_STATIC_ASSERT(exp)   static_assert((exp), "NLIB_STATIC_ASSERT error: " #exp)
 Defines a static assertion. Uses static_assert if it is available for use. More...
 
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
 Prohibits use of the copy constructor and assignment operator for the class specified by TypeName. More...
 
#define NLIB_SAFE_BOOL(class_name, exp)
 Defines a safe operator bool function in the class. Uses the C++11 explicit bool if it is available for use. More...
 
#define NLIB_OVERRIDE   override
 Defines override if it is available for use. If not, holds an empty string.
 
#define NLIB_FINAL   final
 Defines final if it is available for use. If not, holds an empty string.
 
#define NLIB_ALIGNAS(x)   alignas(x)
 Defines alignas(x) or the equivalent. More...
 
#define NLIB_ALIGNOF(tp)   alignof(tp)
 Defines alignof(tp) or the equivalent. More...
 
#define NLIB_NOEMPTYFILE()
 Writing this macro in a file that should be empty for some reasons can prevent the Linker warning 4221 in MSVC from occurring.
 

Typedefs

typedef nlib_utf16_t nn::nlib::utf16_t
 Type for UTF-16 characters. Defined as nlib_utf16_t using typedef.
 
typedef nlib_utf32_t nn::nlib::utf32_t
 Type for UTF-32 characters. Defined as nlib_utf32_t using typedef.
 

Functions

printf

Functions for handling differences with the standard library printf.

Description
When describing a format string for printf, you may need to pay attention to its portability. Please refer to the following information:
See also
https://google.github.io/styleguide/cppguide.html#64-bit_Portability
http://www.textdrop.net/google-styleguide-ja/cppguide.xml#64%E3%83%93%E3%83%83%E3%83%88%E3%81%AE%E7%A7%BB%E6%A4%8D%E6%80%A7
template<size_t N>
errno_t nlib_vsnprintf (size_t *count, char(&buf)[N], const char *fmt, va_list args) noexcept
 The function template version of nlib_vsnprintf.
 
template<size_t N>
errno_t nlib_snprintf (size_t *count, char(&buf)[N], const char *fmt,...) noexcept
 The function template version of nlib_snprintf.
 
template<size_t N>
errno_t nlib_vsnwprintf (size_t *count, wchar_t(&buf)[N], const wchar_t *fmt, va_list args) noexcept
 The function template version of nlib_vsnwprintf.
 
template<size_t N>
errno_t nlib_snwprintf (size_t *count, wchar_t(&buf)[N], const wchar_t *fmt,...) noexcept
 The function template version of nlib_snwprintf.
 
Function for null terminated strings.
template<size_t N>
errno_t nlib_strcpy (char(&s1)[N], const char *s2) noexcept
 The function template version of nlib_strcpy.
 
template<size_t N>
size_t nlib_strlcpy (char(&s1)[N], const char *s2) noexcept
 Calls the nlib_strlcpy(s1, s2, N) function.
 
template<size_t N>
errno_t nlib_strncpy (char(&s1)[N], const char *s2, size_t n) noexcept
 The function template version of nlib_strncpy.
 
template<size_t N>
errno_t nlib_wcscpy (wchar_t(&s1)[N], const wchar_t *s2) noexcept
 The function template version of nlib_wcscpy.
 
template<size_t N>
errno_t nlib_wcsncpy (wchar_t(&s1)[N], const wchar_t *s2, size_t n) noexcept
 The function template version of nlib_wcsncpy.
 
Threads
void nlib_thread_exit_cpp () NLIB_NORETURN
 Ends the called thread. More...
 
count leading zeros, count trailing zeros, popcnt, bitreverse
template<class T >
bool nlib_is_error (const T &obj) noexcept
 Returns true when the process result or object status is in an erroneous condition. More...
 

Unicode

Unicode-related functionality is also implemented in the nn::nlib::unicode namespace.

typedef uint16_t nlib_utf16_t
 Uses typedef to define as char16_t if that can be used. If not, it uses typedef to define as uint16_t.
 
typedef uint32_t nlib_utf32_t
 Uses typedef to define as char32_t if that can be used. If not, it uses typedef to define as uint32_t.
 
NLIB_CHECK_RESULT int nlib_utf16_to_utf32char (nlib_utf32_t *utf32, nlib_utf16_t upper, nlib_utf16_t lower) noexcept
 Converts a single code point from UTF-16 into UTF-32. More...
 
NLIB_CHECK_RESULT int nlib_utf32char_to_utf16 (nlib_utf16_t *upper, nlib_utf16_t *lower, nlib_utf32_t utf32) noexcept
 Converts a single UTF-32 character into UTF-16. More...
 
NLIB_CHECK_RESULT int nlib_utf8_to_utf32char (nlib_utf32_t *utf32, const char *utf8) noexcept
 Converts UTF-8 into one character's worth of UTF-32. More...
 
NLIB_CHECK_RESULT int nlib_utf32char_to_utf8 (char(&utf8)[4], nlib_utf32_t utf32) noexcept
 Converts the UTF-32 for one character into UTF-8. More...
 
errno_t nlib_utf16_to_utf8 (size_t *utf8count, char *utf8, size_t buflen, const nlib_utf16_t *utf16) noexcept
 Converts a UTF-16 string into a UTF-8 string. More...
 
errno_t nlib_utf8_to_utf16 (size_t *utf16count, nlib_utf16_t *utf16, size_t buflen, const char *utf8) noexcept
 Converts a UTF-8 string into a UTF-16 string. The UTF-16 string is null-terminated. More...
 
errno_t nlib_utf32_to_utf8 (size_t *utf8count, char *utf8, size_t buflen, const nlib_utf32_t *utf32) noexcept
 Converts a UTF-32 string into a UTF-8 string. More...
 
errno_t nlib_utf8_to_utf32 (size_t *utf32count, nlib_utf32_t *utf32, size_t buflen, const char *utf8) noexcept
 Converts a UTF-8 string into a UTF-32 string. More...
 
errno_t nlib_memutf16_to_utf8 (size_t *to_count, size_t *from_count, char *to, size_t to_size, const nlib_utf16_t *from, size_t from_size) NLIB_NONNULL_5
 Converts a UTF-16 string that is not null terminated to a UTF-8 string. More...
 
errno_t nlib_memutf8_to_utf16 (size_t *to_count, size_t *from_count, nlib_utf16_t *to, size_t to_size, const char *from, size_t from_size) NLIB_NONNULL_5
 Converts a UTF-8 string that is not null terminated to a UTF-16 string. More...
 
errno_t nlib_memutf32_to_utf8 (size_t *to_count, size_t *from_count, char *to, size_t to_size, const nlib_utf32_t *from, size_t from_size) NLIB_NONNULL_5
 Converts a UTF-32 string that is not null terminated to a UTF-8 string. More...
 
errno_t nlib_memutf8_to_utf32 (size_t *to_count, size_t *from_count, nlib_utf32_t *to, size_t to_size, const char *from, size_t from_size) NLIB_NONNULL_5
 Converts a UTF-8 string that is not null terminated to a UTF-32 string. More...
 
NLIB_CHECK_RESULT size_t nlib_utf16len (const nlib_utf16_t *str) noexcept
 Counts the number of nlib_utf16_t-type characters, not including the null character. More...
 
NLIB_CHECK_RESULT size_t nlib_utf16nlen (const nlib_utf16_t *str, size_t maxsize) noexcept
 The UTF-16 version of the nlib_strnlen function. More...
 
errno_t nlib_utf16cpy (nlib_utf16_t *s1, size_t s1max, const nlib_utf16_t *s2) noexcept
 The UTF-16 version of the nlib_strcpy function. More...
 
errno_t nlib_utf16ncpy (nlib_utf16_t *s1, size_t s1max, const nlib_utf16_t *s2, size_t n) noexcept
 The UTF-16 version of the nlib_strcpy function. More...
 
NLIB_CHECK_RESULT size_t nlib_utf32len (const nlib_utf32_t *str) noexcept
 Counts the number of nlib_utf32_t-type characters, not including the null character. More...
 
NLIB_CHECK_RESULT size_t nlib_utf32nlen (const nlib_utf32_t *str, size_t maxsize) noexcept
 The UTF-32 version of the nlib_strnlen function. More...
 
errno_t nlib_utf32cpy (nlib_utf32_t *s1, size_t s1max, const nlib_utf32_t *s2) noexcept
 The UTF-32 version of the nlib_strcpy function. More...
 
errno_t nlib_utf32ncpy (nlib_utf32_t *s1, size_t s1max, const nlib_utf32_t *s2, size_t n) noexcept
 The UTF-32 version of the nlib_strcpy function. More...
 
errno_t nlib_utf16cplen (size_t *count, const nlib_utf16_t *str) noexcept
 Gets the number of code points in the string. More...
 
errno_t nlib_utf16cplen_ex (size_t *count, size_t *len, const nlib_utf16_t *str) noexcept
 Gets the number of code points in the string. More...
 
NLIB_CHECK_RESULT errno_t nlib_utf32cplen (size_t *count, const nlib_utf32_t *str) noexcept
 Gets the number of code points in the string. More...
 
template<size_t N>
errno_t nlib_wide_to_utf8 (size_t *result, char(&utf8)[N], const wchar_t *wcstr) noexcept
 The function template version of nlib_wide_to_utf8.
 
template<size_t N>
errno_t nlib_utf8_to_wide (size_t *result, wchar_t(&wcstr)[N], const char *utf8) noexcept
 The function template version of nlib_utf8_to_wide.
 
template<size_t N>
errno_t nlib_utf16_to_utf8 (size_t *utf8count, char(&utf8)[N], const nlib_utf16_t *utf16) noexcept
 The function template version of nlib_utf16_to_utf8.
 
template<size_t N>
errno_t nlib_utf8_to_utf16 (size_t *utf16count, nlib_utf16_t(&utf16)[N], const char *utf8) noexcept
 The function template version of nlib_utf8_to_utf16.
 
template<size_t N>
errno_t nlib_utf32_to_utf8 (size_t *utf8count, char(&utf8)[N], const nlib_utf32_t *utf32) noexcept
 The function template version of nlib_utf32_to_utf8.
 
template<size_t N>
errno_t nlib_utf8_to_utf32 (size_t *utf32count, nlib_utf32_t(&utf32)[N], const char *utf8) noexcept
 The function template version of nlib_utf8_to_utf32.
 
template<size_t N>
errno_t nlib_memutf16_to_utf8 (size_t *to_count, size_t *from_count, char(&to)[N], const nlib_utf16_t *from, size_t from_size) noexcept
 The function template version of nlib_memutf16_to_utf8().
 
template<size_t N>
errno_t nlib_memutf8_to_utf16 (size_t *to_count, size_t *from_count, nlib_utf16_t(&to)[N], const char *from, size_t from_size) noexcept
 The function template version of nlib_memutf8_to_utf16().
 
template<size_t N>
errno_t nlib_memutf32_to_utf8 (size_t *to_count, size_t *from_count, char(&to)[N], const nlib_utf32_t *from, size_t from_size) noexcept
 The function template version of nlib_memutf32_to_utf8().
 
template<size_t N>
errno_t nlib_memutf8_to_utf32 (size_t *to_count, size_t *from_count, nlib_utf32_t(&to)[N], const char *from, size_t from_size) noexcept
 The function template version of nlib_memutf8_to_utf32().
 
template<size_t N>
errno_t nlib_memwide_to_utf8 (size_t *to_count, size_t *from_count, char(&to)[N], const wchar_t *from, size_t from_size) noexcept
 The function template version of nlib_memwide_to_utf8().
 
template<size_t N>
errno_t nlib_memutf8_to_wide (size_t *to_count, size_t *from_count, wchar_t(&to)[N], const char *from, size_t from_size) noexcept
 The function template version of nlib_memutf8_to_wide().
 

Detailed Description

A file that contains the configuration information for each development environment.

Definition in file Config.h.