1
0
mirror of https://github.com/google/cpu_features.git synced 2025-07-02 21:53:18 +02:00

Explicitly namespace every extern identifier

This commit is contained in:
Arvid Gerstmann
2018-04-26 10:31:03 +02:00
parent 7eca4a7a39
commit a1ffdcbe70
12 changed files with 112 additions and 112 deletions

View File

@ -46,54 +46,54 @@ static inline StringView view(const char* str, const size_t size) {
static inline StringView str(const char* str) { return view(str, strlen(str)); }
// Returns the index of the first occurrence of c in view or -1 if not found.
int IndexOfChar(const StringView view, char c);
int CpuFeatures_StringView_IndexOfChar(const StringView view, char c);
// Returns the index of the first occurrence of sub_view in view or -1 if not
// found.
int IndexOf(const StringView view, const StringView sub_view);
int CpuFeatures_StringView_IndexOf(const StringView view, const StringView sub_view);
// Returns whether a is equal to b (same content).
bool IsEquals(const StringView a, const StringView b);
bool CpuFeatures_StringView_IsEquals(const StringView a, const StringView b);
// Returns whether a starts with b.
bool StartsWith(const StringView a, const StringView b);
bool CpuFeatures_StringView_StartsWith(const StringView a, const StringView b);
// Removes count characters from the beginning of view or kEmptyStringView if
// count if greater than view.size.
StringView PopFront(const StringView view, size_t count);
StringView CpuFeatures_StringView_PopFront(const StringView view, size_t count);
// Removes count characters from the end of view or kEmptyStringView if count if
// greater than view.size.
StringView PopBack(const StringView str_view, size_t count);
StringView CpuFeatures_StringView_PopBack(const StringView str_view, size_t count);
// Keeps the count first characters of view or view if count if greater than
// view.size.
StringView KeepFront(const StringView view, size_t count);
StringView CpuFeatures_StringView_KeepFront(const StringView view, size_t count);
// Retrieves the first character of view. If view is empty the behavior is
// undefined.
char Front(const StringView view);
char CpuFeatures_StringView_Front(const StringView view);
// Retrieves the last character of view. If view is empty the behavior is
// undefined.
char Back(const StringView view);
char CpuFeatures_StringView_Back(const StringView view);
// Removes leading and tailing space characters.
StringView TrimWhitespace(StringView view);
StringView CpuFeatures_StringView_TrimWhitespace(StringView view);
// Convert StringView to positive integer. e.g. "42", "0x2a".
// Returns -1 on error.
int ParsePositiveNumber(const StringView view);
int CpuFeatures_StringView_ParsePositiveNumber(const StringView view);
// Copies src StringView to dst buffer.
void CopyString(const StringView src, char* dst, size_t dst_size);
void CpuFeatures_StringView_CopyString(const StringView src, char* dst, size_t dst_size);
// Checks if line contains the specified whitespace separated word.
bool HasWord(const StringView line, const char* const word);
bool CpuFeatures_StringView_HasWord(const StringView line, const char* const word);
// Get key/value from line. key and value are separated by ": ".
// key and value are cleaned up from leading and trailing whitespaces.
bool GetAttributeKeyValue(const StringView line, StringView* key,
bool CpuFeatures_StringView_GetAttributeKeyValue(const StringView line, StringView* key,
StringView* value);
CPU_FEATURES_END_CPP_NAMESPACE