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.
 

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.
 
Unicode

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

template<size_t N>
errno_t nlib_wide_to_utf8 (size_t *result, nlib_utf8_t(&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 nlib_utf8_t *utf8) noexcept
 The function template version of nlib_utf8_to_wide.
 
template<size_t N>
errno_t nlib_utf16_to_utf8 (size_t *utf8count, nlib_utf8_t(&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 nlib_utf8_t *utf8) noexcept
 The function template version of nlib_utf8_to_utf16.
 
template<size_t N>
errno_t nlib_utf32_to_utf8 (size_t *utf8count, nlib_utf8_t(&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 nlib_utf8_t *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, nlib_utf8_t(&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 nlib_utf8_t *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, nlib_utf8_t(&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 nlib_utf8_t *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, nlib_utf8_t(&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 nlib_utf8_t *from, size_t from_size) noexcept
 The function template version of nlib_memutf8_to_wide().
 
Errors

Utilities related to error values.

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...
 

Detailed Description

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

Definition in file Config.h.