/*
* This file is part of the Omni C++ framework
*
* Copyright (c) 2016, Zeriph Enterprises, LLC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of Zeriph, Zeriph Enterprises, LLC, nor the names
* of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ZERIPH AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ZERIPH AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* DEV_NOTE: this file is not intended to be used directly by any user code!
i.e. don't #include <omni/xxx_impl.hxx> and don't compile this source directly.
this file is #include'd directly in other source.
The idea is that
omni::cconsts and
omni::wconsts namespaces segregate the types
for explicit calling; i.e. you can call
omni::cconsts::X for a std:string type
and similarly can call
omni::wconsts::X for a std::wstring type, while still having access
to the
omni::string_t and omn::consts::X ability (which are aliases for the other namespaces).
Since
omni::cconsts and
omni::wconsts are merely wrappers for string types
putting the relevant code in a header with a few #defs for types makes keeping the files
in sync (for names) less messy. It does introduce slight confusion to anyone who might
want to read this specific code or documentation though.
*/
// so as not to accidentally build this file with the source
// these macros are defined in cconsts.hpp and wconsts.hpp
#if !defined(OMNI_CHAR_T_FW) || !defined(OMNI_STRW_FW)
#error invalid preprocessor directive detected
#endif
// namespace omni::consts/cconsts/wconsts {
/** Facilitate constant error strings */
namespace err {
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW DELEGATE_NOT_FOUND[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_NO_DELEGATE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW ERR_GET_TIME[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_ERR_GET_TIME_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW ERR_MEM_ALLOC[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_ERR_MALLOC_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW ERR_OPEN_PARENT_PROC[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_ERR_PROC_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW ERR_RET_PRI_CLASS[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_ERR_PROC_PRI_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW ERR_SET_PRIORITY[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_ERR_SET_PRI_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW FILE_NOT_FOUND[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_FILE_NOT_FOUND_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW FILE_NOT_ACCESSIBLE[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_FILE_NOT_ACCESSIBLE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW GENERAL_EXCEPTION[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_GENERAL_EXCEPTION_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INDEX_OOR[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INDEX_OOR_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_BASE[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_BASE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_CHAR[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_CHAR_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_CAST[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_CAST_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_DELEGATE[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_DELEGATE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_DELEGATE_FUNC_PTR[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_DELEGATE_FUNC_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_OPTION[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_OPTION_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_SETTING[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_SETTING_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_SEEK_DIR[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_SEEK_DIR_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_THREAD_HANDLE[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_THREAD_HANDLE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_THREAD_PRIORITY[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_THREAD_PRIORITY_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_THREAD_START_TYPE[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_THREAD_START_TYPE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW INVALID_SIZE[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_INVALID_SIZE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW PATH_NOT_ACCESSIBLE[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_PATH_NOT_ACCESSIBLE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW SET_PRI_UNSUPPORTED[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_SET_PRI_UNSUPPORTED_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW STRING_COUNT_GT0[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_STRING_COUNT_GT0_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW STRING_INVALID_BINARY_FORMAT[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_STRING_INVALID_FORMAT_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW STRING_INVALID_BINARY_STR_SZ[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_STRING_INVALID_SIZE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW STRING_NOT_NUMERIC[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_STRING_NOT_NUMERIC_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW SUCCESS[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_SUCCESS_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW UNKNOWN[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_UNKNOWN_STR));
}
/** Miscellaneous constants */
namespace misc {
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW COMMA OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_COMMA_CHAR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW MINUS OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_MINUS_CHAR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW NCHAR OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_NCHAR_CHAR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW PERIOD OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_PERIOD_CHAR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW PLUS OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_PLUS_CHAR));
}
/** Facilitates size constants */
namespace sz {
/** Facilitates binary size constants (1KB == 1024B) */
namespace bin {
/** Facilitates binary size abbreviated string constants (B, KiB, MiB, etc.) */
namespace str {
/** Facilitates binary size unabbreviated string constants (Byte, Kibibyte, etc.) */
namespace full {
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW B[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_BYTE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW KB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_KIBI_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW MB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_MIBI_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW GB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_GIBI_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW TB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_TIBI_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW PB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_PIBI_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW EB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_EIBI_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW ZB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_ZIBI_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW YB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_YIBI_STR));
}
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW B[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_B_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW KB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_KIB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW MB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_MIB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW GB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_GIB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW TB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_TIB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW PB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_PIB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW EB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_EIB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW ZB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_ZIB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW YB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_YIB_STR));
}
}
/** Facilitates decimal size constants (1KB == 1000B) */
namespace dec {
/** Facilitates decimal size abbreviated string constants (B, KB, MB, etc.) */
namespace str {
/** Facilitates decimal size unabbreviated string constants (Byte, Kilobyte, etc.) */
namespace full {
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW B[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_BYTE_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW KB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_KILO_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW MB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_MEGA_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW GB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_GIGA_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW TB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_TERA_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW PB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_PETA_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW EB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_EXA_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW ZB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_ZETTA_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW YB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_YOTTA_STR));
}
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW B[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_B_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW KB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_KOB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW MB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_MOB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW GB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_GOB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW TB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_TOB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW PB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_POB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW EB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_EOB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW ZB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_ZOB_STR));
OMNI_CONSTEXT_FW OMNI_CHAR_T_FW YB[] OMNI_EXT_ASSN_FW(= OMNI_STRW_FW(
OMNI_YOB_STR));
}
}
}
// } namespace omni::consts/cconsts/wconsts