Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
5ec28a49
Commit
5ec28a49
authored
Dec 29, 2012
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use breathe + doxygen for API documentation.
parent
4762a8af
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1270 additions
and
23 deletions
+1270
-23
doc/CMakeLists.txt
doc/CMakeLists.txt
+1
-0
doc/Doxyfile
doc/Doxyfile
+1231
-0
doc/conf.py
doc/conf.py
+7
-3
format.h
format.h
+31
-20
No files found.
doc/CMakeLists.txt
View file @
5ec28a49
add_custom_command
(
OUTPUT html/index.html
COMMAND doxygen
COMMAND sphinx-build -b html . ../html
DEPENDS conf.py index.rst
)
add_custom_target
(
doc DEPENDS html/index.html
)
doc/Doxyfile
0 → 100644
View file @
5ec28a49
This diff is collapsed.
Click to expand it.
doc/conf.py
View file @
5ec28a49
...
...
@@ -25,10 +25,14 @@ import sys, os
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions
=
[
'sphinx.ext.ifconfig'
]
extensions
=
[
'sphinx.ext.ifconfig'
,
'breathe'
]
breathe_projects
=
{
"format"
:
"doxyxml"
}
breathe_default_project
=
"format"
breathe_domain_by_extension
=
{
"h"
:
"cpp"
}
# Add any paths that contain templates here, relative to this directory.
templates_path
=
[
'
-
templates'
]
templates_path
=
[
'
_
templates'
]
# The suffix of source filenames.
source_suffix
=
'.rst'
...
...
@@ -120,7 +124,7 @@ html_theme = 'sphinxdoc'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path
=
[
'
-
static'
]
html_static_path
=
[
'
_
static'
]
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
...
...
format.h
View file @
5ec28a49
...
...
@@ -181,21 +181,32 @@ class BasicFormatter {
void
operator
<<
(
int
value
);
};
// Formatter provides string formatting functionality similar to Python's
// str.format. The output is stored in a memory buffer that grows dynamically.
// Usage:
//
// Formatter out;
// out("Current point:\n");
// out("(-{:+f}, {:+f})") << 3.14 << -3.14;
//
// This will populate the buffer of the out object with the following output:
//
// Current point:
// (-3.140000, +3.140000)
//
// The buffer can be accessed using Formatter::data() or Formatter::c_str().
/**
\rst
The :class:`Formatter` class provides string formatting
functionality similar to Python's `str.format
<http://docs.python.org/3/library/stdtypes.html#str.format>`__.
The output is stored in a memory buffer that grows dynamically.
Usage::
Formatter out;
out("Current point:\n");
out("(-{:+f}, {:+f})") << 3.14 << -3.14;
This will populate the buffer of the ``out`` object with the following
output:
.. code-block:: none
Current point:
(-3.140000, +3.140000)
The buffer can be accessed using :meth:`data` or :meth:`c_str`.
\endrst
*/
class
Formatter
:
public
BasicFormatter
{
private:
enum
Type
{
// Numeric types should go first.
INT
,
UINT
,
LONG
,
ULONG
,
DOUBLE
,
LONG_DOUBLE
,
...
...
@@ -345,10 +356,10 @@ class Formatter : public BasicFormatter {
public
:
Formatter
()
:
format_
(
0
)
{
buffer_
[
0
]
=
0
;
}
// Formats a string appending the output to the internal buffer.
// Arguments are accepted through the returned ArgInserter object
// using inserter operator<<.
internal
::
ArgInserter
operator
()(
const
char
*
format
);
//
/
Formats a string appending the output to the internal buffer.
//
/
Arguments are accepted through the returned ArgInserter object
//
/
using inserter operator<<.
internal
::
ArgInserter
operator
()(
StringRef
format
);
std
::
size_t
size
()
const
{
return
buffer_
.
size
();
}
...
...
@@ -484,9 +495,9 @@ void Formatter::FormatCustomArg(const void *arg, const FormatSpec &spec) {
Format
(
af
,
spec
,
*
static_cast
<
const
T
*>
(
arg
));
}
inline
internal
::
ArgInserter
Formatter
::
operator
()(
const
char
*
format
)
{
inline
internal
::
ArgInserter
Formatter
::
operator
()(
StringRef
format
)
{
internal
::
ArgInserter
formatter
(
this
);
format_
=
format
;
format_
=
format
.
c_str
()
;
args_
.
clear
();
return
formatter
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment