29 lines
881 B
C++
29 lines
881 B
C++
#ifndef FESA_CORE_ASCII_H_
|
|
#define FESA_CORE_ASCII_H_
|
|
|
|
#include <cstdint>
|
|
#include <string_view>
|
|
|
|
#include "fesa/core/status.h"
|
|
|
|
namespace fesa {
|
|
|
|
/// @brief Converts one ASCII uppercase byte to lowercase.
|
|
/// @return The lowercase ASCII byte, or the input byte when it is not A-Z.
|
|
char AsciiLower(char value) noexcept;
|
|
|
|
/// @brief Compares two byte strings with ASCII-only case folding.
|
|
/// @return True when the strings have equal length and equal ASCII-folded
|
|
/// bytes.
|
|
bool AsciiCaseInsensitiveEquals(std::string_view lhs,
|
|
std::string_view rhs) noexcept;
|
|
|
|
/// @brief Parses a complete positive base-10 source label.
|
|
/// @return The positive label or an input failure for malformed, nonpositive,
|
|
/// or out-of-range text.
|
|
Result<std::int64_t> ParsePositiveSourceLabel(std::string_view text);
|
|
|
|
} // namespace fesa
|
|
|
|
#endif // FESA_CORE_ASCII_H_
|