Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
Assimp::LineSplitter Class Reference

Usage: More...

#include <LineSplitter.h>

Public Types

typedef size_t line_idx
 

Public Member Functions

line_idx get_index () const
 
StreamReaderLEget_stream ()
 access the underlying stream object More...
 
template<size_t N>
void get_tokens (const char *(&tokens)[N]) const
 extract the start positions of N tokens from the current line More...
 
template<size_t N>
AI_FORCE_INLINE void get_tokens (const char *(&tokens)[N]) const
 
 LineSplitter (const LineSplitter &)=delete
 
 LineSplitter (LineSplitter &&)=delete
 
 LineSplitter (StreamReaderLE &stream, bool skip_empty_lines=true, bool trim=true)
 construct from existing stream reader note: trim is always assumed true if skyp_empty_lines==true More...
 
bool match_start (const char *check)
 !strcmp((*this)->substr(0,strlen(check)),check) More...
 
 operator bool () const
 boolean context More...
 
 operator line_idx () const
 line indices are zero-based, empty lines are included More...
 
std::string operator* () const
 
LineSplitteroperator++ ()
 pseudo-iterator increment More...
 
LineSplitteroperator++ (int)
 
const std::string * operator-> () const
 member access More...
 
LineSplitteroperator= (const LineSplitter &)=delete
 
const char * operator[] (size_t idx) const
 get a pointer to the beginning of a particular token More...
 
void swallow_next_increment ()
 swallow the next call to ++, return the previous value. More...
 
 ~LineSplitter ()
 

Detailed Description

Usage:

for(LineSplitter splitter(stream);splitter;++splitter) {
if (*splitter == "hi!") {
...
}
else if (splitter->substr(0,5) == "hello") {
...
// access the third token in the line (tokens are space-separated)
if (strtol(splitter[2]) > 5) { .. }
}
ASSIMP_LOG_VERBOSE_DEBUG("Current line is: ", splitter.get_index());
}
#define ASSIMP_LOG_VERBOSE_DEBUG(...)
Definition: Logger.hpp:297
Usage:
Definition: LineSplitter.h:79

Member Typedef Documentation

◆ line_idx

Constructor & Destructor Documentation

◆ LineSplitter() [1/3]

AI_FORCE_INLINE Assimp::LineSplitter::LineSplitter ( StreamReaderLE stream,
bool  skip_empty_lines = true,
bool  trim = true 
)

construct from existing stream reader note: trim is always assumed true if skyp_empty_lines==true

◆ ~LineSplitter()

AI_FORCE_INLINE Assimp::LineSplitter::~LineSplitter ( )

◆ LineSplitter() [2/3]

Assimp::LineSplitter::LineSplitter ( const LineSplitter )
delete

◆ LineSplitter() [3/3]

Assimp::LineSplitter::LineSplitter ( LineSplitter &&  )
delete

Member Function Documentation

◆ get_index()

AI_FORCE_INLINE LineSplitter::line_idx Assimp::LineSplitter::get_index ( ) const

◆ get_stream()

AI_FORCE_INLINE StreamReaderLE & Assimp::LineSplitter::get_stream ( )

access the underlying stream object

◆ get_tokens() [1/2]

template<size_t N>
void Assimp::LineSplitter::get_tokens ( const char *(&)  tokens[N]) const

extract the start positions of N tokens from the current line

◆ get_tokens() [2/2]

template<size_t N>
AI_FORCE_INLINE void Assimp::LineSplitter::get_tokens ( const char *(&)  tokens[N]) const

◆ match_start()

AI_FORCE_INLINE bool Assimp::LineSplitter::match_start ( const char *  check)

!strcmp((*this)->substr(0,strlen(check)),check)

◆ operator bool()

AI_FORCE_INLINE Assimp::LineSplitter::operator bool ( ) const

boolean context

◆ operator line_idx()

AI_FORCE_INLINE Assimp::LineSplitter::operator line_idx ( ) const

line indices are zero-based, empty lines are included

◆ operator*()

AI_FORCE_INLINE std::string Assimp::LineSplitter::operator* ( ) const

◆ operator++() [1/2]

AI_FORCE_INLINE LineSplitter & Assimp::LineSplitter::operator++ ( )

pseudo-iterator increment

◆ operator++() [2/2]

AI_FORCE_INLINE LineSplitter & Assimp::LineSplitter::operator++ ( int  )

◆ operator->()

AI_FORCE_INLINE const std::string * Assimp::LineSplitter::operator-> ( ) const

member access

◆ operator=()

LineSplitter & Assimp::LineSplitter::operator= ( const LineSplitter )
delete

◆ operator[]()

AI_FORCE_INLINE const char * Assimp::LineSplitter::operator[] ( size_t  idx) const

get a pointer to the beginning of a particular token

◆ swallow_next_increment()

AI_FORCE_INLINE void Assimp::LineSplitter::swallow_next_increment ( )

swallow the next call to ++, return the previous value.


The documentation for this class was generated from the following file: