ALib C++ Library
by
Library Version:
2412 R0
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
alib
lang
format
lang/format/fwds.hpp
Go to the documentation of this file.
1
//==================================================================================================
2
/// \file
3
/// This header file is part of sub-namespace #alib::lang::format of module \alib_basecamp of
4
/// the \aliblong.
5
///
6
/// \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
7
/// Published under \ref mainpage_license "Boost Software License".
8
//==================================================================================================
9
#ifndef HPP_ALIB_LANG_FORMAT_FWDS
10
#define HPP_ALIB_LANG_FORMAT_FWDS 1
11
#pragma once
12
#include "
alib/containers/sharedptr.hpp
"
13
#include "
alib/lang/message/exception.hpp
"
14
15
ALIB_ASSERT_MODULE
(CAMP)
16
17
namespace
alib
{
namespace
lang {
namespace
format {
18
19
//==============================================================================================
20
/// This interface class exposes interface method \c Invoke which writes the content of the
21
/// box to the given \b %AString object in accordance with \c formatSpec.
22
///
23
/// \see
24
/// For more information about this class see chapter
25
/// \ref alib_basecamp_format_custom_types "4.3. Formatting Custom Types" of the
26
/// \ref alib_basecamp_format "Programmer's Manual" of module \alib_basecamp_nl.
27
//==============================================================================================
28
struct
FFormat
29
{
30
/// Signature of the invokable function.<br>
31
/// Implementations write the content of \p{box} to the given \b %AString object \p{target} in
32
/// accordance to the type-specific format specification \p{formatSpec}.
33
///
34
/// @param self The box that the function was invoked on.
35
/// @param formatSpec The specification of the format (type specific). If empty, a default
36
/// specification string might have to be chosen.
37
/// @param nf A copy of the number format of the formatter (allowed to be modified).
38
/// @param target The AString object receiving the formatted string.
39
using
Signature
= void (*) (
const
Box
& self,
const
String
& formatSpec,
NumberFormat
& nf,
40
AString
& target );
41
};
42
43
44
45
// #################################################################################################
46
// Forwards
47
// #################################################################################################
48
49
class
Formatter
;
50
class
FormatterPythonStyle
;
51
class
FormatterJavaStyle
;
52
class
Paragraphs
;
53
54
}
// namespace alib::lang[::format]
55
56
namespace
basecamp {
class
BaseCamp; }
57
58
}
// namespace alib[:lang]
59
60
61
// #################################################################################################
62
// Alias types in namespace #alib.
63
// #################################################################################################
64
/// Type alias in namespace \b alib.
65
using
Formatter
=
lang::format::Formatter
;
66
67
/// Type alias in namespace \b alib.
68
using
FormatterPythonStyle
=
lang::format::FormatterPythonStyle
;
69
70
/// Type alias in namespace \b alib.
71
using
FormatterJavaStyle
=
lang::format::FormatterJavaStyle
;
72
73
/// Type alias in namespace \b alib.
74
using
Paragraphs
=
lang::format::Paragraphs
;
75
76
/// A shared pointer to instances of \alib{lang::format;Formatter;standard formatters}.
77
/// \see Static member \alib{lang::format;Formatter::Default}.
78
using
SPFormatter
=
containers::SharedPtr<lang::format::Formatter>
;
79
80
}
// namespace [alib]
81
82
83
#endif
// HPP_ALIB_LANG_FORMAT_FWDS
84
alib::boxing::Box
Definition
box.inl:39
alib::containers::SharedPtr< lang::format::Formatter >
alib::lang::format::FormatterJavaStyle
Definition
formatterjavastyle.hpp:124
alib::lang::format::FormatterPythonStyle
Definition
formatterpythonstyle.hpp:324
alib::lang::format::Formatter
Definition
formatter.hpp:47
alib::lang::format::Paragraphs
Definition
paragraphs.hpp:33
alib::strings::TAString< character, lang::HeapAllocator >
alib::strings::TString< character >
exception.hpp
ALIB_ASSERT_MODULE
#define ALIB_ASSERT_MODULE(modulename)
Definition
alib.hpp:223
alib
Definition
alib.cpp:69
sharedptr.hpp
alib::lang::format::FFormat
Definition
lang/format/fwds.hpp:29
alib::lang::format::FFormat::Signature
void(*)(const Box &self, const String &formatSpec, NumberFormat &nf, AString &target) Signature
Definition
lang/format/fwds.hpp:39
alib::strings::TNumberFormat< character >