From dfb5c02a1fa76d853955712b03e24feb3380e09b Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 21 Apr 2020 18:36:31 +0200 Subject: [PATCH 1/3] Update documentation --- doc/Doxyfile | 6 +++--- doc/changelog.dox | 22 ++++++++++++++++++++++ doc/{main.md => main.dox} | 6 +++++- include/boost/nowide/config.hpp | 8 ++++++++ include/boost/nowide/convert.hpp | 6 +++--- include/boost/nowide/fstream.hpp | 10 +++++----- include/boost/nowide/stackstring.hpp | 20 ++++++++++++++++++-- include/boost/nowide/utf8_codecvt.hpp | 4 ++-- src/iostream.cpp | 2 ++ 9 files changed, 68 insertions(+), 16 deletions(-) create mode 100644 doc/changelog.dox rename doc/{main.md => main.dox} (99%) diff --git a/doc/Doxyfile b/doc/Doxyfile index 94fe0cb6..3c2a9a72 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -559,7 +559,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = ../include/boost/nowide ../include/boost/nowide/integration ../src . +INPUT = ../include/boost/nowide ../src . # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -576,7 +576,7 @@ INPUT_ENCODING = UTF-8 # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 -FILE_PATTERNS = *.cpp *.hpp *.md +FILE_PATTERNS = *.cpp *.hpp *.md *.dox # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. @@ -610,7 +610,7 @@ EXCLUDE_PATTERNS = # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = boost::nowide::detail # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see diff --git a/doc/changelog.dox b/doc/changelog.dox new file mode 100644 index 00000000..f4e66447 --- /dev/null +++ b/doc/changelog.dox @@ -0,0 +1,22 @@ +// +// Copyright (c) 2019-2020 Alexander Grund +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +/*! \page changelog_page Changelog + +\section changelog Changelog + +\subsection changelog_10_0_1 Nowide 10.0.1 (Boost 1.73) + +- IMPORTANT: C++03 support is deprecated and will be removed in the next Boost release +- Fix -Wctor-dtor-privacy warning in trait + +\subsection changelog_10_0_0 Nowide 10.0.0 + +- Initial Release + +*/ diff --git a/doc/main.md b/doc/main.dox similarity index 99% rename from doc/main.md rename to doc/main.dox index 44081428..f594dd7e 100644 --- a/doc/main.md +++ b/doc/main.dox @@ -12,6 +12,8 @@ \mainpage Boost.Nowide +\ref changelog_page + Table of Contents: - \ref main @@ -308,7 +310,7 @@ There is also a \c std::filebuf compatible implementation provided for Windows w for \c open and behaves otherwise identical (API-wise). On all systems the \c std::fstream class and friends are provided as custom implementations supporting -\c std::string and \c \*::filesystem::path as well as \c wchar_t\* (Windows only) overloads for the +\c std::string and \c \*\::filesystem::path as well as \c wchar_t\* (Windows only) overloads for the constructor and \c open. This is done so users can use e.g. \c boost::filesystem::path with \c boost::nowide::fstream without depending on C++17 support. @@ -422,3 +424,5 @@ The upstream sources can be found at GitHub: nowide-master.zip + +*/ diff --git a/include/boost/nowide/config.hpp b/include/boost/nowide/config.hpp index 34d65ad3..931fc99f 100644 --- a/include/boost/nowide/config.hpp +++ b/include/boost/nowide/config.hpp @@ -15,6 +15,8 @@ #include #include +//! @cond Doxygen_Suppress + #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_NOWIDE_DYN_LINK) #ifdef BOOST_NOWIDE_SOURCE #define BOOST_NOWIDE_DECL BOOST_SYMBOL_EXPORT @@ -46,6 +48,8 @@ #include #endif // auto-linking disabled +//! @endcond + /// @def BOOST_NOWIDE_USE_WCHAR_OVERLOADS /// @brief Whether to use the wchar_t* overloads in fstream/filebuf /// Enabled on Windows and Cygwin as the latter may use wchar_t in filesystem::path @@ -73,6 +77,8 @@ #define BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT 0 #endif +//! @cond Doxygen_Suppress + #if BOOST_VERSION < 106500 && defined(BOOST_GCC) && __GNUC__ >= 7 #define BOOST_NOWIDE_FALLTHROUGH __attribute__((fallthrough)) #else @@ -88,6 +94,8 @@ #define BOOST_NOWIDE_CXX11 0 #endif +//! @endcond + namespace boost { /// /// \brief This namespace includes implementations of the standard library functions and diff --git a/include/boost/nowide/convert.hpp b/include/boost/nowide/convert.hpp index 45804293..3d7ce2d5 100644 --- a/include/boost/nowide/convert.hpp +++ b/include/boost/nowide/convert.hpp @@ -74,8 +74,6 @@ namespace nowide { /// /// Convert wide string (UTF-16/32) to narrow string (UTF-8). /// - /// \param s Input string - /// \param count Number of characters to convert /// \param s NULL terminated input string /// Any illegal sequences are replaced with the replacement character, see #BOOST_NOWIDE_REPLACEMENT_CHARACTER /// @@ -97,7 +95,8 @@ namespace nowide { /// /// Convert narrow string (UTF-8) to wide string (UTF-16/32). /// - /// \param s NULL terminated input string + /// \param s Input string + /// \param count Number of characters to convert /// Any illegal sequences are replaced with the replacement character, see #BOOST_NOWIDE_REPLACEMENT_CHARACTER /// inline std::wstring widen(const char* s, size_t count) @@ -107,6 +106,7 @@ namespace nowide { /// /// Convert narrow string (UTF-8) to wide string (UTF-16/32). /// + /// \param s NULL terminated input string /// Any illegal sequences are replaced with the replacement character, see #BOOST_NOWIDE_REPLACEMENT_CHARACTER /// inline std::wstring widen(const char* s) diff --git a/include/boost/nowide/fstream.hpp b/include/boost/nowide/fstream.hpp index 9c85a54d..cd63d346 100644 --- a/include/boost/nowide/fstream.hpp +++ b/include/boost/nowide/fstream.hpp @@ -252,17 +252,17 @@ namespace nowide { typedef basic_filebuf filebuf; /// /// Same as std::ifstream but accepts UTF-8 strings under Windows - /// and *::filesystem::path on all systems + /// and *\::filesystem::path on all systems /// typedef basic_ifstream ifstream; /// /// Same as std::ofstream but accepts UTF-8 strings under Windows - /// and *::filesystem::path on all systems + /// and *\::filesystem::path on all systems /// typedef basic_ofstream ofstream; /// /// Same as std::fstream but accepts UTF-8 strings under Windows - /// and *::filesystem::path on all systems + /// and *\::filesystem::path on all systems /// typedef basic_fstream fstream; @@ -364,7 +364,7 @@ namespace nowide { #ifdef BOOST_MSVC #pragma warning(pop) #endif - /// Trait to heuristically check for a *::filesystem::path + /// Trait to heuristically check for a *\::filesystem::path /// Done by checking for make_preferred and filename member functions with correct signature template struct is_path @@ -395,7 +395,7 @@ namespace nowide { { typedef T type; }; - /// SFINAE trait which has a member "type = Result" if the Path is a *::filesystem::path + /// SFINAE trait which has a member "type = Result" if the Path is a *\::filesystem::path template struct enable_if_path : enable_if::value, Result> {}; diff --git a/include/boost/nowide/stackstring.hpp b/include/boost/nowide/stackstring.hpp index 26a21f1b..f5d22a06 100644 --- a/include/boost/nowide/stackstring.hpp +++ b/include/boost/nowide/stackstring.hpp @@ -31,27 +31,36 @@ namespace nowide { class basic_stackstring { public: + /// Size of the stack buffer static const size_t buffer_size = BufferSize; + /// Type of the output character (converted to) typedef CharOut output_char; + /// Type of the input character (converted from) typedef CharIn input_char; + /// Creates a NULL stackstring basic_stackstring() : data_(NULL) { buffer_[0] = 0; } + /// Convert the NULL terminated string input and store in internal buffer + /// If input is NULL, nothing will be stored explicit basic_stackstring(const input_char* input) : data_(NULL) { convert(input); } + /// Convert the sequence [begin, end) and store in internal buffer + /// If begin is NULL, nothing will be stored basic_stackstring(const input_char* begin, const input_char* end) : data_(NULL) { convert(begin, end); } - + /// Copy construct from other basic_stackstring(const basic_stackstring& other) : data_(NULL) { *this = other; } + /// Copy assign from other basic_stackstring& operator=(const basic_stackstring& other) { if(this != &other) @@ -77,6 +86,8 @@ namespace nowide { clear(); } + /// Convert the NULL terminated string input and store in internal buffer + /// If input is NULL, the current buffer will be reset to NULL output_char* convert(const input_char* input) { if(input) @@ -84,6 +95,8 @@ namespace nowide { clear(); return get(); } + /// Convert the sequence [begin, end) and store in internal buffer + /// If begin is NULL, the current buffer will be reset to NULL output_char* convert(const input_char* begin, const input_char* end) { clear(); @@ -119,13 +132,14 @@ namespace nowide { { return data_; } + /// Reset the internal buffer to NULL void clear() { if(!uses_stack_memory()) delete[] data_; data_ = NULL; } - + /// Swap lhs with rhs friend void swap(basic_stackstring& lhs, basic_stackstring& rhs) { if(lhs.uses_stack_memory()) @@ -157,6 +171,8 @@ namespace nowide { { return data_ == buffer_; } + /// Return the current length of the string excluding the NULL terminator + /// If NULL is stored returns NULL size_t length() const { if(!data_) diff --git a/include/boost/nowide/utf8_codecvt.hpp b/include/boost/nowide/utf8_codecvt.hpp index f59c007e..ecb6a206 100644 --- a/include/boost/nowide/utf8_codecvt.hpp +++ b/include/boost/nowide/utf8_codecvt.hpp @@ -17,9 +17,7 @@ namespace boost { namespace nowide { - // // Make sure that mbstate can keep 16 bit of UTF-16 sequence - // BOOST_STATIC_ASSERT(sizeof(std::mbstate_t) >= 2); namespace detail { // Avoid including cstring for std::memcpy @@ -56,6 +54,7 @@ namespace nowide { template class utf8_codecvt; + /// Specialization for the UTF-8 <-> UTF-16 variant of the std::codecvt implementation template class BOOST_SYMBOL_VISIBLE utf8_codecvt : public std::codecvt { @@ -289,6 +288,7 @@ namespace nowide { } }; + /// Specialization for the UTF-8 <-> UTF-32 variant of the std::codecvt implementation template class BOOST_SYMBOL_VISIBLE utf8_codecvt : public std::codecvt { diff --git a/src/iostream.cpp b/src/iostream.cpp index 1ea12452..0acd04e0 100644 --- a/src/iostream.cpp +++ b/src/iostream.cpp @@ -12,6 +12,8 @@ namespace boost { namespace nowide { + /// Avoid empty compilation unit warnings + /// \internal BOOST_NOWIDE_DECL void dummy_exported_function() {} } // namespace nowide From f93c514d1306442444c85ac63abd5952b232474b Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 21 Apr 2020 18:52:53 +0200 Subject: [PATCH 2/3] Update doc Jamefile --- doc/Jamfile.v2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 90c1a427..442dfdf7 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -13,7 +13,7 @@ path-constant here : . ; .doxygen = [ doxygen.name ] ; .doxygen ?= doxygen ; -local sources = [ path.glob-tree ../include/boost/nowide : *.hpp : detail ] main.md ; +local sources = [ path.glob-tree ../include/boost/nowide : *.hpp : detail ] main.dox changelog.dox ; make html : ./Doxyfile : @make-html : $(sources) ; From 360e55f782bb5cd0ee1b690622c1611306d0a1f3 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sun, 19 Apr 2020 18:25:26 +0200 Subject: [PATCH 3/3] Bump version to 10.0.1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d899ac98..aec10782 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.9) # Version number starts at 10 to avoid conflicts with Boost version -set(_version 10.0.0) +set(_version 10.0.1) if(BOOST_SUPERPROJECT_SOURCE_DIR) set(_version ${BOOST_SUPERPROJECT_VERSION}) endif()