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
907fb257
Commit
907fb257
authored
May 16, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/StringAPI: add StringToken(), StringIsEqualIgnoreCase(), StringCollate()
parent
60bd60db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
StringAPI.hxx
src/util/StringAPI.hxx
+27
-0
No files found.
src/util/StringAPI.hxx
View file @
907fb257
...
...
@@ -94,6 +94,12 @@ StringFindLast(char *haystack, char needle) noexcept
return
strrchr
(
haystack
,
needle
);
}
static
inline
char
*
StringToken
(
char
*
str
,
const
char
*
delim
)
noexcept
{
return
strtok
(
str
,
delim
);
}
gcc_nonnull_all
static
inline
void
UnsafeCopyString
(
char
*
dest
,
const
char
*
src
)
noexcept
...
...
@@ -134,6 +140,27 @@ StringIsEqual(const char *a, const char *b, size_t length) noexcept
return
strncmp
(
a
,
b
,
length
)
==
0
;
}
gcc_pure
gcc_nonnull_all
static
inline
bool
StringIsEqualIgnoreCase
(
const
char
*
a
,
const
char
*
b
)
noexcept
{
return
strcasecmp
(
a
,
b
)
==
0
;
}
gcc_pure
gcc_nonnull_all
static
inline
bool
StringIsEqualIgnoreCase
(
const
char
*
a
,
const
char
*
b
,
size_t
size
)
noexcept
{
return
strncasecmp
(
a
,
b
,
size
)
==
0
;
}
gcc_pure
gcc_nonnull_all
static
inline
int
StringCollate
(
const
char
*
a
,
const
char
*
b
)
noexcept
{
return
strcoll
(
a
,
b
);
}
/**
* Copy the string to a new allocation. The return value must be
* freed with free().
...
...
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