Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Francois Dockes
recoll
Commits
49ad782f
Commit
49ad782f
authored
Feb 28, 2017
by
Jean-Francois Dockes
Browse files
use stding
parent
d08f0588
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/utils/smallut.cpp
View file @
49ad782f
...
...
@@ -670,7 +670,7 @@ bool pcSubst(const string& in, string& out, const map<string, string>& subs)
}
return
true
;
}
inline
static
int
ulltorbuf
(
u
nsigned
long
long
val
,
char
*
rbuf
)
inline
static
int
ulltorbuf
(
u
int64_t
val
,
char
*
rbuf
)
{
int
idx
;
for
(
idx
=
0
;
val
;
idx
++
)
{
...
...
@@ -690,7 +690,7 @@ inline static void ullcopyreverse(const char *rbuf, string& buf, int idx)
}
}
void
ulltodecstr
(
u
nsigned
long
long
val
,
string
&
buf
)
void
ulltodecstr
(
u
int64_t
val
,
string
&
buf
)
{
buf
.
clear
();
if
(
val
==
0
)
{
...
...
@@ -705,7 +705,7 @@ void ulltodecstr(unsigned long long val, string& buf)
return
;
}
void
lltodecstr
(
long
long
val
,
string
&
buf
)
void
lltodecstr
(
int64_t
val
,
string
&
buf
)
{
buf
.
clear
();
if
(
val
==
0
)
{
...
...
@@ -730,14 +730,14 @@ void lltodecstr(long long val, string& buf)
return
;
}
string
lltodecstr
(
long
long
val
)
string
lltodecstr
(
int64_t
val
)
{
string
buf
;
lltodecstr
(
val
,
buf
);
return
buf
;
}
string
ulltodecstr
(
u
nsigned
long
long
val
)
string
ulltodecstr
(
u
int64_t
val
)
{
string
buf
;
ulltodecstr
(
val
,
buf
);
...
...
@@ -745,7 +745,7 @@ string ulltodecstr(unsigned long long val)
}
// Convert byte count into unit (KB/MB...) appropriate for display
string
displayableBytes
(
off
_t
size
)
string
displayableBytes
(
int64
_t
size
)
{
const
char
*
unit
;
...
...
src/utils/smallut.h
View file @
49ad782f
...
...
@@ -19,6 +19,7 @@
#define _SMALLUT_H_INCLUDED_
#include <sys/types.h>
#include <stdint.h>
#include <string>
#include <vector>
...
...
@@ -162,13 +163,13 @@ extern std::string escapeShell(const std::string& str);
extern
std
::
string
truncate_to_word
(
const
std
::
string
&
input
,
std
::
string
::
size_type
maxlen
);
void
ulltodecstr
(
u
nsigned
long
long
val
,
std
::
string
&
buf
);
void
lltodecstr
(
long
long
val
,
std
::
string
&
buf
);
std
::
string
lltodecstr
(
long
long
val
);
std
::
string
ulltodecstr
(
u
nsigned
long
long
val
);
void
ulltodecstr
(
u
int64_t
val
,
std
::
string
&
buf
);
void
lltodecstr
(
int64_t
val
,
std
::
string
&
buf
);
std
::
string
lltodecstr
(
int64_t
val
);
std
::
string
ulltodecstr
(
u
int64_t
val
);
/** Convert byte count into unit (KB/MB...) appropriate for display */
std
::
string
displayableBytes
(
off
_t
size
);
std
::
string
displayableBytes
(
int64
_t
size
);
/** Break big string into lines */
std
::
string
breakIntoLines
(
const
std
::
string
&
in
,
unsigned
int
ll
=
100
,
...
...
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