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 |