├── doc ├── basic-bootstrap │ ├── theme.conf │ └── README ├── _static │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ └── breathe.css ├── contents.rst ├── bootstrap │ ├── mixins │ │ ├── center-block.less │ │ ├── text-emphasis.less │ │ ├── size.less │ │ ├── opacity.less │ │ ├── background-variant.less │ │ ├── text-overflow.less │ │ ├── tab-focus.less │ │ ├── resize.less │ │ ├── labels.less │ │ ├── progress-bar.less │ │ ├── reset-filter.less │ │ ├── nav-divider.less │ │ ├── alerts.less │ │ ├── nav-vertical-align.less │ │ ├── responsive-visibility.less │ │ ├── pagination.less │ │ ├── border-radius.less │ │ ├── panels.less │ │ ├── list-group.less │ │ ├── hide-text.less │ │ ├── clearfix.less │ │ ├── table-row.less │ │ ├── image.less │ │ ├── buttons.less │ │ ├── forms.less │ │ ├── grid-framework.less │ │ ├── grid.less │ │ └── gradients.less │ ├── wells.less │ ├── breadcrumbs.less │ ├── responsive-embed.less │ ├── component-animations.less │ ├── close.less │ ├── thumbnails.less │ ├── utilities.less │ ├── media.less │ ├── pager.less │ ├── jumbotron.less │ ├── mixins.less │ ├── bootstrap.less │ ├── labels.less │ ├── badges.less │ ├── code.less │ ├── grid.less │ ├── alerts.less │ ├── progress-bars.less │ ├── pagination.less │ ├── print.less │ ├── tooltip.less │ ├── list-group.less │ ├── scaffolding.less │ ├── popovers.less │ ├── modals.less │ ├── buttons.less │ ├── input-groups.less │ ├── responsive-utilities.less │ ├── tables.less │ ├── dropdowns.less │ ├── navs.less │ ├── carousel.less │ └── button-groups.less ├── CMakeLists.txt ├── fmt.less ├── _templates │ ├── search.html │ └── layout.html ├── usage.rst └── build.py ├── support ├── rtd │ ├── theme │ │ ├── theme.conf │ │ └── layout.html │ ├── index.rst │ └── conf.py ├── README ├── cmake │ ├── fmt-config.cmake.in │ ├── FindSetEnv.cmake │ ├── run-cmake.bat │ └── cxx11.cmake ├── appveyor.yml ├── update-converity-branch.py ├── appveyor-build.py ├── rst2md.py └── travis-build.py ├── test ├── header-only-test.cc ├── header-only-test2.cc ├── find-package-test │ ├── main.cc │ └── CMakeLists.txt ├── add-subdirectory-test │ ├── main.cc │ └── CMakeLists.txt ├── assert-test.cc ├── string-test.cc ├── test-assert.h ├── custom-formatter-test.cc ├── util.cc ├── test-main.cc ├── compile-test │ └── CMakeLists.txt ├── posix-mock.h ├── mock-allocator.h ├── util.h ├── gtest-extra.cc ├── macro-test.cc └── format-impl-test.cc ├── cppformat ├── posix.h └── format.h ├── .gitignore ├── Android.mk ├── .travis.yml ├── fmt ├── ostream.cc ├── time.h ├── string.h ├── ostream.h └── CMakeLists.txt ├── LICENSE.rst └── CMakeLists.txt /doc/basic-bootstrap/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | -------------------------------------------------------------------------------- /support/rtd/theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | -------------------------------------------------------------------------------- /test/header-only-test.cc: -------------------------------------------------------------------------------- 1 | // Header-only configuration test 2 | 3 | #include "fmt/format.h" 4 | -------------------------------------------------------------------------------- /support/README: -------------------------------------------------------------------------------- 1 | This directory contains build support files such as 2 | 3 | * CMake modules 4 | * Build scripts 5 | -------------------------------------------------------------------------------- /cppformat/posix.h: -------------------------------------------------------------------------------- 1 | #include "../fmt/posix.h" 2 | #warning Including cppformat/posix.h is deprecated. Include fmt/posix.h instead. 3 | -------------------------------------------------------------------------------- /test/header-only-test2.cc: -------------------------------------------------------------------------------- 1 | // Additional translation unit for the header-only configuration test 2 | 3 | #include "fmt/format.h" 4 | -------------------------------------------------------------------------------- /cppformat/format.h: -------------------------------------------------------------------------------- 1 | #include "../fmt/format.h" 2 | #warning Including cppformat/format.h is deprecated. Include fmt/format.h instead. 3 | -------------------------------------------------------------------------------- /support/rtd/index.rst: -------------------------------------------------------------------------------- 1 | If you are not redirected automatically, follow the 2 | `link to the fmt documentation `_. 3 | -------------------------------------------------------------------------------- /doc/_static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scslab/fmt/master/doc/_static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /doc/_static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scslab/fmt/master/doc/_static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /doc/_static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scslab/fmt/master/doc/_static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /doc/contents.rst: -------------------------------------------------------------------------------- 1 | ######## 2 | Contents 3 | ######## 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | usage 9 | api 10 | syntax 11 | -------------------------------------------------------------------------------- /support/cmake/fmt-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake) 4 | check_required_components(fmt) 5 | -------------------------------------------------------------------------------- /support/rtd/conf.py: -------------------------------------------------------------------------------- 1 | # Sphinx configuration for readthedocs. 2 | 3 | import os, sys 4 | 5 | master_doc = 'index' 6 | html_theme = 'theme' 7 | html_theme_path = ["."] 8 | -------------------------------------------------------------------------------- /doc/basic-bootstrap/README: -------------------------------------------------------------------------------- 1 | Sphinx basic theme with Bootstrap support. Modifications are kept to 2 | a minimum to simplify integration in case of changes to Sphinx theming. 3 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover { 6 | color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/find-package-test/main.cc: -------------------------------------------------------------------------------- 1 | #include "fmt/format.h" 2 | 3 | int main(int argc, char** argv) { 4 | for(int i = 0; i < argc; ++i) 5 | fmt::print("{}: {}\n", i, argv[i]); 6 | } 7 | -------------------------------------------------------------------------------- /test/add-subdirectory-test/main.cc: -------------------------------------------------------------------------------- 1 | #include "fmt/format.h" 2 | 3 | int main(int argc, char** argv) { 4 | for(int i = 0; i < argc; ++i) 5 | fmt::print("{}: {}\n", i, argv[i]); 6 | } 7 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover { 6 | background-color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | /_CPack_Packages 3 | /doc/doxyxml 4 | /doc/html 5 | virtualenv 6 | /Testing 7 | /install_manifest.txt 8 | *~ 9 | *.a 10 | *.so* 11 | *.zip 12 | cmake_install.cmake 13 | CPack*.cmake 14 | fmt-*.cmake 15 | CTestTestfile.cmake 16 | CMakeCache.txt 17 | CMakeFiles 18 | Makefile 19 | run-msbuild.bat 20 | -------------------------------------------------------------------------------- /support/cmake/FindSetEnv.cmake: -------------------------------------------------------------------------------- 1 | # A CMake script to find SetEnv.cmd. 2 | 3 | find_program(WINSDK_SETENV NAMES SetEnv.cmd 4 | PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/bin") 5 | if (WINSDK_SETENV AND PRINT_PATH) 6 | execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${WINSDK_SETENV}") 7 | endif () 8 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_MODULE := fmt_static 5 | LOCAL_MODULE_FILENAME := libfmt 6 | 7 | LOCAL_SRC_FILES := fmt/format.cc 8 | 9 | LOCAL_C_INCLUDES := $(LOCAL_PATH) 10 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 11 | 12 | LOCAL_CFLAGS += -std=c++11 -fexceptions 13 | 14 | include $(BUILD_STATIC_LIBRARY) 15 | 16 | -------------------------------------------------------------------------------- /test/find-package-test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.12) 2 | 3 | project(fmt-test) 4 | 5 | find_package(FMT REQUIRED) 6 | 7 | add_executable(library-test main.cc) 8 | target_link_libraries(library-test fmt) 9 | 10 | if (TARGET fmt-header-only) 11 | add_executable(header-only-test main.cc) 12 | target_link_libraries(header-only-test fmt-header-only) 13 | endif () 14 | -------------------------------------------------------------------------------- /test/add-subdirectory-test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.12) 2 | 3 | project(fmt-test) 4 | 5 | add_subdirectory(../.. fmt) 6 | 7 | add_executable(library-test "main.cc") 8 | target_link_libraries(library-test fmt) 9 | 10 | if (TARGET fmt-header-only) 11 | add_executable(header-only-test "main.cc") 12 | target_link_libraries(header-only-test fmt-header-only) 13 | endif () 14 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_program(DOXYGEN doxygen) 2 | if (NOT DOXYGEN) 3 | message(STATUS "Target 'doc' disabled (requires doxygen)") 4 | return () 5 | endif () 6 | 7 | add_custom_target(doc 8 | COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.py ${FMT_VERSION} 9 | SOURCES build.py conf.py _templates/layout.html) 10 | 11 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ 12 | DESTINATION share/doc/fmt OPTIONAL) 13 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /support/cmake/run-cmake.bat: -------------------------------------------------------------------------------- 1 | @echo on 2 | rem This scripts configures build environment and runs CMake. 3 | rem Use it instead of running CMake directly when building with 4 | rem the Microsoft SDK toolchain rather than Visual Studio. 5 | rem It is used in the same way as cmake, for example: 6 | rem 7 | rem run-cmake -G "Visual Studio 10 Win64" . 8 | 9 | for /F "delims=" %%i IN ('cmake "-DPRINT_PATH=1" -P %~dp0/FindSetEnv.cmake') DO set setenv=%%i 10 | if NOT "%setenv%" == "" call "%setenv%" 11 | cmake %* 12 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /support/rtd/theme/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "basic/layout.html" %} 2 | 3 | {% block extrahead %} 4 | 5 | 6 | 9 | Page Redirection 10 | {% endblock %} 11 | 12 | {% block document %} 13 | If you are not redirected automatically, follow the link to the fmt documentation. 14 | {% endblock %} 15 | 16 | {% block footer %} 17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /doc/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /doc/_static/breathe.css: -------------------------------------------------------------------------------- 1 | 2 | /* -- breathe specific styles ----------------------------------------------- */ 3 | 4 | /* So enum value descriptions are displayed inline to the item */ 5 | .breatheenumvalues li tt + p { 6 | display: inline; 7 | } 8 | 9 | /* So parameter descriptions are displayed inline to the item */ 10 | .breatheparameterlist li tt + p { 11 | display: inline; 12 | } 13 | 14 | .container .breathe-sectiondef { 15 | width: inherit; 16 | } 17 | 18 | .github-btn { 19 | border: 0; 20 | overflow: hidden; 21 | } 22 | 23 | .jumbotron { 24 | background-size: 100% 4px; 25 | background-repeat: repeat-y; 26 | color: white; 27 | text-align: center; 28 | } 29 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /doc/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /doc/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /support/appveyor.yml: -------------------------------------------------------------------------------- 1 | configuration: 2 | - Debug 3 | - Release 4 | 5 | environment: 6 | CTEST_OUTPUT_ON_FAILURE: 1 7 | matrix: 8 | - BUILD: msvc 9 | - BUILD: msvc 10 | PLATFORM: x64 11 | - BUILD: mingw 12 | 13 | before_build: 14 | # Workaround for CMake not wanting sh.exe on PATH for MinGW. 15 | - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% 16 | 17 | build_script: 18 | - python support/appveyor-build.py 19 | 20 | on_failure: 21 | - appveyor PushArtifact Testing/Temporary/LastTest.log 22 | - appveyor AddTest test 23 | 24 | # Uncomment this to debug AppVeyor failures. 25 | #on_finish: 26 | # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | sudo: required # the doc target uses sudo to install dependencies 3 | 4 | os: 5 | - linux 6 | - osx 7 | 8 | env: 9 | global: 10 | - secure: |- 11 | Gsnp9ERFnXt+diCfc7Vb72g+7HDn1MCHvw4zfUDdoBh9bxxFlLQRlzZZfwWhzni57lflrt 12 | 0QHXafu+oBVOJuNv6WauV3+ZyuWIQRmNGjZFNLvZsXHK/dyad2vGQBPvEkb+8l/aCyTpbr 13 | 6pxmyzLHSn1ZR7OX5rfPvwM3tOyZ3H0= 14 | matrix: 15 | - BUILD=Doc 16 | - BUILD=Debug STANDARD=0x 17 | - BUILD=Release STANDARD=98 18 | - BUILD=Release STANDARD=0x 19 | 20 | matrix: 21 | exclude: 22 | - os: osx 23 | env: BUILD=Doc 24 | 25 | addons: 26 | apt: 27 | sources: 28 | - kubuntu-backports # cmake 2.8.12 29 | packages: 30 | - cmake 31 | 32 | script: 33 | - support/travis-build.py 34 | -------------------------------------------------------------------------------- /doc/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition-property(~"height, visibility"); 31 | .transition-duration(.35s); 32 | .transition-timing-function(ease); 33 | } 34 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /doc/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /doc/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /doc/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /doc/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | } 23 | 24 | .media-right, 25 | .media > .pull-right { 26 | padding-left: 10px; 27 | } 28 | 29 | .media-left, 30 | .media > .pull-left { 31 | padding-right: 10px; 32 | } 33 | 34 | .media-left, 35 | .media-right, 36 | .media-body { 37 | display: table-cell; 38 | vertical-align: top; 39 | } 40 | 41 | .media-middle { 42 | vertical-align: middle; 43 | } 44 | 45 | .media-bottom { 46 | vertical-align: bottom; 47 | } 48 | 49 | // Reset margins on headings for tighter default spacing 50 | .media-heading { 51 | margin-top: 0; 52 | margin-bottom: 5px; 53 | } 54 | 55 | // Media list variation 56 | // 57 | // Undo default ul/ol styles 58 | .media-list { 59 | padding-left: 0; 60 | list-style: none; 61 | } 62 | -------------------------------------------------------------------------------- /support/update-converity-branch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Update the coverity branch from the master branch. 3 | # It is not done automatically because Coverity Scan limits 4 | # the number of submissions per day. 5 | 6 | from __future__ import print_function 7 | import shutil, tempfile 8 | from subprocess import check_output, STDOUT 9 | 10 | class Git: 11 | def __init__(self, dir): 12 | self.dir = dir 13 | 14 | def __call__(self, *args): 15 | output = check_output(['git'] + list(args), cwd=self.dir, stderr=STDOUT) 16 | print(output) 17 | return output 18 | 19 | dir = tempfile.mkdtemp() 20 | try: 21 | git = Git(dir) 22 | git('clone', '-b', 'coverity', 'git@github.com:fmtlib/fmt.git', dir) 23 | output = git('merge', '-X', 'theirs', '--no-commit', 'origin/master') 24 | if 'Fast-forward' not in output: 25 | git('reset', 'HEAD', '.travis.yml') 26 | git('checkout', '--', '.travis.yml') 27 | git('commit', '-m', 'Update coverity branch') 28 | git('push') 29 | finally: 30 | shutil.rmtree(dir) 31 | -------------------------------------------------------------------------------- /doc/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /doc/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding (@jumbotron-padding / 2); 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | 17 | p { 18 | margin-bottom: (@jumbotron-padding / 2); 19 | font-size: @jumbotron-font-size; 20 | font-weight: 200; 21 | } 22 | 23 | > hr { 24 | border-top-color: darken(@jumbotron-bg, 10%); 25 | } 26 | 27 | .tb-container &, 28 | .container-fluid & { 29 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 30 | } 31 | 32 | .tb-container { 33 | max-width: 100%; 34 | } 35 | 36 | @media screen and (min-width: @screen-sm-min) { 37 | padding: (@jumbotron-padding * 1.6) 0; 38 | 39 | .tb-container &, 40 | .container-fluid & { 41 | padding-left: (@jumbotron-padding * 2); 42 | padding-right: (@jumbotron-padding * 2); 43 | } 44 | 45 | h1, 46 | .h1 { 47 | font-size: (@font-size-base * 4.5); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /fmt/ostream.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Formatting library for C++ - std::ostream support 3 | 4 | Copyright (c) 2012 - 2016, Victor Zverovich 5 | All rights reserved. 6 | 7 | For the license information refer to format.h. 8 | */ 9 | 10 | #include "fmt/ostream.h" 11 | #include "fmt/printf.h" 12 | 13 | namespace fmt { 14 | 15 | namespace { 16 | // Write the content of w to os. 17 | void write(std::ostream &os, Writer &w) { 18 | const char *data = w.data(); 19 | typedef internal::MakeUnsigned::Type UnsignedStreamSize; 20 | UnsignedStreamSize size = w.size(); 21 | UnsignedStreamSize max_size = 22 | internal::to_unsigned((std::numeric_limits::max)()); 23 | do { 24 | UnsignedStreamSize n = size <= max_size ? size : max_size; 25 | os.write(data, static_cast(n)); 26 | data += n; 27 | size -= n; 28 | } while (size != 0); 29 | } 30 | } 31 | 32 | FMT_FUNC void print(std::ostream &os, CStringRef format_str, ArgList args) { 33 | MemoryWriter w; 34 | w.write(format_str, args); 35 | write(os, w); 36 | } 37 | 38 | FMT_FUNC int fprintf(std::ostream &os, CStringRef format, ArgList args) { 39 | MemoryWriter w; 40 | printf(w, format, args); 41 | write(os, w); 42 | return static_cast(w.size()); 43 | } 44 | } // namespace fmt 45 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:hover, 12 | &:focus, 13 | &.focus, 14 | &:active, 15 | &.active, 16 | .open > .dropdown-toggle& { 17 | color: @color; 18 | background-color: darken(@background, 10%); 19 | border-color: darken(@border, 12%); 20 | } 21 | &:active, 22 | &.active, 23 | .open > .dropdown-toggle& { 24 | background-image: none; 25 | } 26 | &.disabled, 27 | &[disabled], 28 | fieldset[disabled] & { 29 | &, 30 | &:hover, 31 | &:focus, 32 | &.focus, 33 | &:active, 34 | &.active { 35 | background-color: @background; 36 | border-color: @border; 37 | } 38 | } 39 | 40 | .badge { 41 | color: @background; 42 | background-color: @color; 43 | } 44 | } 45 | 46 | // Button sizes 47 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 48 | padding: @padding-vertical @padding-horizontal; 49 | font-size: @font-size; 50 | line-height: @line-height; 51 | border-radius: @border-radius; 52 | } 53 | -------------------------------------------------------------------------------- /doc/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | @import "tables.less"; 16 | @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | @import "modals.less"; 44 | @import "tooltip.less"; 45 | @import "popovers.less"; 46 | @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /support/appveyor-build.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Build the project on AppVeyor. 3 | 4 | import os 5 | from subprocess import check_call 6 | 7 | build = os.environ['BUILD'] 8 | config = os.environ['CONFIGURATION'] 9 | platform = os.environ.get('PLATFORM') 10 | path = os.environ['PATH'] 11 | cmake_command = ['cmake', '-DFMT_PEDANTIC=ON', '-DCMAKE_BUILD_TYPE=' + config] 12 | if build == 'mingw': 13 | cmake_command.append('-GMinGW Makefiles') 14 | build_command = ['mingw32-make', '-j4'] 15 | test_command = ['mingw32-make', 'test'] 16 | # Remove the path to Git bin directory from $PATH because it breaks 17 | # MinGW config. 18 | path = path.replace(r'C:\Program Files (x86)\Git\bin', '') 19 | os.environ['PATH'] = r'C:\MinGW\bin;' + path 20 | else: 21 | # Add MSBuild 14.0 to PATH as described in 22 | # http://help.appveyor.com/discussions/problems/2229-v140-not-found-on-vs2105rc. 23 | os.environ['PATH'] = r'C:\Program Files (x86)\MSBuild\14.0\Bin;' + path 24 | generator = 'Visual Studio 14 2015' 25 | if platform == 'x64': 26 | generator += ' Win64' 27 | cmake_command.append('-G' + generator) 28 | build_command = ['cmake', '--build', '.', '--config', config, '--', '/m:4'] 29 | test_command = ['ctest', '-C', config] 30 | 31 | check_call(cmake_command) 32 | check_call(build_command) 33 | check_call(test_command) 34 | -------------------------------------------------------------------------------- /doc/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /LICENSE.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2016, Victor Zverovich 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /fmt/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | Formatting library for C++ - time formatting 3 | 4 | Copyright (c) 2012 - 2016, Victor Zverovich 5 | All rights reserved. 6 | 7 | For the license information refer to format.h. 8 | */ 9 | 10 | #ifndef FMT_TIME_H_ 11 | #define FMT_TIME_H_ 12 | 13 | #include "fmt/format.h" 14 | #include 15 | 16 | namespace fmt { 17 | template 18 | void format(BasicFormatter &f, 19 | const char *&format_str, const std::tm &tm) { 20 | if (*format_str == ':') 21 | ++format_str; 22 | const char *end = format_str; 23 | while (*end && *end != '}') 24 | ++end; 25 | if (*end != '}') 26 | FMT_THROW(FormatError("missing '}' in format string")); 27 | internal::MemoryBuffer format; 28 | format.append(format_str, end + 1); 29 | format[format.size() - 1] = '\0'; 30 | Buffer &buffer = f.writer().buffer(); 31 | std::size_t start = buffer.size(); 32 | for (;;) { 33 | std::size_t size = buffer.capacity() - start; 34 | std::size_t count = std::strftime(&buffer[start], size, &format[0], &tm); 35 | if (count != 0) { 36 | buffer.resize(start + count); 37 | break; 38 | } 39 | const std::size_t MIN_GROWTH = 10; 40 | buffer.reserve(buffer.capacity() + size > MIN_GROWTH ? size : MIN_GROWTH); 41 | } 42 | format_str = end + 1; 43 | } 44 | } 45 | 46 | #endif // FMT_TIME_H_ 47 | -------------------------------------------------------------------------------- /doc/fmt.less: -------------------------------------------------------------------------------- 1 | @import 'bootstrap.less'; 2 | 3 | @header-bg: #094d75; 4 | @icon-font-path: "fonts/"; 5 | 6 | html { 7 | overflow-y: scroll; 8 | } 9 | 10 | .navbar { 11 | border-radius: 0; 12 | margin-bottom: 0; 13 | background-color: darken(@header-bg, 10%); 14 | } 15 | 16 | .jumbotron { 17 | #gradient > .vertical(@header-bg; darken(@header-bg, 2%); 50%; 50%); 18 | background-size: 100% 4px; 19 | background-color: @header-bg; 20 | background-repeat: repeat-y; 21 | color: white; 22 | text-align: center; 23 | } 24 | 25 | div.sphinxsidebar { 26 | margin-left: 0; 27 | } 28 | 29 | // Keep content not too wide for better readability. 30 | .navbar-content, .content { 31 | .make-md-column-offset(1); 32 | .make-md-column(10); 33 | .make-lg-column-offset(2); 34 | .make-lg-column(8); 35 | } 36 | 37 | .footer { 38 | padding-top: 20px; 39 | padding-bottom: 20px; 40 | border-top: 1px solid @gray-lighter; 41 | text-align: center; 42 | } 43 | 44 | // Indent descriptions of classes, functions and macros. 45 | .class dd, .function dd, .macro dd { 46 | margin-left: 20px; 47 | } 48 | 49 | // Remove Bootstrap padding for Sphinx containers. 50 | .breathe-sectiondef.container { 51 | padding: 0; 52 | } 53 | 54 | // Remove Bootstrap padding for Sphinx code elements in API signatures. 55 | .descclassname, .descname { 56 | padding: 0; 57 | } 58 | 59 | p.rubric { 60 | margin-top: 10px; 61 | } 62 | 63 | .github-btn { 64 | border: 0; 65 | overflow: hidden; 66 | } 67 | -------------------------------------------------------------------------------- /doc/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs &, 33 | .btn-group-xs > .btn & { 34 | top: 0; 35 | padding: 1px 5px; 36 | } 37 | 38 | // Hover state, but only for links 39 | a& { 40 | &:hover, 41 | &:focus { 42 | color: @badge-link-hover-color; 43 | text-decoration: none; 44 | cursor: pointer; 45 | } 46 | } 47 | 48 | // Account for badges in navs 49 | .list-group-item.active > &, 50 | .nav-pills > .active > a > & { 51 | color: @badge-active-color; 52 | background-color: @badge-active-bg; 53 | } 54 | 55 | .list-group-item > & { 56 | float: right; 57 | } 58 | 59 | .list-group-item > & + & { 60 | margin-right: 5px; 61 | } 62 | 63 | .nav-pills > li > a > & { 64 | margin-left: 3px; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /doc/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /doc/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .tb-container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /doc/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | 22 | // Provide class for links that match alerts 23 | .alert-link { 24 | font-weight: @alert-link-font-weight; 25 | } 26 | 27 | // Improve alignment and spacing of inner content 28 | > p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: (@alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /test/assert-test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Assertion tests 3 | 4 | Copyright (c) 2015, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "fmt/format.h" 29 | #include "gtest/gtest.h" 30 | 31 | #if GTEST_HAS_DEATH_TEST 32 | # define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \ 33 | EXPECT_DEBUG_DEATH(statement, regex) 34 | #else 35 | # define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \ 36 | GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) 37 | #endif 38 | 39 | TEST(AssertTest, Fail) { 40 | EXPECT_DEBUG_DEATH_IF_SUPPORTED(FMT_ASSERT(false, "don't panic!"), "don't panic!"); 41 | } 42 | -------------------------------------------------------------------------------- /test/string-test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Tests of string utilities 3 | 4 | Copyright (c) 2012 - 2016, Victor Zverovich 5 | All rights reserved. 6 | 7 | For the license information refer to format.h. 8 | */ 9 | 10 | #include "fmt/string.h" 11 | #include "gtest/gtest.h" 12 | 13 | using fmt::internal::StringBuffer; 14 | 15 | TEST(StringBufferTest, Empty) { 16 | StringBuffer buffer; 17 | EXPECT_EQ(0, buffer.size()); 18 | EXPECT_EQ(0, buffer.capacity()); 19 | std::string data; 20 | // std::string may have initial capacity. 21 | std::size_t capacity = data.capacity(); 22 | buffer.move_to(data); 23 | EXPECT_EQ("", data); 24 | EXPECT_EQ(capacity, data.capacity()); 25 | } 26 | 27 | TEST(StringBufferTest, Reserve) { 28 | StringBuffer buffer; 29 | std::size_t capacity = std::string().capacity() + 10; 30 | buffer.reserve(capacity); 31 | EXPECT_EQ(0, buffer.size()); 32 | EXPECT_EQ(capacity, buffer.capacity()); 33 | std::string data; 34 | buffer.move_to(data); 35 | EXPECT_EQ("", data); 36 | } 37 | 38 | TEST(StringBufferTest, Resize) { 39 | StringBuffer buffer; 40 | std::size_t size = std::string().capacity() + 10; 41 | buffer.resize(size); 42 | EXPECT_EQ(size, buffer.size()); 43 | EXPECT_EQ(size, buffer.capacity()); 44 | std::string data; 45 | buffer.move_to(data); 46 | EXPECT_EQ(size, data.size()); 47 | } 48 | 49 | TEST(StringBufferTest, MoveTo) { 50 | StringBuffer buffer; 51 | std::size_t size = std::string().capacity() + 10; 52 | buffer.resize(size); 53 | const char *p = &buffer[0]; 54 | std::string data; 55 | buffer.move_to(data); 56 | EXPECT_EQ(p, &data[0]); 57 | EXPECT_EQ(0, buffer.size()); 58 | EXPECT_EQ(0, buffer.capacity()); 59 | } 60 | 61 | TEST(StringWriterTest, MoveTo) { 62 | fmt::StringWriter out; 63 | out << "The answer is " << 42 << "\n"; 64 | std::string s; 65 | out.move_to(s); 66 | EXPECT_EQ("The answer is 42\n", s); 67 | EXPECT_EQ(0, out.size()); 68 | } 69 | 70 | TEST(StringTest, ToString) { 71 | EXPECT_EQ("42", fmt::to_string(42)); 72 | } 73 | -------------------------------------------------------------------------------- /test/test-assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Test version of FMT_ASSERT 3 | 4 | Copyright (c) 2015, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef FMT_TEST_ASSERT_H 29 | #define FMT_TEST_ASSERT_H 30 | 31 | #include 32 | 33 | class AssertionFailure : public std::logic_error { 34 | public: 35 | explicit AssertionFailure(const char *message) : std::logic_error(message) {} 36 | }; 37 | 38 | #define FMT_ASSERT(condition, message) \ 39 | if (!(condition)) throw AssertionFailure(message); 40 | 41 | #include "gtest-extra.h" 42 | 43 | // Expects an assertion failure. 44 | #define EXPECT_ASSERT(stmt, message) \ 45 | EXPECT_THROW_MSG(stmt, AssertionFailure, message) 46 | 47 | #endif // FMT_TEST_ASSERT_H 48 | -------------------------------------------------------------------------------- /doc/_templates/search.html: -------------------------------------------------------------------------------- 1 | {# 2 | basic/search.html 3 | ~~~~~~~~~~~~~~~~~ 4 | 5 | Template for the search page. 6 | 7 | :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 | :license: BSD, see LICENSE for details. 9 | #} 10 | {%- extends "layout.html" %} 11 | {% set title = _('Search') %} 12 | {% set script_files = script_files + ['_static/searchtools.js'] %} 13 | {% block extrahead %} 14 | 17 | {# this is used when loading the search index using $.ajax fails, 18 | such as on Chrome for documents on localhost #} 19 | 20 | {{ super() }} 21 | {% endblock %} 22 | {% block body %} 23 |

{{ _('Search') }}

24 |
25 | 26 |

27 | {% trans %}Please activate JavaScript to enable the search 28 | functionality.{% endtrans %} 29 |

30 |
31 |

32 | {% trans %}From here you can search these documents. Enter your search 33 | words into the box below and click "search". Note that the search 34 | function will automatically search for all of the words. Pages 35 | containing fewer words won't appear in the result list.{% endtrans %} 36 |

37 | {{ searchform('form-inline', True) }} 38 | {% if search_performed %} 39 |

{{ _('Search Results') }}

40 | {% if not search_results %} 41 |

{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}

42 | {% endif %} 43 | {% endif %} 44 |
45 | {% if search_results %} 46 |
    47 | {% for href, caption, context in search_results %} 48 |
  • {{ caption }} 49 |
    {{ context|e }}
    50 |
  • 51 | {% endfor %} 52 |
53 | {% endif %} 54 |
55 | {% endblock %} 56 | -------------------------------------------------------------------------------- /doc/bootstrap/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: @line-height-computed; 29 | margin-bottom: @line-height-computed; 30 | background-color: @progress-bg; 31 | border-radius: @progress-border-radius; 32 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: @font-size-small; 41 | line-height: @line-height-computed; 42 | color: @progress-bar-color; 43 | text-align: center; 44 | background-color: @progress-bar-bg; 45 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | .transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | #gradient > .striped(); 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | .animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | .progress-bar-variant(@progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | .progress-bar-variant(@progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | .progress-bar-variant(@progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | .progress-bar-variant(@progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /test/custom-formatter-test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Custom argument formatter tests 3 | 4 | Copyright (c) 2016, Victor Zverovich 5 | All rights reserved. 6 | 7 | For the license information refer to format.h. 8 | */ 9 | 10 | #include "fmt/printf.h" 11 | #include "gtest-extra.h" 12 | 13 | using fmt::internal::BasicPrintfArgFormatter; 14 | 15 | // A custom argument formatter that doesn't print `-` for floating-point values 16 | // rounded to 0. 17 | class CustomArgFormatter 18 | : public fmt::BasicArgFormatter { 19 | public: 20 | CustomArgFormatter(fmt::BasicFormatter &f, 21 | fmt::FormatSpec &s, const char *fmt) 22 | : fmt::BasicArgFormatter(f, s, fmt) {} 23 | 24 | void visit_double(double value) { 25 | if (round(value * pow(10, spec().precision())) == 0) 26 | value = 0; 27 | fmt::BasicArgFormatter::visit_double(value); 28 | } 29 | }; 30 | 31 | // A custom argument formatter that doesn't print `-` for floating-point values 32 | // rounded to 0. 33 | class CustomPAF : public BasicPrintfArgFormatter { 34 | public: 35 | CustomPAF(fmt::BasicWriter &writer, fmt::FormatSpec &spec) 36 | : BasicPrintfArgFormatter(writer, spec) {} 37 | 38 | void visit_double(double value) { 39 | if (round(value * pow(10, spec().precision())) == 0) 40 | value = 0; 41 | BasicPrintfArgFormatter::visit_double(value); 42 | } 43 | }; 44 | 45 | std::string custom_format(const char *format_str, fmt::ArgList args) { 46 | fmt::MemoryWriter writer; 47 | // Pass custom argument formatter as a template arg to BasicFormatter. 48 | fmt::BasicFormatter formatter(args, writer); 49 | formatter.format(format_str); 50 | return writer.str(); 51 | } 52 | FMT_VARIADIC(std::string, custom_format, const char *) 53 | 54 | std::string custom_sprintf(const char* fstr, fmt::ArgList args){ 55 | fmt::MemoryWriter writer; 56 | fmt::internal::PrintfFormatter< char, CustomPAF > pfer( args); 57 | pfer.format(writer, fstr); 58 | return writer.str(); 59 | } 60 | FMT_VARIADIC(std::string, custom_sprintf, const char*); 61 | 62 | TEST(CustomFormatterTest, Format) { 63 | EXPECT_EQ("0.00", custom_format("{:.2f}", -.00001)); 64 | EXPECT_EQ("0.00", custom_sprintf("%.2f", -.00001)); 65 | } 66 | -------------------------------------------------------------------------------- /doc/bootstrap/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | color: @pagination-hover-color; 44 | background-color: @pagination-hover-bg; 45 | border-color: @pagination-hover-border; 46 | } 47 | } 48 | 49 | > .active > a, 50 | > .active > span { 51 | &, 52 | &:hover, 53 | &:focus { 54 | z-index: 2; 55 | color: @pagination-active-color; 56 | background-color: @pagination-active-bg; 57 | border-color: @pagination-active-border; 58 | cursor: default; 59 | } 60 | } 61 | 62 | > .disabled { 63 | > span, 64 | > span:hover, 65 | > span:focus, 66 | > a, 67 | > a:hover, 68 | > a:focus { 69 | color: @pagination-disabled-color; 70 | background-color: @pagination-disabled-bg; 71 | border-color: @pagination-disabled-border; 72 | cursor: @cursor-disabled; 73 | } 74 | } 75 | } 76 | 77 | // Sizing 78 | // -------------------------------------------------- 79 | 80 | // Large 81 | .pagination-lg { 82 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large); 83 | } 84 | 85 | // Small 86 | .pagination-sm { 87 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small); 88 | } 89 | -------------------------------------------------------------------------------- /test/util.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Test utilities. 3 | 4 | Copyright (c) 2012-2014, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "util.h" 29 | #include 30 | 31 | void increment(char *s) { 32 | for (int i = static_cast(std::strlen(s)) - 1; i >= 0; --i) { 33 | if (s[i] != '9') { 34 | ++s[i]; 35 | break; 36 | } 37 | s[i] = '0'; 38 | } 39 | } 40 | 41 | std::string get_system_error(int error_code) { 42 | #if defined(__MINGW32__) || !defined(_WIN32) 43 | return strerror(error_code); 44 | #else 45 | enum { BUFFER_SIZE = 200 }; 46 | char buffer[BUFFER_SIZE]; 47 | if (strerror_s(buffer, BUFFER_SIZE, error_code)) 48 | throw std::exception("strerror_s failed"); 49 | return buffer; 50 | #endif 51 | } 52 | 53 | const char *const FILE_CONTENT = "Don't panic!"; 54 | 55 | fmt::BufferedFile open_buffered_file(FILE **fp) { 56 | fmt::File read_end, write_end; 57 | fmt::File::pipe(read_end, write_end); 58 | write_end.write(FILE_CONTENT, std::strlen(FILE_CONTENT)); 59 | write_end.close(); 60 | fmt::BufferedFile f = read_end.fdopen("r"); 61 | if (fp) 62 | *fp = f.get(); 63 | return f; 64 | } 65 | -------------------------------------------------------------------------------- /support/cmake/cxx11.cmake: -------------------------------------------------------------------------------- 1 | # C++11 feature support detection 2 | 3 | if (NOT FMT_USE_CPP11) 4 | return() 5 | endif () 6 | 7 | include(CheckCXXCompilerFlag) 8 | 9 | if (FMT_USE_CPP11) 10 | check_cxx_compiler_flag(-std=c++11 HAVE_STD_CPP11_FLAG) 11 | if (HAVE_STD_CPP11_FLAG) 12 | # Check if including cmath works with -std=c++11 and -O3. 13 | # It may not in MinGW due to bug http://ehc.ac/p/mingw/bugs/2250/. 14 | set(CMAKE_REQUIRED_FLAGS "-std=c++11 -O3") 15 | check_cxx_source_compiles(" 16 | #include 17 | int main() {}" FMT_CPP11_CMATH) 18 | # Check if including works with -std=c++11. 19 | # It may not in MinGW due to bug http://sourceforge.net/p/mingw/bugs/2024/. 20 | check_cxx_source_compiles(" 21 | #include 22 | int main() {}" FMT_CPP11_UNISTD_H) 23 | if (FMT_CPP11_CMATH AND FMT_CPP11_UNISTD_H) 24 | set(CPP11_FLAG -std=c++11) 25 | else () 26 | check_cxx_compiler_flag(-std=gnu++11 HAVE_STD_GNUPP11_FLAG) 27 | if (HAVE_STD_CPP11_FLAG) 28 | set(CPP11_FLAG -std=gnu++11) 29 | endif () 30 | endif () 31 | set(CMAKE_REQUIRED_FLAGS ) 32 | else () 33 | check_cxx_compiler_flag(-std=c++0x HAVE_STD_CPP0X_FLAG) 34 | if (HAVE_STD_CPP0X_FLAG) 35 | set(CPP11_FLAG -std=c++0x) 36 | endif () 37 | endif () 38 | endif () 39 | 40 | set(CMAKE_REQUIRED_FLAGS ${CPP11_FLAG}) 41 | 42 | # Check if variadic templates are working and not affected by GCC bug 39653: 43 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39653 44 | check_cxx_source_compiles(" 45 | template 46 | struct S { typedef typename S::type type; }; 47 | int main() {}" SUPPORTS_VARIADIC_TEMPLATES) 48 | 49 | # Check if initializer lists are supported. 50 | check_cxx_source_compiles(" 51 | #include 52 | int main() {}" SUPPORTS_INITIALIZER_LIST) 53 | 54 | # Check if enum bases are available 55 | check_cxx_source_compiles(" 56 | enum C : char {A}; 57 | int main() {}" 58 | SUPPORTS_ENUM_BASE) 59 | 60 | # Check if type traits are available 61 | check_cxx_source_compiles(" 62 | #include 63 | class C { void operator=(const C&); }; 64 | int main() { static_assert(!std::is_copy_assignable::value, \"\"); }" 65 | SUPPORTS_TYPE_TRAITS) 66 | 67 | # Check if user-defined literals are available 68 | check_cxx_source_compiles(" 69 | void operator\"\" _udl(long double); 70 | int main() {}" 71 | SUPPORTS_USER_DEFINED_LITERALS) 72 | 73 | set(CMAKE_REQUIRED_FLAGS ) 74 | -------------------------------------------------------------------------------- /test/test-main.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Test main function. 3 | 4 | Copyright (c) 2012-2014, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | #include 30 | 31 | #ifdef _WIN32 32 | # include 33 | #endif 34 | 35 | #ifdef _MSC_VER 36 | # include 37 | #else 38 | # define _CrtSetReportFile(a, b) 39 | # define _CrtSetReportMode(a, b) 40 | #endif 41 | 42 | int main(int argc, char **argv) { 43 | #ifdef _WIN32 44 | // Don't display any error dialogs. This also suppresses message boxes 45 | // on assertion failures in MinGW where _set_error_mode/CrtSetReportMode 46 | // doesn't help. 47 | SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | 48 | SEM_NOOPENFILEERRORBOX); 49 | #endif 50 | // Disable message boxes on assertion failures. 51 | _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); 52 | _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); 53 | _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); 54 | _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); 55 | try { 56 | testing::InitGoogleTest(&argc, argv); 57 | return RUN_ALL_TESTS(); 58 | } catch (...) { 59 | // Catch all exceptions to make Coverity happy. 60 | } 61 | return EXIT_FAILURE; 62 | } 63 | -------------------------------------------------------------------------------- /doc/bootstrap/print.less: -------------------------------------------------------------------------------- 1 | /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ 2 | 3 | // ========================================================================== 4 | // Print styles. 5 | // Inlined to avoid the additional HTTP request: h5bp.com/r 6 | // ========================================================================== 7 | 8 | @media print { 9 | *, 10 | *:before, 11 | *:after { 12 | background: transparent !important; 13 | color: #000 !important; // Black prints faster: h5bp.com/s 14 | box-shadow: none !important; 15 | text-shadow: none !important; 16 | } 17 | 18 | a, 19 | a:visited { 20 | text-decoration: underline; 21 | } 22 | 23 | a[href]:after { 24 | content: " (" attr(href) ")"; 25 | } 26 | 27 | abbr[title]:after { 28 | content: " (" attr(title) ")"; 29 | } 30 | 31 | // Don't show links that are fragment identifiers, 32 | // or use the `javascript:` pseudo protocol 33 | a[href^="#"]:after, 34 | a[href^="javascript:"]:after { 35 | content: ""; 36 | } 37 | 38 | pre, 39 | blockquote { 40 | border: 1px solid #999; 41 | page-break-inside: avoid; 42 | } 43 | 44 | thead { 45 | display: table-header-group; // h5bp.com/t 46 | } 47 | 48 | tr, 49 | img { 50 | page-break-inside: avoid; 51 | } 52 | 53 | img { 54 | max-width: 100% !important; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Bootstrap specific changes start 70 | // 71 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 72 | // Once fixed, we can just straight up remove this. 73 | select { 74 | background: #fff !important; 75 | } 76 | 77 | // Bootstrap components 78 | .navbar { 79 | display: none; 80 | } 81 | .btn, 82 | .dropup > .btn { 83 | > .caret { 84 | border-top-color: #000 !important; 85 | } 86 | } 87 | .label { 88 | border: 1px solid #000; 89 | } 90 | 91 | .table { 92 | border-collapse: collapse !important; 93 | 94 | td, 95 | th { 96 | background-color: #fff !important; 97 | } 98 | } 99 | .table-bordered { 100 | th, 101 | td { 102 | border: 1px solid #ddd !important; 103 | } 104 | } 105 | 106 | // Bootstrap specific changes end 107 | } 108 | -------------------------------------------------------------------------------- /test/compile-test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Test if compile errors are produced where necessary. 2 | 3 | cmake_minimum_required(VERSION 2.8) 4 | 5 | include(CheckCXXSourceCompiles) 6 | set(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../..) 7 | set(CMAKE_REQUIRED_FLAGS ${CPP11_FLAG}) 8 | 9 | function (generate_source result fragment) 10 | set(${result} " 11 | #define FMT_HEADER_ONLY 1 12 | #include \"fmt/posix.h\" 13 | int main() { 14 | ${fragment} 15 | } 16 | " PARENT_SCOPE) 17 | endfunction () 18 | 19 | function (expect_compile code) 20 | generate_source(source "${code}") 21 | check_cxx_source_compiles("${source}" compiles) 22 | if (NOT compiles) 23 | set(error_msg "Compile error for: ${code}") 24 | endif () 25 | # Unset the CMake cache variable compiles. Otherwise the compile test will 26 | # just use cached information next time it runs. 27 | unset(compiles CACHE) 28 | if (error_msg) 29 | message(FATAL_ERROR ${error_msg}) 30 | endif () 31 | endfunction () 32 | 33 | function (expect_compile_error code) 34 | generate_source(source "${code}") 35 | check_cxx_source_compiles("${source}" compiles) 36 | if (compiles) 37 | set(error_msg "No compile error for: ${code}") 38 | endif () 39 | # Unset the CMake cache variable compiles. Otherwise the compile test will 40 | # just use cached information next time it runs. 41 | unset(compiles CACHE) 42 | if (error_msg) 43 | message(FATAL_ERROR ${error_msg}) 44 | endif () 45 | endfunction () 46 | 47 | # check if the source file skeleton compiles 48 | expect_compile("") 49 | 50 | # MakeArg doesn't accept [const] volatile char *. 51 | expect_compile_error("volatile char s[] = \"test\"; (fmt::internal::MakeArg)(s);") 52 | expect_compile_error("const volatile char s[] = \"test\"; (fmt::internal::MakeArg)(s);") 53 | 54 | # MakeArg doesn't accept wchar_t. 55 | expect_compile_error("fmt::internal::MakeValue(L'a');") 56 | expect_compile_error("fmt::internal::MakeValue(L\"test\");") 57 | 58 | # Writing a wide character to a character stream Writer is forbidden. 59 | expect_compile_error("fmt::MemoryWriter() << L'a';") 60 | expect_compile_error("fmt::MemoryWriter() << fmt::pad(\"abc\", 5, L' ');") 61 | expect_compile_error("fmt::MemoryWriter() << fmt::pad(42, 5, L' ');") 62 | 63 | # Formatting a wide character with a narrow format string is forbidden. 64 | expect_compile_error("fmt::format(\"{}\", L'a';") 65 | 66 | expect_compile("FMT_STATIC_ASSERT(true, \"this should never happen\");") 67 | expect_compile_error("FMT_STATIC_ASSERT(0 > 1, \"oops\");") 68 | 69 | # Make sure that compiler features detected in the header 70 | # match the features detected in CMake. 71 | if (SUPPORTS_USER_DEFINED_LITERALS) 72 | set(supports_udl 1) 73 | else () 74 | set(supports_udl 0) 75 | endif () 76 | expect_compile("#if FMT_USE_USER_DEFINED_LITERALS != ${supports_udl} 77 | # error 78 | #endif") 79 | -------------------------------------------------------------------------------- /test/posix-mock.h: -------------------------------------------------------------------------------- 1 | /* 2 | Mocks of POSIX functions 3 | 4 | Copyright (c) 2012-2015, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef FMT_POSIX_TEST_H 29 | #define FMT_POSIX_TEST_H 30 | 31 | #include 32 | #include 33 | 34 | #ifdef _WIN32 35 | # include 36 | #else 37 | # include // for ssize_t 38 | #endif 39 | 40 | #ifndef _MSC_VER 41 | struct stat; 42 | #endif 43 | 44 | namespace test { 45 | 46 | #ifndef _MSC_VER 47 | // Size type for read and write. 48 | typedef size_t size_t; 49 | typedef ssize_t ssize_t; 50 | int open(const char *path, int oflag, int mode); 51 | int fstat(int fd, struct stat *buf); 52 | #else 53 | typedef unsigned size_t; 54 | typedef int ssize_t; 55 | errno_t sopen_s( 56 | int* pfh, const char *filename, int oflag, int shflag, int pmode); 57 | #endif 58 | 59 | #ifndef _WIN32 60 | long sysconf(int name); 61 | #else 62 | DWORD GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh); 63 | #endif 64 | 65 | int close(int fildes); 66 | 67 | int dup(int fildes); 68 | int dup2(int fildes, int fildes2); 69 | 70 | FILE *fdopen(int fildes, const char *mode); 71 | 72 | ssize_t read(int fildes, void *buf, size_t nbyte); 73 | ssize_t write(int fildes, const void *buf, size_t nbyte); 74 | 75 | #ifndef _WIN32 76 | int pipe(int fildes[2]); 77 | #else 78 | int pipe(int *pfds, unsigned psize, int textmode); 79 | #endif 80 | 81 | FILE *fopen(const char *filename, const char *mode); 82 | int fclose(FILE *stream); 83 | int (fileno)(FILE *stream); 84 | } // namespace test 85 | 86 | #define FMT_SYSTEM(call) test::call 87 | 88 | #endif // FMT_POSIX_TEST_H 89 | -------------------------------------------------------------------------------- /test/mock-allocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | Mock allocator. 3 | 4 | Copyright (c) 2014, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef FMT_MOCK_ALLOCATOR_H_ 29 | #define FMT_MOCK_ALLOCATOR_H_ 30 | 31 | #include "gmock/gmock.h" 32 | 33 | template 34 | class MockAllocator { 35 | public: 36 | MockAllocator() {} 37 | MockAllocator(const MockAllocator &) {} 38 | typedef T value_type; 39 | MOCK_METHOD1_T(allocate, T* (std::size_t n)); 40 | MOCK_METHOD2_T(deallocate, void (T* p, std::size_t n)); 41 | }; 42 | 43 | template 44 | class AllocatorRef { 45 | private: 46 | Allocator *alloc_; 47 | 48 | public: 49 | typedef typename Allocator::value_type value_type; 50 | 51 | explicit AllocatorRef(Allocator *alloc = 0) : alloc_(alloc) {} 52 | 53 | AllocatorRef(const AllocatorRef &other) : alloc_(other.alloc_) {} 54 | 55 | AllocatorRef& operator=(const AllocatorRef &other) { 56 | alloc_ = other.alloc_; 57 | return *this; 58 | } 59 | 60 | #if FMT_USE_RVALUE_REFERENCES 61 | private: 62 | void move(AllocatorRef &other) { 63 | alloc_ = other.alloc_; 64 | other.alloc_ = 0; 65 | } 66 | 67 | public: 68 | AllocatorRef(AllocatorRef &&other) { 69 | move(other); 70 | } 71 | 72 | AllocatorRef& operator=(AllocatorRef &&other) { 73 | assert(this != &other); 74 | move(other); 75 | return *this; 76 | } 77 | #endif 78 | 79 | Allocator *get() const { return alloc_; } 80 | 81 | value_type* allocate(std::size_t n) { return alloc_->allocate(n); } 82 | void deallocate(value_type* p, std::size_t n) { alloc_->deallocate(p, n); } 83 | }; 84 | 85 | #endif // FMT_MOCK_ALLOCATOR_H_ 86 | -------------------------------------------------------------------------------- /doc/bootstrap/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: @text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: @border-color; 23 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken(@border-color, 10%); 26 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); 27 | .box-shadow(@shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: @text-color; 33 | border-color: @border-color; 34 | background-color: @background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: @text-color; 39 | } 40 | } 41 | 42 | 43 | // Form control focus state 44 | // 45 | // Generate a customized focus state and for any input with the specified color, 46 | // which defaults to the `@input-border-focus` variable. 47 | // 48 | // We highly encourage you to not customize the default value, but instead use 49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 50 | // WebKit's default styles, but applicable to a wider range of browsers. Its 51 | // usability and accessibility should be taken into account with any change. 52 | // 53 | // Example usage: change the default blue border and shadow to white for better 54 | // contrast against a dark gray background. 55 | .form-control-focus(@color: @input-border-focus) { 56 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 57 | &:focus { 58 | border-color: @color; 59 | outline: 0; 60 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 61 | } 62 | } 63 | 64 | // Form control sizing 65 | // 66 | // Relative text size, padding, and border-radii changes for form controls. For 67 | // horizontal sizing, wrap controls in the predefined grid classes. ` 26 | 27 | 28 | 29 | {% if button %} 30 | 31 | {% endif %} 32 | 33 | {%- endmacro %} 34 | 35 | {% block header %} 36 | 82 | {% if pagename == "index" %} 83 | {% set download_url = 'https://github.com/fmtlib/fmt/releases/download' %} 84 |
85 |
86 |

{fmt}

87 |

Small, safe and fast formatting library

88 |
89 | {% set name = 'fmt' if version.split('.')[0]|int >= 3 else 'cppformat' %} 90 | 92 | Download 93 | 94 | 96 | 103 |
104 |
105 |
106 | {% endif %} 107 | {% endblock %} 108 | 109 | {# Disable relbars. #} 110 | {% block relbar1 %} 111 | {% endblock %} 112 | {% block relbar2 %} 113 | {% endblock %} 114 | 115 | {% block content %} 116 |
117 |
118 | {# Sidebar is currently disabled. 119 |
120 | 135 |
136 | #} 137 | 138 |
139 | {% block body %} {% endblock %} 140 |
141 |
142 |
143 | {% endblock %} 144 | 145 | {% block footer %} 146 | {{ super() }} 147 | {# Placed at the end of the document so the pages load faster. #} 148 | 149 | {% endblock %} 150 | -------------------------------------------------------------------------------- /doc/bootstrap/navs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Navs 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | // -------------------------------------------------- 8 | 9 | .nav { 10 | margin-bottom: 0; 11 | padding-left: 0; // Override default ul/ol 12 | list-style: none; 13 | &:extend(.clearfix all); 14 | 15 | > li { 16 | position: relative; 17 | display: block; 18 | 19 | > a { 20 | position: relative; 21 | display: block; 22 | padding: @nav-link-padding; 23 | &:hover, 24 | &:focus { 25 | text-decoration: none; 26 | background-color: @nav-link-hover-bg; 27 | } 28 | } 29 | 30 | // Disabled state sets text to gray and nukes hover/tab effects 31 | &.disabled > a { 32 | color: @nav-disabled-link-color; 33 | 34 | &:hover, 35 | &:focus { 36 | color: @nav-disabled-link-hover-color; 37 | text-decoration: none; 38 | background-color: transparent; 39 | cursor: @cursor-disabled; 40 | } 41 | } 42 | } 43 | 44 | // Open dropdowns 45 | .open > a { 46 | &, 47 | &:hover, 48 | &:focus { 49 | background-color: @nav-link-hover-bg; 50 | border-color: @link-color; 51 | } 52 | } 53 | 54 | // Nav dividers (deprecated with v3.0.1) 55 | // 56 | // This should have been removed in v3 with the dropping of `.nav-list`, but 57 | // we missed it. We don't currently support this anywhere, but in the interest 58 | // of maintaining backward compatibility in case you use it, it's deprecated. 59 | .nav-divider { 60 | .nav-divider(); 61 | } 62 | 63 | // Prevent IE8 from misplacing imgs 64 | // 65 | // See https://github.com/h5bp/html5-boilerplate/issues/984#issuecomment-3985989 66 | > li > a > img { 67 | max-width: none; 68 | } 69 | } 70 | 71 | 72 | // Tabs 73 | // ------------------------- 74 | 75 | // Give the tabs something to sit on 76 | .nav-tabs { 77 | border-bottom: 1px solid @nav-tabs-border-color; 78 | > li { 79 | float: left; 80 | // Make the list-items overlay the bottom border 81 | margin-bottom: -1px; 82 | 83 | // Actual tabs (as links) 84 | > a { 85 | margin-right: 2px; 86 | line-height: @line-height-base; 87 | border: 1px solid transparent; 88 | border-radius: @border-radius-base @border-radius-base 0 0; 89 | &:hover { 90 | border-color: @nav-tabs-link-hover-border-color @nav-tabs-link-hover-border-color @nav-tabs-border-color; 91 | } 92 | } 93 | 94 | // Active state, and its :hover to override normal :hover 95 | &.active > a { 96 | &, 97 | &:hover, 98 | &:focus { 99 | color: @nav-tabs-active-link-hover-color; 100 | background-color: @nav-tabs-active-link-hover-bg; 101 | border: 1px solid @nav-tabs-active-link-hover-border-color; 102 | border-bottom-color: transparent; 103 | cursor: default; 104 | } 105 | } 106 | } 107 | // pulling this in mainly for less shorthand 108 | &.nav-justified { 109 | .nav-justified(); 110 | .nav-tabs-justified(); 111 | } 112 | } 113 | 114 | 115 | // Pills 116 | // ------------------------- 117 | .nav-pills { 118 | > li { 119 | float: left; 120 | 121 | // Links rendered as pills 122 | > a { 123 | border-radius: @nav-pills-border-radius; 124 | } 125 | + li { 126 | margin-left: 2px; 127 | } 128 | 129 | // Active state 130 | &.active > a { 131 | &, 132 | &:hover, 133 | &:focus { 134 | color: @nav-pills-active-link-hover-color; 135 | background-color: @nav-pills-active-link-hover-bg; 136 | } 137 | } 138 | } 139 | } 140 | 141 | 142 | // Stacked pills 143 | .nav-stacked { 144 | > li { 145 | float: none; 146 | + li { 147 | margin-top: 2px; 148 | margin-left: 0; // no need for this gap between nav items 149 | } 150 | } 151 | } 152 | 153 | 154 | // Nav variations 155 | // -------------------------------------------------- 156 | 157 | // Justified nav links 158 | // ------------------------- 159 | 160 | .nav-justified { 161 | width: 100%; 162 | 163 | > li { 164 | float: none; 165 | > a { 166 | text-align: center; 167 | margin-bottom: 5px; 168 | } 169 | } 170 | 171 | > .dropdown .dropdown-menu { 172 | top: auto; 173 | left: auto; 174 | } 175 | 176 | @media (min-width: @screen-sm-min) { 177 | > li { 178 | display: table-cell; 179 | width: 1%; 180 | > a { 181 | margin-bottom: 0; 182 | } 183 | } 184 | } 185 | } 186 | 187 | // Move borders to anchors instead of bottom of list 188 | // 189 | // Mixin for adding on top the shared `.nav-justified` styles for our tabs 190 | .nav-tabs-justified { 191 | border-bottom: 0; 192 | 193 | > li > a { 194 | // Override margin from .nav-tabs 195 | margin-right: 0; 196 | border-radius: @border-radius-base; 197 | } 198 | 199 | > .active > a, 200 | > .active > a:hover, 201 | > .active > a:focus { 202 | border: 1px solid @nav-tabs-justified-link-border-color; 203 | } 204 | 205 | @media (min-width: @screen-sm-min) { 206 | > li > a { 207 | border-bottom: 1px solid @nav-tabs-justified-link-border-color; 208 | border-radius: @border-radius-base @border-radius-base 0 0; 209 | } 210 | > .active > a, 211 | > .active > a:hover, 212 | > .active > a:focus { 213 | border-bottom-color: @nav-tabs-justified-active-link-border-color; 214 | } 215 | } 216 | } 217 | 218 | 219 | // Tabbable tabs 220 | // ------------------------- 221 | 222 | // Hide tabbable panes to start, show them when `.active` 223 | .tab-content { 224 | > .tab-pane { 225 | display: none; 226 | } 227 | > .active { 228 | display: block; 229 | } 230 | } 231 | 232 | 233 | // Dropdowns 234 | // ------------------------- 235 | 236 | // Specific dropdowns 237 | .nav-tabs .dropdown-menu { 238 | // make dropdown border overlap tab border 239 | margin-top: -1px; 240 | // Remove the top rounded corners here since there is a hard edge above the menu 241 | .border-top-radius(0); 242 | } 243 | -------------------------------------------------------------------------------- /doc/bootstrap/carousel.less: -------------------------------------------------------------------------------- 1 | // 2 | // Carousel 3 | // -------------------------------------------------- 4 | 5 | 6 | // Wrapper for the slide container and indicators 7 | .carousel { 8 | position: relative; 9 | } 10 | 11 | .carousel-inner { 12 | position: relative; 13 | overflow: hidden; 14 | width: 100%; 15 | 16 | > .item { 17 | display: none; 18 | position: relative; 19 | .transition(.6s ease-in-out left); 20 | 21 | // Account for jankitude on images 22 | > img, 23 | > a > img { 24 | &:extend(.img-responsive); 25 | line-height: 1; 26 | } 27 | 28 | // WebKit CSS3 transforms for supported devices 29 | @media all and (transform-3d), (-webkit-transform-3d) { 30 | .transition-transform(~'0.6s ease-in-out'); 31 | .backface-visibility(~'hidden'); 32 | .perspective(1000); 33 | 34 | &.next, 35 | &.active.right { 36 | .translate3d(100%, 0, 0); 37 | left: 0; 38 | } 39 | &.prev, 40 | &.active.left { 41 | .translate3d(-100%, 0, 0); 42 | left: 0; 43 | } 44 | &.next.left, 45 | &.prev.right, 46 | &.active { 47 | .translate3d(0, 0, 0); 48 | left: 0; 49 | } 50 | } 51 | } 52 | 53 | > .active, 54 | > .next, 55 | > .prev { 56 | display: block; 57 | } 58 | 59 | > .active { 60 | left: 0; 61 | } 62 | 63 | > .next, 64 | > .prev { 65 | position: absolute; 66 | top: 0; 67 | width: 100%; 68 | } 69 | 70 | > .next { 71 | left: 100%; 72 | } 73 | > .prev { 74 | left: -100%; 75 | } 76 | > .next.left, 77 | > .prev.right { 78 | left: 0; 79 | } 80 | 81 | > .active.left { 82 | left: -100%; 83 | } 84 | > .active.right { 85 | left: 100%; 86 | } 87 | 88 | } 89 | 90 | // Left/right controls for nav 91 | // --------------------------- 92 | 93 | .carousel-control { 94 | position: absolute; 95 | top: 0; 96 | left: 0; 97 | bottom: 0; 98 | width: @carousel-control-width; 99 | .opacity(@carousel-control-opacity); 100 | font-size: @carousel-control-font-size; 101 | color: @carousel-control-color; 102 | text-align: center; 103 | text-shadow: @carousel-text-shadow; 104 | // We can't have this transition here because WebKit cancels the carousel 105 | // animation if you trip this while in the middle of another animation. 106 | 107 | // Set gradients for backgrounds 108 | &.left { 109 | #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001)); 110 | } 111 | &.right { 112 | left: auto; 113 | right: 0; 114 | #gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5)); 115 | } 116 | 117 | // Hover/focus state 118 | &:hover, 119 | &:focus { 120 | outline: 0; 121 | color: @carousel-control-color; 122 | text-decoration: none; 123 | .opacity(.9); 124 | } 125 | 126 | // Toggles 127 | .icon-prev, 128 | .icon-next, 129 | .glyphicon-chevron-left, 130 | .glyphicon-chevron-right { 131 | position: absolute; 132 | top: 50%; 133 | z-index: 5; 134 | display: inline-block; 135 | } 136 | .icon-prev, 137 | .glyphicon-chevron-left { 138 | left: 50%; 139 | margin-left: -10px; 140 | } 141 | .icon-next, 142 | .glyphicon-chevron-right { 143 | right: 50%; 144 | margin-right: -10px; 145 | } 146 | .icon-prev, 147 | .icon-next { 148 | width: 20px; 149 | height: 20px; 150 | margin-top: -10px; 151 | line-height: 1; 152 | font-family: serif; 153 | } 154 | 155 | 156 | .icon-prev { 157 | &:before { 158 | content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039) 159 | } 160 | } 161 | .icon-next { 162 | &:before { 163 | content: '\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A) 164 | } 165 | } 166 | } 167 | 168 | // Optional indicator pips 169 | // 170 | // Add an unordered list with the following class and add a list item for each 171 | // slide your carousel holds. 172 | 173 | .carousel-indicators { 174 | position: absolute; 175 | bottom: 10px; 176 | left: 50%; 177 | z-index: 15; 178 | width: 60%; 179 | margin-left: -30%; 180 | padding-left: 0; 181 | list-style: none; 182 | text-align: center; 183 | 184 | li { 185 | display: inline-block; 186 | width: 10px; 187 | height: 10px; 188 | margin: 1px; 189 | text-indent: -999px; 190 | border: 1px solid @carousel-indicator-border-color; 191 | border-radius: 10px; 192 | cursor: pointer; 193 | 194 | // IE8-9 hack for event handling 195 | // 196 | // Internet Explorer 8-9 does not support clicks on elements without a set 197 | // `background-color`. We cannot use `filter` since that's not viewed as a 198 | // background color by the browser. Thus, a hack is needed. 199 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Internet_Explorer 200 | // 201 | // For IE8, we set solid black as it doesn't support `rgba()`. For IE9, we 202 | // set alpha transparency for the best results possible. 203 | background-color: #000 \9; // IE8 204 | background-color: rgba(0,0,0,0); // IE9 205 | } 206 | .active { 207 | margin: 0; 208 | width: 12px; 209 | height: 12px; 210 | background-color: @carousel-indicator-active-bg; 211 | } 212 | } 213 | 214 | // Optional captions 215 | // ----------------------------- 216 | // Hidden by default for smaller viewports 217 | .carousel-caption { 218 | position: absolute; 219 | left: 15%; 220 | right: 15%; 221 | bottom: 20px; 222 | z-index: 10; 223 | padding-top: 20px; 224 | padding-bottom: 20px; 225 | color: @carousel-caption-color; 226 | text-align: center; 227 | text-shadow: @carousel-text-shadow; 228 | & .btn { 229 | text-shadow: none; // No shadow for button elements in carousel-caption 230 | } 231 | } 232 | 233 | 234 | // Scale up controls for tablets and up 235 | @media screen and (min-width: @screen-sm-min) { 236 | 237 | // Scale up the controls a smidge 238 | .carousel-control { 239 | .glyphicon-chevron-left, 240 | .glyphicon-chevron-right, 241 | .icon-prev, 242 | .icon-next { 243 | width: 30px; 244 | height: 30px; 245 | margin-top: -15px; 246 | font-size: 30px; 247 | } 248 | .glyphicon-chevron-left, 249 | .icon-prev { 250 | margin-left: -15px; 251 | } 252 | .glyphicon-chevron-right, 253 | .icon-next { 254 | margin-right: -15px; 255 | } 256 | } 257 | 258 | // Show and left align the captions 259 | .carousel-caption { 260 | left: 20%; 261 | right: 20%; 262 | padding-bottom: 30px; 263 | } 264 | 265 | // Move up the indicators 266 | .carousel-indicators { 267 | bottom: 20px; 268 | } 269 | } 270 | -------------------------------------------------------------------------------- /doc/bootstrap/button-groups.less: -------------------------------------------------------------------------------- 1 | // 2 | // Button groups 3 | // -------------------------------------------------- 4 | 5 | // Make the div behave like a button 6 | .btn-group, 7 | .btn-group-vertical { 8 | position: relative; 9 | display: inline-block; 10 | vertical-align: middle; // match .btn alignment given font-size hack above 11 | > .btn { 12 | position: relative; 13 | float: left; 14 | // Bring the "active" button to the front 15 | &:hover, 16 | &:focus, 17 | &:active, 18 | &.active { 19 | z-index: 2; 20 | } 21 | } 22 | } 23 | 24 | // Prevent double borders when buttons are next to each other 25 | .btn-group { 26 | .btn + .btn, 27 | .btn + .btn-group, 28 | .btn-group + .btn, 29 | .btn-group + .btn-group { 30 | margin-left: -1px; 31 | } 32 | } 33 | 34 | // Optional: Group multiple button groups together for a toolbar 35 | .btn-toolbar { 36 | margin-left: -5px; // Offset the first child's margin 37 | &:extend(.clearfix all); 38 | 39 | .btn-group, 40 | .input-group { 41 | float: left; 42 | } 43 | > .btn, 44 | > .btn-group, 45 | > .input-group { 46 | margin-left: 5px; 47 | } 48 | } 49 | 50 | .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { 51 | border-radius: 0; 52 | } 53 | 54 | // Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match 55 | .btn-group > .btn:first-child { 56 | margin-left: 0; 57 | &:not(:last-child):not(.dropdown-toggle) { 58 | .border-right-radius(0); 59 | } 60 | } 61 | // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it 62 | .btn-group > .btn:last-child:not(:first-child), 63 | .btn-group > .dropdown-toggle:not(:first-child) { 64 | .border-left-radius(0); 65 | } 66 | 67 | // Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group) 68 | .btn-group > .btn-group { 69 | float: left; 70 | } 71 | .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { 72 | border-radius: 0; 73 | } 74 | .btn-group > .btn-group:first-child:not(:last-child) { 75 | > .btn:last-child, 76 | > .dropdown-toggle { 77 | .border-right-radius(0); 78 | } 79 | } 80 | .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { 81 | .border-left-radius(0); 82 | } 83 | 84 | // On active and open, don't show outline 85 | .btn-group .dropdown-toggle:active, 86 | .btn-group.open .dropdown-toggle { 87 | outline: 0; 88 | } 89 | 90 | 91 | // Sizing 92 | // 93 | // Remix the default button sizing classes into new ones for easier manipulation. 94 | 95 | .btn-group-xs > .btn { &:extend(.btn-xs); } 96 | .btn-group-sm > .btn { &:extend(.btn-sm); } 97 | .btn-group-lg > .btn { &:extend(.btn-lg); } 98 | 99 | 100 | // Split button dropdowns 101 | // ---------------------- 102 | 103 | // Give the line between buttons some depth 104 | .btn-group > .btn + .dropdown-toggle { 105 | padding-left: 8px; 106 | padding-right: 8px; 107 | } 108 | .btn-group > .btn-lg + .dropdown-toggle { 109 | padding-left: 12px; 110 | padding-right: 12px; 111 | } 112 | 113 | // The clickable button for toggling the menu 114 | // Remove the gradient and set the same inset shadow as the :active state 115 | .btn-group.open .dropdown-toggle { 116 | .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); 117 | 118 | // Show no shadow for `.btn-link` since it has no other button styles. 119 | &.btn-link { 120 | .box-shadow(none); 121 | } 122 | } 123 | 124 | 125 | // Reposition the caret 126 | .btn .caret { 127 | margin-left: 0; 128 | } 129 | // Carets in other button sizes 130 | .btn-lg .caret { 131 | border-width: @caret-width-large @caret-width-large 0; 132 | border-bottom-width: 0; 133 | } 134 | // Upside down carets for .dropup 135 | .dropup .btn-lg .caret { 136 | border-width: 0 @caret-width-large @caret-width-large; 137 | } 138 | 139 | 140 | // Vertical button groups 141 | // ---------------------- 142 | 143 | .btn-group-vertical { 144 | > .btn, 145 | > .btn-group, 146 | > .btn-group > .btn { 147 | display: block; 148 | float: none; 149 | width: 100%; 150 | max-width: 100%; 151 | } 152 | 153 | // Clear floats so dropdown menus can be properly placed 154 | > .btn-group { 155 | &:extend(.clearfix all); 156 | > .btn { 157 | float: none; 158 | } 159 | } 160 | 161 | > .btn + .btn, 162 | > .btn + .btn-group, 163 | > .btn-group + .btn, 164 | > .btn-group + .btn-group { 165 | margin-top: -1px; 166 | margin-left: 0; 167 | } 168 | } 169 | 170 | .btn-group-vertical > .btn { 171 | &:not(:first-child):not(:last-child) { 172 | border-radius: 0; 173 | } 174 | &:first-child:not(:last-child) { 175 | border-top-right-radius: @border-radius-base; 176 | .border-bottom-radius(0); 177 | } 178 | &:last-child:not(:first-child) { 179 | border-bottom-left-radius: @border-radius-base; 180 | .border-top-radius(0); 181 | } 182 | } 183 | .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { 184 | border-radius: 0; 185 | } 186 | .btn-group-vertical > .btn-group:first-child:not(:last-child) { 187 | > .btn:last-child, 188 | > .dropdown-toggle { 189 | .border-bottom-radius(0); 190 | } 191 | } 192 | .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { 193 | .border-top-radius(0); 194 | } 195 | 196 | 197 | // Justified button groups 198 | // ---------------------- 199 | 200 | .btn-group-justified { 201 | display: table; 202 | width: 100%; 203 | table-layout: fixed; 204 | border-collapse: separate; 205 | > .btn, 206 | > .btn-group { 207 | float: none; 208 | display: table-cell; 209 | width: 1%; 210 | } 211 | > .btn-group .btn { 212 | width: 100%; 213 | } 214 | 215 | > .btn-group .dropdown-menu { 216 | left: auto; 217 | } 218 | } 219 | 220 | 221 | // Checkbox and radio options 222 | // 223 | // In order to support the browser's form validation feedback, powered by the 224 | // `required` attribute, we have to "hide" the inputs via `clip`. We cannot use 225 | // `display: none;` or `visibility: hidden;` as that also hides the popover. 226 | // Simply visually hiding the inputs via `opacity` would leave them clickable in 227 | // certain cases which is prevented by using `clip` and `pointer-events`. 228 | // This way, we ensure a DOM element is visible to position the popover from. 229 | // 230 | // See https://github.com/twbs/bootstrap/pull/12794 and 231 | // https://github.com/twbs/bootstrap/pull/14559 for more information. 232 | 233 | [data-toggle="buttons"] { 234 | > .btn, 235 | > .btn-group > .btn { 236 | input[type="radio"], 237 | input[type="checkbox"] { 238 | position: absolute; 239 | clip: rect(0,0,0,0); 240 | pointer-events: none; 241 | } 242 | } 243 | } 244 | --------------------------------------------------------------------------------