mirror of
https://github.com/boostorg/static_string.git
synced 2025-06-25 11:51:34 +02:00
Compare commits
12 Commits
boost-1.75
...
esp-idf-co
Author | SHA1 | Date | |
---|---|---|---|
b098498608 | |||
df908fa2fd | |||
5d6fefdd2a | |||
f92940bfab | |||
c5df271a1a | |||
6978da552e | |||
e6895ea26b | |||
d157311620 | |||
3a1efd2078 | |||
59c4c556bb | |||
c59150c042 | |||
d524755ec0 |
16
.travis.yml
16
.travis.yml
@ -99,8 +99,8 @@ anchors:
|
|||||||
"libc6-dbg",
|
"libc6-dbg",
|
||||||
"libc++-dev",
|
"libc++-dev",
|
||||||
"libstdc++-8-dev" ], sources: [ "llvm-toolchain-xenial-8",
|
"libstdc++-8-dev" ], sources: [ "llvm-toolchain-xenial-8",
|
||||||
"ubuntu-toolchain-r-test" ] } }
|
"ubuntu-toolchain-r-test" ] } }
|
||||||
|
|
||||||
gcc-48: &gcc-48 { apt: { packages: [ "g++-4.8" ] } }
|
gcc-48: &gcc-48 { apt: { packages: [ "g++-4.8" ] } }
|
||||||
gcc-49: &gcc-49 { apt: { packages: [ "g++-4.9" ], sources: [ "ubuntu-toolchain-r-test" ] } }
|
gcc-49: &gcc-49 { apt: { packages: [ "g++-4.9" ], sources: [ "ubuntu-toolchain-r-test" ] } }
|
||||||
gcc-5: &gcc-5 { apt: { packages: [ "g++-5" ] } }
|
gcc-5: &gcc-5 { apt: { packages: [ "g++-5" ] } }
|
||||||
@ -190,7 +190,7 @@ jobs:
|
|||||||
- { os: "linux", env: [ "B2_TOOLSET=clang-6.0", "B2_CXXSTD=14,17" ], addons: *clang-6 }
|
- { os: "linux", env: [ "B2_TOOLSET=clang-6.0", "B2_CXXSTD=14,17" ], addons: *clang-6 }
|
||||||
- { os: "linux", env: [ "B2_TOOLSET=clang-7", "B2_CXXSTD=17" ], addons: *clang-7 }
|
- { os: "linux", env: [ "B2_TOOLSET=clang-7", "B2_CXXSTD=17" ], addons: *clang-7 }
|
||||||
- { os: "linux", env: [ "B2_TOOLSET=clang-8", "B2_CXXSTD=17" ], addons: *clang-8 }
|
- { os: "linux", env: [ "B2_TOOLSET=clang-8", "B2_CXXSTD=17" ], addons: *clang-8 }
|
||||||
|
|
||||||
- os: "linux"
|
- os: "linux"
|
||||||
env: ["B2_TOOLSET=clang-9", "B2_CXXSTD=11,14,17"]
|
env: ["B2_TOOLSET=clang-9", "B2_CXXSTD=11,14,17"]
|
||||||
addons:
|
addons:
|
||||||
@ -203,8 +203,8 @@ jobs:
|
|||||||
- clang-9
|
- clang-9
|
||||||
- libc6-dbg
|
- libc6-dbg
|
||||||
- libc++-dev
|
- libc++-dev
|
||||||
- libstdc++-8-dev
|
- libstdc++-8-dev
|
||||||
|
|
||||||
# libc++
|
# libc++
|
||||||
- { os: "linux", env: [ "B2_TOOLSET=clang-6.0", "B2_CXXSTD=11,14",
|
- { os: "linux", env: [ "B2_TOOLSET=clang-6.0", "B2_CXXSTD=11,14",
|
||||||
"B2_CXXFLAGS=-stdlib=libc++" ], addons: *clang-6 }
|
"B2_CXXFLAGS=-stdlib=libc++" ], addons: *clang-6 }
|
||||||
@ -246,7 +246,7 @@ jobs:
|
|||||||
script:
|
script:
|
||||||
- cd $BOOST_ROOT/libs/$SELF
|
- cd $BOOST_ROOT/libs/$SELF
|
||||||
- ci/travis/coverity.sh
|
- ci/travis/coverity.sh
|
||||||
|
|
||||||
# Standalone tests for StaticString
|
# Standalone tests for StaticString
|
||||||
- { os: "linux", env: [ "COMMENT=STANDALONE", "B2_TOOLSET=gcc-7", "B2_DEFINES=define=BOOST_STATIC_STRING_STANDALONE", "B2_CXXSTD=17" ], addons: *gcc-7 }
|
- { os: "linux", env: [ "COMMENT=STANDALONE", "B2_TOOLSET=gcc-7", "B2_DEFINES=define=BOOST_STATIC_STRING_STANDALONE", "B2_CXXSTD=17" ], addons: *gcc-7 }
|
||||||
- { os: "linux", env: [ "COMMENT=STANDALONE", "B2_TOOLSET=gcc-8", "B2_DEFINES=define=BOOST_STATIC_STRING_STANDALONE", "B2_CXXSTD=17" ], addons: *gcc-8 }
|
- { os: "linux", env: [ "COMMENT=STANDALONE", "B2_TOOLSET=gcc-8", "B2_DEFINES=define=BOOST_STATIC_STRING_STANDALONE", "B2_CXXSTD=17" ], addons: *gcc-8 }
|
||||||
@ -267,9 +267,9 @@ jobs:
|
|||||||
- libc6-dbg
|
- libc6-dbg
|
||||||
- libc++-dev
|
- libc++-dev
|
||||||
- libstdc++-8-dev
|
- libstdc++-8-dev
|
||||||
|
|
||||||
- { os: "osx" , env: [ "COMMENT=STANDALONE", "B2_TOOLSET=clang", "B2_DEFINES=define=BOOST_STATIC_STRING_STANDALONE", "B2_CXXSTD=17" ] }
|
- { os: "osx" , env: [ "COMMENT=STANDALONE", "B2_TOOLSET=clang", "B2_DEFINES=define=BOOST_STATIC_STRING_STANDALONE", "B2_CXXSTD=17" ] }
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
false
|
false
|
||||||
|
@ -1,3 +1,32 @@
|
|||||||
|
# Generated by `boostdep --cmake static_string`
|
||||||
|
# Copyright 2020 Peter Dimov
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
if(NOT DEFINED IDF_TARGET)
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.5...3.16)
|
||||||
|
|
||||||
|
project(boost_static_string VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||||
|
|
||||||
|
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
|
|
||||||
|
add_library(boost_static_string INTERFACE)
|
||||||
|
add_library(Boost::static_string ALIAS boost_static_string)
|
||||||
|
|
||||||
|
target_include_directories(boost_static_string INTERFACE include)
|
||||||
|
|
||||||
|
target_link_libraries(boost_static_string
|
||||||
|
INTERFACE
|
||||||
|
Boost::assert
|
||||||
|
Boost::container_hash
|
||||||
|
Boost::static_assert
|
||||||
|
Boost::throw_exception
|
||||||
|
Boost::utility
|
||||||
|
)
|
||||||
|
|
||||||
|
else()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
|
# Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
|
||||||
#
|
#
|
||||||
@ -7,12 +36,6 @@
|
|||||||
# Official repository: https://github.com/boostorg/static_string
|
# Official repository: https://github.com/boostorg/static_string
|
||||||
#
|
#
|
||||||
|
|
||||||
cmake_minimum_required (VERSION 3.5.1)
|
|
||||||
|
|
||||||
if (POLICY CMP0074)
|
|
||||||
cmake_policy (SET CMP0074 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
function (DoGroupSources curdir rootdir folder)
|
function (DoGroupSources curdir rootdir folder)
|
||||||
@ -40,8 +63,6 @@ endfunction()
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
project (StaticString VERSION 1)
|
|
||||||
|
|
||||||
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
@ -150,3 +171,25 @@ file (GLOB_RECURSE PROJECT_FILES
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_subdirectory (test)
|
add_subdirectory (test)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
else()
|
||||||
|
|
||||||
|
FILE(GLOB_RECURSE headers include/*.h include/*.hpp)
|
||||||
|
|
||||||
|
idf_component_register(
|
||||||
|
SRCS
|
||||||
|
${headers}
|
||||||
|
INCLUDE_DIRS
|
||||||
|
include
|
||||||
|
REQUIRES
|
||||||
|
boost_assert
|
||||||
|
boost_container_hash
|
||||||
|
boost_static_assert
|
||||||
|
boost_throw_exception
|
||||||
|
boost_utility
|
||||||
|
)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
279
doc/Jamfile
279
doc/Jamfile
@ -8,252 +8,51 @@
|
|||||||
|
|
||||||
project static_string/doc ;
|
project static_string/doc ;
|
||||||
|
|
||||||
import os ;
|
|
||||||
import path ;
|
|
||||||
import boostbook ;
|
import boostbook ;
|
||||||
import quickbook ;
|
import ../../../tools/docca/docca.jam ;
|
||||||
import xsltproc ;
|
|
||||||
import doxygen ;
|
|
||||||
import modules ;
|
|
||||||
import saxonhe ;
|
|
||||||
import common ;
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Build the list of header files that Doxygen will scan. We need
|
|
||||||
# this list to inform the build system of the dependencies so the
|
|
||||||
# docs can be rebuild if any of the header files change.
|
|
||||||
#
|
|
||||||
|
|
||||||
local sources = [ path.glob-tree ../include/boost/static_string : *.hpp *.ipp : detail impl ] ;
|
docca.reference reference.qbk
|
||||||
|
|
||||||
# Get the configured paths to doxygen and xsltproc
|
|
||||||
|
|
||||||
.doxygen = [ doxygen.name ] ;
|
|
||||||
.doxygen ?= doxygen ;
|
|
||||||
|
|
||||||
#ECHO Using doxygen from "$(.doxygen)" ;
|
|
||||||
|
|
||||||
.xsltproc = [ xsltproc.name ] ;
|
|
||||||
.xsltproc ?= xsltproc ;
|
|
||||||
|
|
||||||
#ECHO Using xsltproc from "$(.xsltproc)" ;
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Invoke Doxygen to process the header files and produce the XML
|
|
||||||
# containing the description of the C++ declarations and extracted
|
|
||||||
# Javadoc comments.
|
|
||||||
#
|
|
||||||
make index.xml
|
|
||||||
:
|
:
|
||||||
./source.dox
|
xsl/custom-overrides.xsl
|
||||||
|
[ glob-tree-ex ../include/boost/static_string : *.hpp *.ipp : detail impl ]
|
||||||
:
|
:
|
||||||
@make_doxygen_xml
|
<doxygen:param>PROJECT_NAME=StaticString
|
||||||
:
|
<doxygen:param>PROJECT_BRIEF="String Library"
|
||||||
<dependency>$(sources)
|
<doxygen:param>ALIASES="esafe=\"@par Exception Safety\""
|
||||||
|
<doxygen:param>FILE_PATTERNS=
|
||||||
|
<doxygen:param>EXAMPLE_PATTERNS=
|
||||||
|
<doxygen:param>DISTRIBUTE_GROUP_DOC=YES
|
||||||
|
<doxygen:param>MACRO_EXPANSION=YES
|
||||||
|
<doxygen:param>EXPAND_ONLY_PREDEF=YES
|
||||||
|
<doxygen:param>PREDEFINED="\\
|
||||||
|
BOOST_STATIC_STRING_DOCS \\
|
||||||
|
\"BOOST_STATIC_STRING_CPP11_CONSTEXPR=constexpr\" \\
|
||||||
|
\"BOOST_STATIC_STRING_CPP14_CONSTEXPR=constexpr\" \\
|
||||||
|
\"BOOST_STATIC_STRING_CPP17_CONSTEXPR=constexpr\" \\
|
||||||
|
\"BOOST_STATIC_STRING_CPP20_CONSTEXPR=constexpr\""
|
||||||
|
<doxygen:param>ABBREVIATE_BRIEF=
|
||||||
|
<doxygen:param>INLINE_INHERITED_MEMB=YES
|
||||||
|
<doxygen:param>JAVADOC_AUTOBRIEF=YES
|
||||||
|
<doxygen:param>AUTOLINK_SUPPORT=NO
|
||||||
|
<doxygen:param>EXTRACT_ALL=YES
|
||||||
|
<doxygen:param>EXTRACT_PRIVATE=YES
|
||||||
|
<doxygen:param>EXTRACT_LOCAL_CLASSES=NO
|
||||||
|
<doxygen:param>SHOW_INCLUDE_FILES=NO
|
||||||
|
<doxygen:param>INLINE_INFO=NO
|
||||||
|
<doxygen:param>SORT_MEMBER_DOCS=NO
|
||||||
|
<doxygen:param>SORT_MEMBERS_CTORS_1ST=YES
|
||||||
|
<doxygen:param>SHOW_USED_FILES=NO
|
||||||
|
<doxygen:param>SHOW_FILES=NO
|
||||||
|
<doxygen:param>SHOW_NAMESPACES=NO
|
||||||
|
<doxygen:param>CLASS_DIAGRAMS=NO
|
||||||
|
|
||||||
|
# <doxygen:param>ALLOW_UNICODE_NAMES=NO
|
||||||
|
# <doxygen:param>GROUP_NESTED_COMPOUNDS=NO
|
||||||
|
# <doxygen:param>HIDE_COMPOUND_REFERENCE=NO
|
||||||
|
# <doxygen:param>WARN_AS_ERROR=NO
|
||||||
;
|
;
|
||||||
|
|
||||||
rule make_doxygen_xml ( targets * : sources * : properties * )
|
|
||||||
{
|
|
||||||
LIB_DIR on $(targets) =
|
|
||||||
[ path.native [ path.parent [ path.root
|
|
||||||
[ on $(sources[1]) return $(SEARCH) ] [ path.pwd ] ] ] ] ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ os.name ] = NT
|
|
||||||
{
|
|
||||||
actions make_doxygen_xml
|
|
||||||
{
|
|
||||||
SET LIB_DIR=$(LIB_DIR)
|
|
||||||
SET XML_OUTPUT=$(1:D)
|
|
||||||
"$(.doxygen)" $(2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
actions make_doxygen_xml
|
|
||||||
{
|
|
||||||
export LIB_DIR=$(LIB_DIR)
|
|
||||||
export XML_OUTPUT=$(1:D)
|
|
||||||
"$(.doxygen)" $(2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Copy all the XSLT modules to the target directory.
|
|
||||||
#
|
|
||||||
# FIXME: Change this so we can just specify a directory,
|
|
||||||
# rather than every file individually.
|
|
||||||
#
|
|
||||||
# Also, somehow force dependencies in a general way
|
|
||||||
# such that the XSLT has to be executed again
|
|
||||||
# if any of the modules change. For example,
|
|
||||||
# if base-extract-xml-pages.xml changes, then
|
|
||||||
# an invocation of extract-xml-pages.xsl (which
|
|
||||||
# imports the former) must be run again.
|
|
||||||
#
|
|
||||||
path-constant docca : ../../../tools/docca ;
|
|
||||||
make extract-xml-pages.xsl : $(docca)/include/docca/extract-xml-pages.xsl : @copy_script ;
|
|
||||||
make base-extract-xml-pages.xsl : $(docca)/include/docca/base-extract-xml-pages.xsl : @copy_script ;
|
|
||||||
make common.xsl : $(docca)/include/docca/common.xsl : @copy_script ;
|
|
||||||
make stage1.xsl : $(docca)/include/docca/stage1.xsl : @copy_script ;
|
|
||||||
make base-stage1.xsl : $(docca)/include/docca/base-stage1.xsl : @copy_script ;
|
|
||||||
make stage2.xsl : $(docca)/include/docca/stage2.xsl : @copy_script ;
|
|
||||||
make assemble-quickbook.xsl : $(docca)/include/docca/assemble-quickbook.xsl : @copy_script ;
|
|
||||||
make emphasized-types.xsl : $(docca)/include/docca/emphasized-types.xsl : @copy_script ;
|
|
||||||
|
|
||||||
make config.xsl
|
|
||||||
:
|
|
||||||
$(docca)/include/docca/config.xsl
|
|
||||||
xsl/config.xsl
|
|
||||||
xsl/class_detail.xsl
|
|
||||||
xsl/includes.xsl
|
|
||||||
:
|
|
||||||
@make_config
|
|
||||||
;
|
|
||||||
|
|
||||||
actions make_config
|
|
||||||
{
|
|
||||||
cp $(2[1]) $(1)
|
|
||||||
sed -i -e "/<!-- CONFIG_TEMPLATE -->/{r $(2[2])" -e "d}" $(1)
|
|
||||||
sed -i -e "/<!-- CLASS_DETAIL_TEMPLATE -->/{r $(2[3])" -e "d}" $(1)
|
|
||||||
sed -i -e "/<!-- INCLUDES_TEMPLATE -->/{r $(2[4])" -e "d}" $(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make a copy of the given file.
|
|
||||||
#
|
|
||||||
actions copy_script
|
|
||||||
{
|
|
||||||
cp $(2[1]) $(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# This is to initially create the directory as a side effect; I'm sure there's a better way...
|
|
||||||
make xml-pages/directory/placeholder : index.xml : @null_action ;
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Run index.xml through the first transformation stage
|
|
||||||
# (assembling and splitting the XML into page-specific files).
|
|
||||||
#
|
|
||||||
make xml-pages.xml
|
|
||||||
:
|
|
||||||
index.xml
|
|
||||||
extract-xml-pages.xsl
|
|
||||||
|
|
||||||
# Make bjam aware of additional dependencies
|
|
||||||
base-extract-xml-pages.xsl
|
|
||||||
config.xsl
|
|
||||||
common.xsl
|
|
||||||
:
|
|
||||||
saxonhe.saxonhe
|
|
||||||
;
|
|
||||||
|
|
||||||
# This is just to make the directory eligible as a source
|
|
||||||
make xml-pages : index.xml : @null_action ;
|
|
||||||
|
|
||||||
# Not ready for prime time until I figure out how to get the xslt-visualizer code in place
|
|
||||||
#make stage1/code-trace-enabled/stage1.xsl
|
|
||||||
# :
|
|
||||||
# stage1.xsl
|
|
||||||
# xslt-visualizer/xsl/trace-enable.xsl
|
|
||||||
# :
|
|
||||||
# saxonhe.saxonhe
|
|
||||||
# ;
|
|
||||||
|
|
||||||
# This is to initially create the directory as a side effect; I'm sure there's a better way...
|
|
||||||
make stage1/results/directory/placeholder : xml-pages.xml : @null_action ;
|
|
||||||
make stage2/results/directory/placeholder : xml-pages.xml : @null_action ;
|
|
||||||
|
|
||||||
# TODO: figure out why this (and the following stage) get built every time
|
|
||||||
make stage1/results
|
|
||||||
:
|
|
||||||
xml-pages
|
|
||||||
stage1.xsl
|
|
||||||
|
|
||||||
# additional dependencies
|
|
||||||
xml-pages.xml
|
|
||||||
base-stage1.xsl
|
|
||||||
config.xsl
|
|
||||||
common.xsl
|
|
||||||
:
|
|
||||||
saxonhe.saxonhe_dir
|
|
||||||
;
|
|
||||||
|
|
||||||
make stage2/results
|
|
||||||
:
|
|
||||||
stage1/results
|
|
||||||
stage2.xsl
|
|
||||||
|
|
||||||
# additional dependencies
|
|
||||||
emphasized-types.xsl
|
|
||||||
:
|
|
||||||
saxonhe.saxonhe_dir
|
|
||||||
;
|
|
||||||
|
|
||||||
make reference.qbk
|
|
||||||
:
|
|
||||||
xml-pages.xml
|
|
||||||
assemble-quickbook.xsl
|
|
||||||
|
|
||||||
# TODO: make this input to the XSLT somehow
|
|
||||||
# rather than relying on it being hard-coded
|
|
||||||
# in the XSLT (which it is!)
|
|
||||||
stage2/results
|
|
||||||
:
|
|
||||||
saxonhe.saxonhe
|
|
||||||
;
|
|
||||||
|
|
||||||
actions make_dir
|
|
||||||
{
|
|
||||||
mkdir $(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
make combine.xslt : index.xml : @null_action ;
|
|
||||||
|
|
||||||
actions touch_file
|
|
||||||
{
|
|
||||||
touch $(1) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
actions null_action
|
|
||||||
{
|
|
||||||
touch -c $(1) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
make reference.xml
|
|
||||||
:
|
|
||||||
combine.xslt
|
|
||||||
index.xml
|
|
||||||
:
|
|
||||||
@call-xsltproc
|
|
||||||
;
|
|
||||||
|
|
||||||
actions call-xsltproc
|
|
||||||
{
|
|
||||||
"$(.xsltproc)" $(2) > $(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Produce the reference.qbk file by running
|
|
||||||
# the reference xml through the transform.
|
|
||||||
#
|
|
||||||
#make reference.qbk
|
|
||||||
# :
|
|
||||||
# reference.xml
|
|
||||||
# transform.xsl
|
|
||||||
# :
|
|
||||||
# saxonhe.saxonhe
|
|
||||||
# ;
|
|
||||||
|
|
||||||
# We have to make a copy of reference.qbk and put it
|
|
||||||
# in a place where the static .qbk files can find it
|
|
||||||
#
|
|
||||||
install qbk : reference.qbk ;
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Produce the Boost.Book XML from the QuickBook
|
# Produce the Boost.Book XML from the QuickBook
|
||||||
@ -272,7 +71,7 @@ xml static_string_doc
|
|||||||
qbk/main.qbk
|
qbk/main.qbk
|
||||||
:
|
:
|
||||||
<dependency>images
|
<dependency>images
|
||||||
<dependency>qbk
|
<dependency>reference.qbk
|
||||||
;
|
;
|
||||||
|
|
||||||
explicit static_string_doc ;
|
explicit static_string_doc ;
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
[template include_file[path][^<'''<ulink url="../../../../'''[path]'''">'''[path]'''</ulink>'''>]]
|
[template include_file[path][^<'''<ulink url="../../../../'''[path]'''">'''[path]'''</ulink>'''>]]
|
||||||
|
|
||||||
[def __InputIterator__ [@https://en.cppreference.com/w/cpp/named_req/InputIterator ['InputIterator]]]
|
[def __InputIterator__ [@https://en.cppreference.com/w/cpp/named_req/InputIterator ['InputIterator]]]
|
||||||
|
[def __UnaryPredicate__ [@https://en.cppreference.com/w/cpp/named_req/Predicate ['Predicate]]]
|
||||||
|
|
||||||
[/-----------------------------------------------------------------------------]
|
[/-----------------------------------------------------------------------------]
|
||||||
|
|
||||||
|
252
doc/source.dox
252
doc/source.dox
@ -1,252 +0,0 @@
|
|||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the input files
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
INPUT = \
|
|
||||||
$(LIB_DIR)/include/boost/static_string
|
|
||||||
|
|
||||||
ALIASES += esafe="@par Exception Safety"
|
|
||||||
|
|
||||||
INPUT_ENCODING = UTF-8
|
|
||||||
FILE_PATTERNS =
|
|
||||||
RECURSIVE = NO
|
|
||||||
EXCLUDE =
|
|
||||||
EXCLUDE_SYMLINKS = NO
|
|
||||||
EXCLUDE_PATTERNS =
|
|
||||||
EXCLUDE_SYMBOLS =
|
|
||||||
EXAMPLE_PATH =
|
|
||||||
EXAMPLE_PATTERNS =
|
|
||||||
EXAMPLE_RECURSIVE = NO
|
|
||||||
IMAGE_PATH =
|
|
||||||
INPUT_FILTER =
|
|
||||||
FILTER_PATTERNS =
|
|
||||||
FILTER_SOURCE_FILES = NO
|
|
||||||
FILTER_SOURCE_PATTERNS =
|
|
||||||
USE_MDFILE_AS_MAINPAGE =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the preprocessor
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
ENABLE_PREPROCESSING = YES
|
|
||||||
MACRO_EXPANSION = YES
|
|
||||||
EXPAND_ONLY_PREDEF = YES
|
|
||||||
SEARCH_INCLUDES = YES
|
|
||||||
INCLUDE_PATH = ../
|
|
||||||
INCLUDE_FILE_PATTERNS =
|
|
||||||
|
|
||||||
PREDEFINED = \
|
|
||||||
BOOST_STATIC_STRING_DOCS \
|
|
||||||
"BOOST_STATIC_STRING_CPP11_CONSTEXPR=constexpr" \
|
|
||||||
"BOOST_STATIC_STRING_CPP14_CONSTEXPR=constexpr" \
|
|
||||||
"BOOST_STATIC_STRING_CPP17_CONSTEXPR=constexpr" \
|
|
||||||
"BOOST_STATIC_STRING_CPP20_CONSTEXPR=constexpr"
|
|
||||||
|
|
||||||
EXPAND_AS_DEFINED =
|
|
||||||
SKIP_FUNCTION_MACROS = YES
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Project related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
DOXYFILE_ENCODING = UTF-8
|
|
||||||
PROJECT_NAME = "StaticString"
|
|
||||||
PROJECT_NUMBER =
|
|
||||||
PROJECT_BRIEF = String Library
|
|
||||||
PROJECT_LOGO =
|
|
||||||
OUTPUT_DIRECTORY =
|
|
||||||
CREATE_SUBDIRS = NO
|
|
||||||
#####ALLOW_UNICODE_NAMES = NO
|
|
||||||
OUTPUT_LANGUAGE = English
|
|
||||||
BRIEF_MEMBER_DESC = YES
|
|
||||||
REPEAT_BRIEF = YES
|
|
||||||
ABBREVIATE_BRIEF =
|
|
||||||
ALWAYS_DETAILED_SEC = NO
|
|
||||||
INLINE_INHERITED_MEMB = YES
|
|
||||||
FULL_PATH_NAMES = YES
|
|
||||||
#STRIP_FROM_PATH = $(LIB_DIR)/include # Requires doxygen 1.8.7+
|
|
||||||
STRIP_FROM_INC_PATH =
|
|
||||||
SHORT_NAMES = NO
|
|
||||||
JAVADOC_AUTOBRIEF = YES
|
|
||||||
QT_AUTOBRIEF = NO
|
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
|
||||||
INHERIT_DOCS = YES
|
|
||||||
SEPARATE_MEMBER_PAGES = NO
|
|
||||||
TAB_SIZE = 4
|
|
||||||
TCL_SUBST =
|
|
||||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
|
||||||
OPTIMIZE_OUTPUT_JAVA = NO
|
|
||||||
OPTIMIZE_FOR_FORTRAN = NO
|
|
||||||
OPTIMIZE_OUTPUT_VHDL = NO
|
|
||||||
EXTENSION_MAPPING =
|
|
||||||
MARKDOWN_SUPPORT = YES
|
|
||||||
AUTOLINK_SUPPORT = YES
|
|
||||||
BUILTIN_STL_SUPPORT = NO
|
|
||||||
CPP_CLI_SUPPORT = NO
|
|
||||||
SIP_SUPPORT = NO
|
|
||||||
IDL_PROPERTY_SUPPORT = YES
|
|
||||||
DISTRIBUTE_GROUP_DOC = YES
|
|
||||||
#####GROUP_NESTED_COMPOUNDS = NO
|
|
||||||
SUBGROUPING = YES
|
|
||||||
INLINE_GROUPED_CLASSES = NO
|
|
||||||
INLINE_SIMPLE_STRUCTS = NO
|
|
||||||
TYPEDEF_HIDES_STRUCT = NO
|
|
||||||
LOOKUP_CACHE_SIZE = 0
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Build related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
EXTRACT_ALL = YES
|
|
||||||
EXTRACT_PRIVATE = YES
|
|
||||||
EXTRACT_PACKAGE = NO
|
|
||||||
EXTRACT_STATIC = NO
|
|
||||||
EXTRACT_LOCAL_CLASSES = NO
|
|
||||||
EXTRACT_LOCAL_METHODS = NO
|
|
||||||
EXTRACT_ANON_NSPACES = NO
|
|
||||||
HIDE_UNDOC_MEMBERS = NO
|
|
||||||
HIDE_UNDOC_CLASSES = NO
|
|
||||||
HIDE_FRIEND_COMPOUNDS = NO
|
|
||||||
HIDE_IN_BODY_DOCS = NO
|
|
||||||
INTERNAL_DOCS = NO
|
|
||||||
CASE_SENSE_NAMES = YES
|
|
||||||
HIDE_SCOPE_NAMES = NO
|
|
||||||
#####HIDE_COMPOUND_REFERENCE= NO
|
|
||||||
SHOW_INCLUDE_FILES = NO
|
|
||||||
SHOW_GROUPED_MEMB_INC = NO
|
|
||||||
FORCE_LOCAL_INCLUDES = NO
|
|
||||||
INLINE_INFO = NO
|
|
||||||
SORT_MEMBER_DOCS = NO
|
|
||||||
SORT_BRIEF_DOCS = NO
|
|
||||||
SORT_MEMBERS_CTORS_1ST = YES
|
|
||||||
SORT_GROUP_NAMES = NO
|
|
||||||
SORT_BY_SCOPE_NAME = NO
|
|
||||||
STRICT_PROTO_MATCHING = NO
|
|
||||||
GENERATE_TODOLIST = NO
|
|
||||||
GENERATE_TESTLIST = NO
|
|
||||||
GENERATE_BUGLIST = NO
|
|
||||||
GENERATE_DEPRECATEDLIST= NO
|
|
||||||
ENABLED_SECTIONS =
|
|
||||||
MAX_INITIALIZER_LINES = 30
|
|
||||||
SHOW_USED_FILES = NO
|
|
||||||
SHOW_FILES = NO
|
|
||||||
SHOW_NAMESPACES = NO
|
|
||||||
FILE_VERSION_FILTER =
|
|
||||||
LAYOUT_FILE =
|
|
||||||
CITE_BIB_FILES =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to warning and progress messages
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
QUIET = NO
|
|
||||||
WARNINGS = YES
|
|
||||||
WARN_IF_UNDOCUMENTED = YES
|
|
||||||
WARN_IF_DOC_ERROR = YES
|
|
||||||
WARN_NO_PARAMDOC = NO
|
|
||||||
#####WARN_AS_ERROR = NO
|
|
||||||
WARN_FORMAT = "$file:$line: $text"
|
|
||||||
WARN_LOGFILE =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to source browsing
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
SOURCE_BROWSER = NO
|
|
||||||
INLINE_SOURCES = NO
|
|
||||||
STRIP_CODE_COMMENTS = YES
|
|
||||||
REFERENCED_BY_RELATION = NO
|
|
||||||
REFERENCES_RELATION = NO
|
|
||||||
REFERENCES_LINK_SOURCE = YES
|
|
||||||
SOURCE_TOOLTIPS = YES
|
|
||||||
USE_HTAGS = NO
|
|
||||||
VERBATIM_HEADERS = YES
|
|
||||||
CLANG_ASSISTED_PARSING = NO
|
|
||||||
CLANG_OPTIONS =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the alphabetical class index
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
ALPHABETICAL_INDEX = YES
|
|
||||||
COLS_IN_ALPHA_INDEX = 5
|
|
||||||
IGNORE_PREFIX =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the HTML output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_HTML = NO
|
|
||||||
HTML_OUTPUT = dhtm
|
|
||||||
HTML_FILE_EXTENSION = .html
|
|
||||||
HTML_HEADER =
|
|
||||||
HTML_FOOTER =
|
|
||||||
HTML_STYLESHEET =
|
|
||||||
HTML_EXTRA_STYLESHEET =
|
|
||||||
HTML_EXTRA_FILES =
|
|
||||||
HTML_COLORSTYLE_HUE = 220
|
|
||||||
HTML_COLORSTYLE_SAT = 100
|
|
||||||
HTML_COLORSTYLE_GAMMA = 80
|
|
||||||
HTML_TIMESTAMP = NO
|
|
||||||
HTML_DYNAMIC_SECTIONS = NO
|
|
||||||
HTML_INDEX_NUM_ENTRIES = 100
|
|
||||||
GENERATE_DOCSET = NO
|
|
||||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
|
||||||
DOCSET_BUNDLE_ID = org.doxygen.Project
|
|
||||||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
|
|
||||||
DOCSET_PUBLISHER_NAME = Publisher
|
|
||||||
GENERATE_HTMLHELP = NO
|
|
||||||
CHM_FILE =
|
|
||||||
HHC_LOCATION =
|
|
||||||
GENERATE_CHI = NO
|
|
||||||
CHM_INDEX_ENCODING =
|
|
||||||
BINARY_TOC = NO
|
|
||||||
TOC_EXPAND = NO
|
|
||||||
GENERATE_QHP = NO
|
|
||||||
QCH_FILE =
|
|
||||||
QHP_NAMESPACE = org.doxygen.Project
|
|
||||||
QHP_VIRTUAL_FOLDER = doc
|
|
||||||
QHP_CUST_FILTER_NAME =
|
|
||||||
QHP_CUST_FILTER_ATTRS =
|
|
||||||
QHP_SECT_FILTER_ATTRS =
|
|
||||||
QHG_LOCATION =
|
|
||||||
GENERATE_ECLIPSEHELP = NO
|
|
||||||
ECLIPSE_DOC_ID = org.doxygen.Project
|
|
||||||
DISABLE_INDEX = NO
|
|
||||||
GENERATE_TREEVIEW = NO
|
|
||||||
ENUM_VALUES_PER_LINE = 4
|
|
||||||
TREEVIEW_WIDTH = 250
|
|
||||||
EXT_LINKS_IN_WINDOW = NO
|
|
||||||
FORMULA_FONTSIZE = 10
|
|
||||||
FORMULA_TRANSPARENT = YES
|
|
||||||
USE_MATHJAX = NO
|
|
||||||
MATHJAX_FORMAT = HTML-CSS
|
|
||||||
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
|
|
||||||
MATHJAX_EXTENSIONS =
|
|
||||||
MATHJAX_CODEFILE =
|
|
||||||
SEARCHENGINE = YES
|
|
||||||
SERVER_BASED_SEARCH = NO
|
|
||||||
EXTERNAL_SEARCH = NO
|
|
||||||
SEARCHENGINE_URL =
|
|
||||||
SEARCHDATA_FILE = searchdata.xml
|
|
||||||
EXTERNAL_SEARCH_ID =
|
|
||||||
EXTRA_SEARCH_MAPPINGS =
|
|
||||||
|
|
||||||
GENERATE_LATEX = NO
|
|
||||||
GENERATE_RTF = NO
|
|
||||||
GENERATE_MAN = NO
|
|
||||||
GENERATE_DOCBOOK = NO
|
|
||||||
GENERATE_AUTOGEN_DEF = NO
|
|
||||||
GENERATE_PERLMOD = NO
|
|
||||||
CLASS_DIAGRAMS = NO
|
|
||||||
HAVE_DOT = NO
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the XML output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_XML = YES
|
|
||||||
XML_OUTPUT = $(XML_OUTPUT)
|
|
||||||
XML_PROGRAMLISTING = YES
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to external references
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
TAGFILES =
|
|
||||||
GENERATE_TAGFILE =
|
|
||||||
ALLEXTERNALS = NO
|
|
||||||
EXTERNAL_GROUPS = YES
|
|
||||||
EXTERNAL_PAGES = YES
|
|
||||||
PERL_PATH = /usr/bin/perl
|
|
@ -1,3 +0,0 @@
|
|||||||
<!-- CLASS_DETAIL_TEMPLATE BEGIN -->
|
|
||||||
<xsl:when test="$normal-tparam = 'InputIterator'"><xsl:text>__InputIterator__</xsl:text></xsl:when>
|
|
||||||
<!-- CLASS_DETAIL_TEMPLATE END -->
|
|
@ -1,6 +0,0 @@
|
|||||||
<!-- Variables (Edit for your project) -->
|
|
||||||
<xsl:variable name="doc-ref" select="'static_string.ref'"/>
|
|
||||||
<xsl:variable name="doc-ns" select="'boost::static_strings'"/>
|
|
||||||
<xsl:variable name="debug" select="0"/>
|
|
||||||
<xsl:variable name="private" select="0"/>
|
|
||||||
<!-- End Variables -->
|
|
11
doc/xsl/custom-overrides.xsl
Normal file
11
doc/xsl/custom-overrides.xsl
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<xsl:stylesheet version="3.0"
|
||||||
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
exclude-result-prefixes="xs"
|
||||||
|
expand-text="yes">
|
||||||
|
|
||||||
|
<xsl:variable name="doc-ref" select="'static_string.ref'"/>
|
||||||
|
<xsl:variable name="doc-ns" select="'boost::static_strings'"/>
|
||||||
|
<xsl:variable name="include-private-members" select="false()"/>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
@ -1,5 +0,0 @@
|
|||||||
<!-- INCLUDES_TEMPLATE BEGIN -->
|
|
||||||
<xsl:text>Defined in header [include_file </xsl:text>
|
|
||||||
<xsl:value-of select="substring-after($file,'include/')"/>
|
|
||||||
<xsl:text>]

</xsl:text>
|
|
||||||
<!-- INCLUDES_TEMPLATE END -->
|
|
@ -1,7 +0,0 @@
|
|||||||
<!-- INCLUDES_FOOT_TEMPLATE BEGIN -->
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="contains($file, 'supercalifragilisticexpialidocious')">
|
|
||||||
<xsl:text>

Easter Egg
</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
</xsl:choose>
|
|
||||||
<!-- INCLUDES_FOOT_TEMPLATE END -->
|
|
@ -20,7 +20,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Include <version> if we can
|
// Include <version> if we can
|
||||||
#ifdef __has_include
|
#ifdef __has_include
|
||||||
#if __has_include(<version>)
|
#if __has_include(<version>)
|
||||||
#include <version>
|
#include <version>
|
||||||
#endif
|
#endif
|
||||||
@ -45,7 +45,7 @@
|
|||||||
#define BOOST_STATIC_STRING_CHECK_FOR_ATTR(x) __has_cpp_attribute(x)
|
#define BOOST_STATIC_STRING_CHECK_FOR_ATTR(x) __has_cpp_attribute(x)
|
||||||
#elif defined(__has_attribute)
|
#elif defined(__has_attribute)
|
||||||
#define BOOST_STATIC_STRING_CHECK_FOR_ATTR(x) __has_attribute(x)
|
#define BOOST_STATIC_STRING_CHECK_FOR_ATTR(x) __has_attribute(x)
|
||||||
#else
|
#else
|
||||||
#define BOOST_STATIC_STRING_CHECK_FOR_ATTR(x) 0
|
#define BOOST_STATIC_STRING_CHECK_FOR_ATTR(x) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,8 @@
|
|||||||
"String"
|
"String"
|
||||||
],
|
],
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
"Krystian Stasiowski <sdkrystian@gmail.com>"
|
"Krystian Stasiowski <sdkrystian@gmail.com>",
|
||||||
]
|
"Vinnie Falco <vinnie.falco@gmail.com>"
|
||||||
|
],
|
||||||
|
"cxxstd": "11"
|
||||||
}
|
}
|
||||||
|
@ -41,14 +41,14 @@ struct cxper_char_traits
|
|||||||
*(dest++) = *(src++);
|
*(dest++) = *(src++);
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
static constexpr char_type* copy(char_type* dest, const char_type* src, std::size_t n)
|
static constexpr char_type* copy(char_type* dest, const char_type* src, std::size_t n)
|
||||||
{
|
{
|
||||||
const auto temp = dest;
|
const auto temp = dest;
|
||||||
while (n--)
|
while (n--)
|
||||||
*(dest++) = *(src++);
|
*(dest++) = *(src++);
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
static constexpr char_type* assign(char_type* dest, std::size_t n, char_type ch)
|
static constexpr char_type* assign(char_type* dest, std::size_t n, char_type ch)
|
||||||
{
|
{
|
||||||
const auto temp = dest;
|
const auto temp = dest;
|
||||||
while (n--)
|
while (n--)
|
||||||
@ -62,8 +62,8 @@ using cxper_char_traits = std::char_traits<char>;
|
|||||||
using cstatic_string = basic_static_string<50, char, cxper_char_traits>;
|
using cstatic_string = basic_static_string<50, char, cxper_char_traits>;
|
||||||
|
|
||||||
inline
|
inline
|
||||||
constexpr
|
constexpr
|
||||||
bool
|
bool
|
||||||
testConstantEvaluation()
|
testConstantEvaluation()
|
||||||
{
|
{
|
||||||
#ifdef BOOST_STATIC_STRING_CPP20
|
#ifdef BOOST_STATIC_STRING_CPP20
|
||||||
@ -421,7 +421,7 @@ testConstantEvaluation()
|
|||||||
// ends_with
|
// ends_with
|
||||||
a.ends_with('a');
|
a.ends_with('a');
|
||||||
a.ends_with("a");
|
a.ends_with("a");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#elif defined(BOOST_STATIC_STRING_CPP14)
|
#elif defined(BOOST_STATIC_STRING_CPP14)
|
||||||
// c++14 constexpr tests
|
// c++14 constexpr tests
|
||||||
@ -521,17 +521,17 @@ testConstantEvaluation()
|
|||||||
a.compare("a");
|
a.compare("a");
|
||||||
a.compare(0, 1, "a");
|
a.compare(0, 1, "a");
|
||||||
a.compare(0, 1, "a", 1);
|
a.compare(0, 1, "a", 1);
|
||||||
|
|
||||||
// substr
|
// substr
|
||||||
// in gcc 5, a constexpr non-static member function returning the class
|
// in gcc 5, a constexpr non-static member function returning the class
|
||||||
// is a member of causes an ICE
|
// is a member of causes an ICE
|
||||||
#ifndef BOOST_STATIC_STRING_GCC5_BAD_CONSTEXPR
|
#ifndef BOOST_STATIC_STRING_GCC5_BAD_CONSTEXPR
|
||||||
a.substr(0, 1);
|
a.substr(0, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// subview
|
// subview
|
||||||
a.subview(0);
|
a.subview(0);
|
||||||
|
|
||||||
// copy
|
// copy
|
||||||
char k[20]{};
|
char k[20]{};
|
||||||
a.copy(k, 1, 0);
|
a.copy(k, 1, 0);
|
||||||
@ -596,9 +596,9 @@ testConstantEvaluation()
|
|||||||
return true;
|
return true;
|
||||||
#elif defined(BOOST_STATIC_STRING_CPP11)
|
#elif defined(BOOST_STATIC_STRING_CPP11)
|
||||||
// c++11 constexpr tests
|
// c++11 constexpr tests
|
||||||
return (cstatic_string().size() +
|
return (cstatic_string().size() +
|
||||||
cstatic_string().length() +
|
cstatic_string().length() +
|
||||||
cstatic_string().max_size() +
|
cstatic_string().max_size() +
|
||||||
cstatic_string().capacity()) != 0 &&
|
cstatic_string().capacity()) != 0 &&
|
||||||
cstatic_string().empty();
|
cstatic_string().empty();
|
||||||
#endif
|
#endif
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
#include <cctype>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ namespace boost {
|
|||||||
namespace static_strings {
|
namespace static_strings {
|
||||||
|
|
||||||
template class basic_static_string<420, char>;
|
template class basic_static_string<420, char>;
|
||||||
|
|
||||||
using string_view = basic_string_view<char, std::char_traits<char>>;
|
using string_view = basic_string_view<char, std::char_traits<char>>;
|
||||||
|
|
||||||
template <class S>
|
template <class S>
|
||||||
@ -109,7 +110,7 @@ testA(S s, const typename S::value_type* str, typename S::size_type n, S expecte
|
|||||||
return s.append(str, n) == expected;
|
return s.append(str, n) == expected;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sign(int x)
|
sign(int x)
|
||||||
{
|
{
|
||||||
if (x == 0)
|
if (x == 0)
|
||||||
@ -215,7 +216,7 @@ testR(S s, typename S::size_type pos, typename S::size_type n1, const typename S
|
|||||||
// this is a precondition violation for the const_iterator overload
|
// this is a precondition violation for the const_iterator overload
|
||||||
return s.replace(pos, n1, str, n2) == expected;
|
return s.replace(pos, n1, str, n2) == expected;
|
||||||
else
|
else
|
||||||
return s.replace(pos, n1, str, n2) == expected &&
|
return s.replace(pos, n1, str, n2) == expected &&
|
||||||
s0.replace(s0.begin() + pos, s0.begin() + pos + n1, str, str + n2) == expected;
|
s0.replace(s0.begin() + pos, s0.begin() + pos + n1, str, str + n2) == expected;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -398,7 +399,7 @@ testAssignment()
|
|||||||
BOOST_TEST(static_string<3>{}.assign("abc", 3) == "abc");
|
BOOST_TEST(static_string<3>{}.assign("abc", 3) == "abc");
|
||||||
BOOST_TEST(static_string<3>{"*"}.assign("abc", 3) == "abc");
|
BOOST_TEST(static_string<3>{"*"}.assign("abc", 3) == "abc");
|
||||||
BOOST_TEST_THROWS(static_string<1>{}.assign("abc", 3), std::length_error);
|
BOOST_TEST_THROWS(static_string<1>{}.assign("abc", 3), std::length_error);
|
||||||
|
|
||||||
// assign(CharT const* s)
|
// assign(CharT const* s)
|
||||||
BOOST_TEST(static_string<3>{}.assign("abc") == "abc");
|
BOOST_TEST(static_string<3>{}.assign("abc") == "abc");
|
||||||
BOOST_TEST(static_string<3>{"*"}.assign("abc") == "abc");
|
BOOST_TEST(static_string<3>{"*"}.assign("abc") == "abc");
|
||||||
@ -412,7 +413,7 @@ testAssignment()
|
|||||||
BOOST_TEST(static_string<4>{"*"}.assign(cs.begin(), cs.end()) == "abcd");
|
BOOST_TEST(static_string<4>{"*"}.assign(cs.begin(), cs.end()) == "abcd");
|
||||||
BOOST_TEST_THROWS(static_string<2>{"*"}.assign(cs.begin(), cs.end()), std::length_error);
|
BOOST_TEST_THROWS(static_string<2>{"*"}.assign(cs.begin(), cs.end()), std::length_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// assign(std::initializer_list<CharT> ilist)
|
// assign(std::initializer_list<CharT> ilist)
|
||||||
BOOST_TEST(static_string<3>{}.assign({'a', 'b', 'c'}) == "abc");
|
BOOST_TEST(static_string<3>{}.assign({'a', 'b', 'c'}) == "abc");
|
||||||
BOOST_TEST(static_string<3>{"*"}.assign({'a', 'b', 'c'}) == "abc");
|
BOOST_TEST(static_string<3>{"*"}.assign({'a', 'b', 'c'}) == "abc");
|
||||||
@ -450,7 +451,7 @@ testAssignment()
|
|||||||
BOOST_TEST_THROWS(static_string<2>{"**"}.assign(T{}, 6, 3), std::out_of_range);
|
BOOST_TEST_THROWS(static_string<2>{"**"}.assign(T{}, 6, 3), std::out_of_range);
|
||||||
BOOST_TEST_THROWS(static_string<2>{"**"}.assign(T{}, 1, 3), std::length_error);
|
BOOST_TEST_THROWS(static_string<2>{"**"}.assign(T{}, 1, 3), std::length_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---
|
//---
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -471,7 +472,7 @@ testAssignment()
|
|||||||
s3 = s1,
|
s3 = s1,
|
||||||
std::length_error);
|
std::length_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
static_string<3> s1;
|
static_string<3> s1;
|
||||||
s1 = "123";
|
s1 = "123";
|
||||||
@ -685,7 +686,7 @@ testElements()
|
|||||||
BOOST_TEST(static_string<3>{"abc"}.at(2) == 'c');
|
BOOST_TEST(static_string<3>{"abc"}.at(2) == 'c');
|
||||||
BOOST_TEST_THROWS(static_string<3>{""}.at(0), std::out_of_range);
|
BOOST_TEST_THROWS(static_string<3>{""}.at(0), std::out_of_range);
|
||||||
BOOST_TEST_THROWS(static_string<3>{"abc"}.at(4), std::out_of_range);
|
BOOST_TEST_THROWS(static_string<3>{"abc"}.at(4), std::out_of_range);
|
||||||
|
|
||||||
// at(size_type pos) const
|
// at(size_type pos) const
|
||||||
BOOST_TEST(cfs3{"abc"}.at(0) == 'a');
|
BOOST_TEST(cfs3{"abc"}.at(0) == 'a');
|
||||||
BOOST_TEST(cfs3{"abc"}.at(2) == 'c');
|
BOOST_TEST(cfs3{"abc"}.at(2) == 'c');
|
||||||
@ -716,7 +717,7 @@ testElements()
|
|||||||
BOOST_TEST(static_string<3>{"a"}.back() == 'a');
|
BOOST_TEST(static_string<3>{"a"}.back() == 'a');
|
||||||
BOOST_TEST(static_string<3>{"abc"}.back() == 'c');
|
BOOST_TEST(static_string<3>{"abc"}.back() == 'c');
|
||||||
|
|
||||||
// back() const
|
// back() const
|
||||||
BOOST_TEST(cfs3{"a"}.back() == 'a');
|
BOOST_TEST(cfs3{"a"}.back() == 'a');
|
||||||
BOOST_TEST(cfs3{"abc"}.back() == 'c');
|
BOOST_TEST(cfs3{"abc"}.back() == 'c');
|
||||||
|
|
||||||
@ -923,7 +924,7 @@ testInsert()
|
|||||||
BOOST_TEST(static_string<4>{"ad"}.insert(1, "bcd", 2) == "abcd");
|
BOOST_TEST(static_string<4>{"ad"}.insert(1, "bcd", 2) == "abcd");
|
||||||
BOOST_TEST_THROWS(static_string<4>{"abc"}.insert(4, "*"), std::out_of_range);
|
BOOST_TEST_THROWS(static_string<4>{"abc"}.insert(4, "*"), std::out_of_range);
|
||||||
BOOST_TEST_THROWS(static_string<3>{"abc"}.insert(1, "*"), std::length_error);
|
BOOST_TEST_THROWS(static_string<3>{"abc"}.insert(1, "*"), std::length_error);
|
||||||
|
|
||||||
// insert(size_type index, string_view_type sv)
|
// insert(size_type index, string_view_type sv)
|
||||||
BOOST_TEST(static_string<3>{"ac"}.insert(1, sv{"b"}) == "abc");
|
BOOST_TEST(static_string<3>{"ac"}.insert(1, sv{"b"}) == "abc");
|
||||||
BOOST_TEST_THROWS(static_string<4>{"abc"}.insert(4, sv{"*"}), std::out_of_range);
|
BOOST_TEST_THROWS(static_string<4>{"abc"}.insert(4, sv{"*"}), std::out_of_range);
|
||||||
@ -1638,7 +1639,7 @@ testInsert()
|
|||||||
BOOST_TEST(testI(S("abcdefghijklmnopqrst"), 21, "12345678901234567890", 20, S("can't happen")));
|
BOOST_TEST(testI(S("abcdefghijklmnopqrst"), 21, "12345678901234567890", 20, S("can't happen")));
|
||||||
}
|
}
|
||||||
|
|
||||||
// done
|
// done
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
testErase()
|
testErase()
|
||||||
@ -1848,6 +1849,51 @@ testErase()
|
|||||||
BOOST_TEST(testE(S("abcdefghijklmnopqrst"), 21, 0, S("can't happen")));
|
BOOST_TEST(testE(S("abcdefghijklmnopqrst"), 21, 0, S("can't happen")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// done
|
||||||
|
static
|
||||||
|
void
|
||||||
|
testEraseIf()
|
||||||
|
{
|
||||||
|
// erase_if(static_string& str, UnaryPredicate pred)
|
||||||
|
|
||||||
|
{
|
||||||
|
static_string<3> s{""};
|
||||||
|
BOOST_TEST(erase_if(s, [](char c) { return c == 'a'; }) == 0);
|
||||||
|
BOOST_TEST(s == "");
|
||||||
|
BOOST_TEST(*s.end() == 0);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
static_string<3> s{"aaa"};
|
||||||
|
BOOST_TEST(erase_if(s, [](char c) { return c == 'a'; }) == 3);
|
||||||
|
BOOST_TEST(s == "");
|
||||||
|
BOOST_TEST(*s.end() == 0);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
static_string<3> s{"abc"};
|
||||||
|
BOOST_TEST(erase_if(s, [](char c) { return c == 'a'; }) == 1);
|
||||||
|
BOOST_TEST(s == "bc");
|
||||||
|
BOOST_TEST(*s.end() == 0);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
static_string<3> s{"abc"};
|
||||||
|
BOOST_TEST(erase_if(s, [](char c) { return c == 'b'; }) == 1);
|
||||||
|
BOOST_TEST(s == "ac");
|
||||||
|
BOOST_TEST(*s.end() == 0);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
static_string<3> s{"abc"};
|
||||||
|
BOOST_TEST(erase_if(s, [](char c) { return c == 'c'; }) == 1);
|
||||||
|
BOOST_TEST(s == "ab");
|
||||||
|
BOOST_TEST(*s.end() == 0);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
static_string<3> s{"abc"};
|
||||||
|
BOOST_TEST(erase_if(s, [](char c) { return c == 'd'; }) == 0);
|
||||||
|
BOOST_TEST(s == "abc");
|
||||||
|
BOOST_TEST(*s.end() == 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// done
|
// done
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
@ -3708,7 +3754,7 @@ testToStaticString()
|
|||||||
BOOST_TEST(testTS(std::numeric_limits<unsigned long long>::max()));
|
BOOST_TEST(testTS(std::numeric_limits<unsigned long long>::max()));
|
||||||
BOOST_TEST(testTS(std::numeric_limits<long double>::min()));
|
BOOST_TEST(testTS(std::numeric_limits<long double>::min()));
|
||||||
BOOST_TEST(testTS(std::numeric_limits<float>::min()));
|
BOOST_TEST(testTS(std::numeric_limits<float>::min()));
|
||||||
|
|
||||||
// these tests technically are not portable, but they will work
|
// these tests technically are not portable, but they will work
|
||||||
// 99% of the time.
|
// 99% of the time.
|
||||||
{
|
{
|
||||||
@ -4090,7 +4136,7 @@ testFind()
|
|||||||
|
|
||||||
BOOST_TEST(fs1.rfind(cs1, 0) == 0);
|
BOOST_TEST(fs1.rfind(cs1, 0) == 0);
|
||||||
BOOST_TEST(fs1.rfind(cs2, 0) == S::npos);
|
BOOST_TEST(fs1.rfind(cs2, 0) == S::npos);
|
||||||
|
|
||||||
BOOST_TEST(fs1.rfind(cs2, 0, 2) == S::npos);
|
BOOST_TEST(fs1.rfind(cs2, 0, 2) == S::npos);
|
||||||
BOOST_TEST(fs1.rfind(cs1, 4) == 0);
|
BOOST_TEST(fs1.rfind(cs1, 4) == 0);
|
||||||
|
|
||||||
@ -5068,7 +5114,7 @@ testFind()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// find_first_not_of
|
// find_first_not_of
|
||||||
|
|
||||||
const char* cs3 = "12456";
|
const char* cs3 = "12456";
|
||||||
@ -5917,7 +5963,7 @@ testReplace()
|
|||||||
std::stringstream a("defghi");
|
std::stringstream a("defghi");
|
||||||
static_string<30> b = "abcabcdefjklmnop";
|
static_string<30> b = "abcabcdefjklmnop";
|
||||||
BOOST_TEST(b.replace(b.begin() + 3, b.begin() + 9,
|
BOOST_TEST(b.replace(b.begin() + 3, b.begin() + 9,
|
||||||
std::istream_iterator<char>(a),
|
std::istream_iterator<char>(a),
|
||||||
std::istream_iterator<char>()) ==
|
std::istream_iterator<char>()) ==
|
||||||
"abcdefghijklmnop");
|
"abcdefghijklmnop");
|
||||||
}
|
}
|
||||||
@ -6130,7 +6176,7 @@ testReplace()
|
|||||||
BOOST_TEST(testR(S("abcde"), 5, 1, 5, '2', S("abcde22222")));
|
BOOST_TEST(testR(S("abcde"), 5, 1, 5, '2', S("abcde22222")));
|
||||||
BOOST_TEST(testR(S("abcde"), 5, 1, 10, '2', S("abcde2222222222")));
|
BOOST_TEST(testR(S("abcde"), 5, 1, 10, '2', S("abcde2222222222")));
|
||||||
BOOST_TEST(testR(S("abcde"), 5, 1, 20, '2', S("abcde22222222222222222222")));
|
BOOST_TEST(testR(S("abcde"), 5, 1, 20, '2', S("abcde22222222222222222222")));
|
||||||
|
|
||||||
BOOST_TEST(testR(S("abcde"), 0, 4, "12345", 4, S("1234e")));
|
BOOST_TEST(testR(S("abcde"), 0, 4, "12345", 4, S("1234e")));
|
||||||
BOOST_TEST(testR(S("abcde"), 0, 4, "12345", 5, S("12345e")));
|
BOOST_TEST(testR(S("abcde"), 0, 4, "12345", 5, S("12345e")));
|
||||||
BOOST_TEST(testR(S("abcde"), 0, 4, "1234567890", 0, S("e")));
|
BOOST_TEST(testR(S("abcde"), 0, 4, "1234567890", 0, S("e")));
|
||||||
@ -7159,18 +7205,19 @@ runTests()
|
|||||||
static_cast<void>(cxper);
|
static_cast<void>(cxper);
|
||||||
|
|
||||||
testConstruct();
|
testConstruct();
|
||||||
|
|
||||||
testAssignment();
|
testAssignment();
|
||||||
|
|
||||||
testElements();
|
testElements();
|
||||||
|
|
||||||
testIterators();
|
testIterators();
|
||||||
|
|
||||||
testCapacity();
|
testCapacity();
|
||||||
|
|
||||||
testClear();
|
testClear();
|
||||||
testInsert();
|
testInsert();
|
||||||
testErase();
|
testErase();
|
||||||
|
testEraseIf();
|
||||||
testPushBack();
|
testPushBack();
|
||||||
testPopBack();
|
testPopBack();
|
||||||
testAppend();
|
testAppend();
|
||||||
|
Reference in New Issue
Block a user