ost::Strin...::iterator(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::Strin...::iterator(3) β€” Library Functions Manual πŸ’–

okay bestie, buckle up, we're reading the ost::StringTokenizer::iterator manpage from the Library Functions Manual and honestly? she's a lil icon. let's get into it ✨


🌸 NAME 🌸

ost::StringTokenizer::iterator β€” the input forward iterator for tokens. that's her. that's the whole job. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <tokenizer.h>

✨ Public Member Functions ✨

  • iterator () β€” the plain default constructor, no drama πŸ’–
  • virtual ~iterator () β€” the destructor, virtual as always, doing her lil cleanup πŸŽ€
  • iterator (const iterator &i) β€” copy constructor. yes queen, duplicate thyself πŸ’…
  • iterator & operator= (const iterator &i) β€” assignment operator. one iterator becomes another's whole personality 🫢
  • iterator & operator++ () THROWS(NoSuchElementException) β€” shifts this iterator to the next token in the string. the way she just moves on to the next one 😌
  • const char * operator* () THROWS(NoSuchElementException) β€” returns the immutable string this iterator points to or '0' if no token is available (i.e. …) ⭐
  • char nextDelimiter () const β€” returns the next delimiter after the current token or ' ', if there are no following delimiters. peeking ahead, nosy but make it useful πŸ™ˆ
  • bool operator== (const iterator &other) const β€” compares to other iterator. are we the same? πŸ‘―
  • bool operator!= (const iterator &other) const β€” compares to other iterator. are we not the same? πŸ’€

πŸ‘‘ Friends πŸ‘‘

  • class StringTokenizer β€” friendship bracelet acquired 🫢

🧚 Detailed Description 🧚

The input forward iterator for tokens. that's the vibe. forward-only, token-by-token, no going back bestie, we live in the now ✨

πŸ’œ Author πŸ’œ

  • Henner Zeller β€” thank you for your service, king πŸ‘‘

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

ost::StringTokenizer::iterator::iterator () [inline]

the default one. no args, no notes, just vibes 🌸

virtual ost::StringTokenizer::iterator::~iterator () [inline], [virtual]

the destructor, and she's virtual, as she should be πŸ’…

ost::StringTokenizer::iterator::iterator (const iterator & i) [inline]

copy constructor. literally clone her, no cap πŸ’–


⭐ Member Function Documentation ⭐

char ost::StringTokenizer::iterator::nextDelimiter () const [inline]

returns the next delimiter after the current token or '\0', if there are no following delimiters. It returns the very next delimiter (even if skipAllDelim=true).

heads up bestie, the SYNOPSIS up top says ' ' for the no-following-delimiters case and this detailed bit says '\0' β€” that's just what the page says, both versions, no edits from me, iykyk 😭 keep it in mind fr fr

bool ost::StringTokenizer::iterator::operator!= (const iterator & other) const [inline]

compares to other iterator. Usually used to compare against the end() iterator. the classic "are we done yet" check, main character energy πŸ‘‘

const char* ost::StringTokenizer::iterator::operator* ()

returns the immutable string this iterator points to or '0' if no token is available (i.e. i == end()). Do not store pointers to this token, since it is invalidated for each iteration. If you need the token, copy it (e.g. with strdup());

⚠️ for real, do NOT hoard that pointer. she gets invalidated every single iteration. if you want to keep the token, copy it β€” like with strdup(). storing the raw pointer is giving chaos πŸ’€

iterator& ost::StringTokenizer::iterator::operator++ ()

shifts this iterator to the next token in the string. moving forward, always forward πŸ¦‹

iterator& ost::StringTokenizer::iterator::operator= (const iterator & i) [inline]

assignment operator. she is now her. slay πŸ’…

bool ost::StringTokenizer::iterator::operator== (const iterator & other) const [inline]

compares to other iterator. Usually used to compare against the end() iterator. same energy check ✨


friend class StringTokenizer [friend]

bestie privileges: fully granted. StringTokenizer is in the group chat 🫢


πŸ’– Author πŸ’–

Generated automatically by Doxygen for GNU CommonC++ from the source code. not a human hand in sight, and yet she ate πŸ”₯


and that's the whole page bestie, no cap, every flag and every function accounted for πŸŒΈπŸ’…βœ¨

okay so this page comes from GNU CommonC++, dated Sun Dec 27 2020, and it lives at ost::Strin...::iterator(3) in the manual β€” mwah, go forth and tokenize responsibly πŸ‘‘πŸ’–πŸŽ€

πŸ“¦ where this page comes from