Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alexander Lapshin
common
Commits
ae1ed348
Commit
ae1ed348
authored
Jun 15, 2021
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0d38cca0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
16 deletions
+23
-16
TextFunctions.h
utils/TextFunctions.h
+23
-16
No files found.
utils/TextFunctions.h
View file @
ae1ed348
...
@@ -60,20 +60,20 @@ static std::string ToStr(const int arg)
...
@@ -60,20 +60,20 @@ static std::string ToStr(const int arg)
// return "";
// return "";
// }
// }
static
std
::
string
ToStr
(
const
long
long
arg
)
//
static std::string ToStr(const long long arg)
{
//
{
std
::
array
<
char
,
32
>
buf
;
//
std::array<char, 32> buf;
//
const
auto
res
=
std
::
to_chars
(
buf
.
data
(),
buf
.
data
()
+
buf
.
size
(),
arg
);
//
const auto res = std::to_chars(buf.data(), buf.data() + buf.size(), arg);
//
if
(
res
.
ec
==
std
::
errc
())
{
//
if (res.ec == std::errc()) {
return
std
::
string
(
buf
.
data
(),
res
.
ptr
-
buf
.
data
());
//
return std::string(buf.data(), res.ptr - buf.data());
}
//
}
//
hangle_to_chars_error
(
res
,
arg
);
//
hangle_to_chars_error(res, arg);
//
return
""
;
//
return "";
}
//
}
static
std
::
string
ToStr
(
const
bool
arg
)
static
std
::
string
ToStr
(
const
bool
arg
)
{
{
...
@@ -98,10 +98,17 @@ static std::string ToStr(const int arg, const int leading_zeros)
...
@@ -98,10 +98,17 @@ static std::string ToStr(const int arg, const int leading_zeros)
ss
<<
std
::
setw
(
leading_zeros
)
<<
std
::
setfill
(
'0'
);
ss
<<
std
::
setw
(
leading_zeros
)
<<
std
::
setfill
(
'0'
);
ss
<<
arg
;
ss
<<
arg
;
return
ss
.
str
();
return
ss
.
str
();
}
else
{
}
else
{
return
ToStr
(
arg
);
return
ToStr
(
arg
);
}
}
}
static
std
::
string
ToStr
(
const
long
long
arg
)
{
std
::
ostringstream
ss
;
ss
<<
arg
;
return
ss
.
str
();
}
}
// static std::string ToStr(const size_t arg, const int leading_zeros)
// static std::string ToStr(const size_t arg, const int leading_zeros)
...
...
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