log4cpp::StringUtil(3)

πŸ“¦
version 1.1.4 Β· 4 versions
, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so log4cpp::StringUtil is the string utility class from log4cpp, and this page is straight outta the Library Functions Manual (section 3). She's giving "I make strings behave" energy, and honestly? Iconic. πŸŽ€

✨ SYNOPSIS ✨

First things first, bestie, you gotta pull in the header:

#include <StringUtil.hh>

🌟 Static Public Member Functions 🌟

  • static std::string vform (const char *format, va_list args) β€” returns a string contructed from the a format specifier and a va_list of arguments, analogously to vprintf(3). Yes, the original says "contructed" and "the a" β€” we're preserving the lore, not fixing it. πŸ’€
  • static std::string trim (const std::string &s) β€” returns a string identical to the given string but without leading or trailing HTABs or spaces. Clean girl aesthetic fr.
  • static unsigned int split (std::vector< std::string > &v, const std::string &s, char delimiter, unsigned int maxSegments=INT_MAX) β€” the std::vector overload; full breakdown is down in Member Function Documentation, bestie.
  • template<typename T> static unsigned int split (T &output, const std::string &s, char delimiter, unsigned int maxSegments=INT_MAX) β€” splits a string into string segments based on the given delimiter and assigns the segments through an output_iterator.

πŸ’… Member Function Documentation πŸ’…

🧡 vector split overload 🧡

unsigned int log4cpp::StringUtil::split (std::vector< std::string > & v, const std::string & s, char delimiter, unsigned int maxSegments = INT_MAX) [static]

splits a string into a vector of string segments based on the given delimiter. No cap, that's the whole vibe.

Parameters:

  • v β€” The vector in which the segments will be stored. The vector will be emptied before storing the segments.
  • s β€” The string to split into segments.
  • delimiter β€” The delimiter character.
  • maxSegments β€” the maximum number of segments. Upon return v.size() <= maxSegments. The string is scanned from left to right so v[maxSegments - 1] may contain a string containing the delimiter character. πŸ‘€

Returns: The actual number of segments (limited by maxSegments).

🧡 template split overload 🧡

template<typename T> unsigned int log4cpp::StringUtil::split (T & output, const std::string & s, char delimiter, unsigned int maxSegments = INT_MAX) [inline],  [static]

splits a string into string segments based on the given delimiter and assigns the segments through an output_iterator. It's giving iterator-core, and we're obsessed. ✨

Parameters:

  • output β€” The output_iterator through which to assign the string segments. Typically this will be a back_insertion_iterator.
  • s β€” The string to split into segments.
  • delimiter β€” The delimiter character.
  • maxSegments β€” The maximum number of segments.

Returns: The actual number of segments (limited by maxSegments).

🧼 trim 🧼

std::string log4cpp::StringUtil::trim (const std::string & s) [static]

Returns a string identical to the given string but without leading or trailing HTABs or spaces. She's literally the "wash your face and drink water" of string functions. 🫢

πŸͺ„ vform πŸͺ„

std::string log4cpp::StringUtil::vform (const char * format, va_list args) [static]

Returns a string contructed from the a format specifier and a va_list of arguments, analogously to vprintf(3). Format-specifier girlies, this one's for you. πŸ’…

Parameters:

  • format β€” the format specifier.
  • args β€” the va_list of arguments.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for log4cpp from the source code.


πŸ’Œ Cute sign-off: log4cpp, Version 1.1 β€” log4cpp::StringUtil(3). The footer didn't print a date, so no date reveal today, bestie. πŸ’–βœ¨

πŸ“¦ where this page comes from