Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
b47e0cff
Commit
b47e0cff
authored
Nov 30, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/TemplateString: rename CharAsString() to FromChar()
parent
3af35aee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
Types.hxx
src/lib/dbus/Types.hxx
+6
-6
TemplateString.hxx
src/util/TemplateString.hxx
+1
-1
No files found.
src/lib/dbus/Types.hxx
View file @
b47e0cff
...
...
@@ -42,7 +42,7 @@ namespace ODBus {
template
<
int
type
>
struct
BasicTypeTraits
{
static
constexpr
int
TYPE
=
type
;
static
constexpr
auto
as_string
=
TemplateString
::
CharAsString
(
TYPE
);
static
constexpr
auto
as_string
=
TemplateString
::
FromChar
(
TYPE
);
};
template
<
typename
T
>
...
...
@@ -74,7 +74,7 @@ struct ArrayTypeTraits {
static
constexpr
int
TYPE
=
DBUS_TYPE_ARRAY
;
static
constexpr
auto
as_string
=
TemplateString
::
Concat
(
TemplateString
::
CharAsString
(
TYPE
),
TemplateString
::
Concat
(
TemplateString
::
FromChar
(
TYPE
),
ContainedTraits
::
as_string
);
};
...
...
@@ -83,10 +83,10 @@ struct DictEntryTypeTraits {
static
constexpr
int
TYPE
=
DBUS_TYPE_DICT_ENTRY
;
static
constexpr
auto
as_string
=
TemplateString
::
Concat
(
TemplateString
::
CharAsString
(
DBUS_DICT_ENTRY_BEGIN_CHAR
),
TemplateString
::
Concat
(
TemplateString
::
FromChar
(
DBUS_DICT_ENTRY_BEGIN_CHAR
),
KeyT
::
as_string
,
ValueT
::
as_string
,
TemplateString
::
CharAsString
(
DBUS_DICT_ENTRY_END_CHAR
));
TemplateString
::
FromChar
(
DBUS_DICT_ENTRY_END_CHAR
));
};
using
VariantTypeTraits
=
BasicTypeTraits
<
DBUS_TYPE_VARIANT
>
;
...
...
@@ -111,9 +111,9 @@ struct StructTypeTraits {
static
constexpr
int
TYPE
=
DBUS_TYPE_STRUCT
;
static
constexpr
auto
as_string
=
TemplateString
::
Concat
(
TemplateString
::
CharAsString
(
DBUS_STRUCT_BEGIN_CHAR
),
TemplateString
::
Concat
(
TemplateString
::
FromChar
(
DBUS_STRUCT_BEGIN_CHAR
),
ConcatTypeAsString
<
ContainedTraits
...
>::
as_string
,
TemplateString
::
CharAsString
(
DBUS_STRUCT_END_CHAR
));
TemplateString
::
FromChar
(
DBUS_STRUCT_END_CHAR
));
};
}
/* namespace ODBus */
...
...
src/util/TemplateString.hxx
View file @
b47e0cff
...
...
@@ -63,7 +63,7 @@ Empty() noexcept
* A string consisting of a single character.
*/
constexpr
auto
CharAsString
(
char
ch
)
noexcept
FromChar
(
char
ch
)
noexcept
{
Buffer
<
1
>
result
{};
result
.
value
[
0
]
=
ch
;
...
...
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