This commit is contained in:
Paul Ferrand 2019-12-23 21:44:59 +01:00
parent d25d0d5e49
commit 63cdf10a9a

View file

@ -22,14 +22,14 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** /**
* @file StringViewHelpers.h * @file StringViewHelpers.h
* @author Paul Ferrand (paul@ferrand.cc) * @author Paul Ferrand (paul@ferrand.cc)
* @brief Contains some helper functions for string views * @brief Contains some helper functions for string views
* @version 0.1 * @version 0.1
* @date 2019-11-23 * @date 2019-11-23
* *
* @copyright Copyright (c) 2019 * @copyright Copyright (c) 2019
* *
*/ */
#pragma once #pragma once
@ -37,8 +37,8 @@
/** /**
* @brief Removes the whitespace on a string_view in place * @brief Removes the whitespace on a string_view in place
* *
* @param s * @param s
*/ */
inline void trimInPlace(absl::string_view& s) inline void trimInPlace(absl::string_view& s)
{ {
@ -54,9 +54,9 @@ inline void trimInPlace(absl::string_view& s)
/** /**
* @brief Removes the whitespace on a string_view and return a new string_view * @brief Removes the whitespace on a string_view and return a new string_view
* *
* @param s * @param s
* @return absl::string_view * @return absl::string_view
*/ */
inline absl::string_view trim(absl::string_view s) inline absl::string_view trim(absl::string_view s)
{ {
@ -69,12 +69,12 @@ constexpr uint64_t Fnv1aPrime = 0x01000193;
/** /**
* @brief Compile-time hashing function to be used mostly with switch/case statements. * @brief Compile-time hashing function to be used mostly with switch/case statements.
* *
* See e.g. the Region.cpp file * See e.g. the Region.cpp file
* *
* @param s the input string to be hashed * @param s the input string to be hashed
* @param h the hashing seed to use * @param h the hashing seed to use
* @return uint64_t * @return uint64_t
*/ */
constexpr uint64_t hash(absl::string_view s, uint64_t h = Fnv1aBasis) constexpr uint64_t hash(absl::string_view s, uint64_t h = Fnv1aBasis)
{ {