VTK  9.4.20241222
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
vtkResourceParser Class Reference

Helper class to perform formatted input from vtkResourceStream. More...

#include <vtkResourceParser.h>

Inheritance diagram for vtkResourceParser:
[legend]
Collaboration diagram for vtkResourceParser:
[legend]

Classes

struct  ReadToResult
 Structure returned by Read*To functions. More...
 

Public Types

using PredicateType = std::function< bool(char c)>
 predicate type used by ReadUntil and DiscardUntil functions
 
using DataReceiverType = std::function< void(const char *data, std::size_t size)>
 receiver type used by ReadUntil function
 
typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
vtkResourceParserNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
void SetStream (vtkResourceStream *stream)
 Set the stream to parse.
 
vtkResourceStreamGetStream () const
 Get the parsed stream.
 
vtkTypeInt64 Seek (vtkTypeInt64 pos, vtkResourceStream::SeekDirection dir)
 Move stream cursor.
 
vtkTypeInt64 Tell ()
 Get stream cursor position from parser context.
 
std::size_t Read (char *output, std::size_t size)
 Read data from the input stream.
 
void Reset ()
 Reset parser internal state.
 
template<typename T , typename std::enable_if< IsSupported< T >(), bool >::type = true>
vtkParseResult Parse (T &output, const PredicateType &discardPred=DiscardWhitespace)
 Main parsing function.
 
vtkParseResult ReadUntil (const PredicateType &discardPred, const DataReceiverType &receiver, std::size_t limit=NoLimit)
 Read data from the input stream until the perdicate is met.
 
template<typename OutputIt >
ReadToResult< OutputIt > ReadUntilTo (const PredicateType &discardPred, OutputIt output, std::size_t limit=NoLimit)
 Read data from the input stream to any output iterator until the perdicate is met.
 
template<typename ForwardIt >
ReadToResult< ForwardIt > ReadUntilTo (const PredicateType &discardPred, ForwardIt begin, ForwardIt end)
 Read data from the input stream to any output range until the perdicate is met.
 
vtkParseResult DiscardUntil (const PredicateType &pred)
 Discard data from the input stream until the perdicate is met.
 
vtkParseResult ReadLine (const DataReceiverType &receiver, std::size_t limit=NoLimit)
 Read an entire line from the input stream.
 
template<typename Allocator >
vtkParseResult ReadLine (std::basic_string< char, std::char_traits< char >, Allocator > &output, std::size_t limit=NoLimit)
 Read an entire line from the input stream.
 
template<typename OutputIt >
ReadToResult< OutputIt > ReadLineTo (OutputIt output, std::size_t limit=NoLimit)
 Read an entire line from the input stream.
 
template<typename ForwardIt >
ReadToResult< ForwardIt > ReadLineTo (ForwardIt begin, ForwardIt end)
 Read an entire line from the input stream.
 
vtkParseResult DiscardLine (std::size_t limit=NoLimit)
 Discard a line from the input stream.
 
bool GetStopOnNewLine () const
 Specifies if the parser should handle newlines as a special token to stop on.
 
void SetStopOnNewLine (bool on)
 Specifies if the parser should handle newlines as a special token to stop on.
 
virtual void StopOnNewLineOn ()
 Specifies if the parser should handle newlines as a special token to stop on.
 
virtual void StopOnNewLineOff ()
 Specifies if the parser should handle newlines as a special token to stop on.
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on.
 
virtual void DebugOff ()
 Turn debugging output off.
 
bool GetDebug ()
 Get the value of the debug flag.
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag.
 
virtual void Modified ()
 Update the modification time for this object.
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output.
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method.
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes.
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes.
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string.
 
virtual std::string GetObjectDescription () const
 The object description printed in messages and PrintSelf output.
 
virtual vtkTypeBool IsA (const char *name)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
virtual void Delete ()
 Delete a VTK object.
 
virtual void FastDelete ()
 Delete a reference to this object.
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream.
 
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object).
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object).
 
int GetReferenceCount ()
 Return the current reference count of this object.
 
void SetReferenceCount (int)
 Sets the reference count.
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space.
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not.
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkResourceParserSafeDownCast (vtkObjectBase *o)
 
static vtkResourceParserNew ()
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes.
 
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class.
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space.
 

Static Public Attributes

static constexpr std::size_t NoLimit = (std::numeric_limits<std::size_t>::max)()
 
static const PredicateType DiscardNone
 Prebuild predicates for common cases.
 
static const PredicateType DiscardWhitespace
 Prebuild predicates for common cases.
 
static const PredicateType DiscardNonAlphaNumeric
 Prebuild predicates for common cases.
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkResourceParser ()=default
 Constructor.
 
 ~vtkResourceParser () override=default
 
 vtkResourceParser (const vtkResourceParser &)=delete
 
vtkResourceParseroperator= (const vtkResourceParser &)=delete
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events.
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events.
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void RegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
virtual void ObjectFinalize ()
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Helper class to perform formatted input from vtkResourceStream.

vtkResourceParser is a helper class that format input from an associated vtkResourceResource. This class defines function to read integers, floats, booleans and strings. Other utility functions such as ReadUntil or DiscardUntil are also available.

Quick how to:

Definition at line 57 of file vtkResourceParser.h.

Member Typedef Documentation

◆ PredicateType

using vtkResourceParser::PredicateType = std::function<bool(char c)>

predicate type used by ReadUntil and DiscardUntil functions

Definition at line 63 of file vtkResourceParser.h.

◆ DataReceiverType

using vtkResourceParser::DataReceiverType = std::function<void(const char* data, std::size_t size)>

receiver type used by ReadUntil function

Definition at line 82 of file vtkResourceParser.h.

◆ Superclass

Definition at line 167 of file vtkResourceParser.h.

Constructor & Destructor Documentation

◆ vtkResourceParser() [1/2]

vtkResourceParser::vtkResourceParser ( )
protecteddefault

Constructor.

◆ ~vtkResourceParser()

vtkResourceParser::~vtkResourceParser ( )
overrideprotecteddefault

◆ vtkResourceParser() [2/2]

vtkResourceParser::vtkResourceParser ( const vtkResourceParser )
protecteddelete

Member Function Documentation

◆ IsTypeOf()

static vtkTypeBool vtkResourceParser::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkResourceParser::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

◆ SafeDownCast()

static vtkResourceParser * vtkResourceParser::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkResourceParser::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkResourceParser * vtkResourceParser::NewInstance ( ) const

◆ PrintSelf()

void vtkResourceParser::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

◆ New()

static vtkResourceParser * vtkResourceParser::New ( )
static

◆ SetStream()

void vtkResourceParser::SetStream ( vtkResourceStream stream)
inline

Set the stream to parse.

Automatically reset the parser state if stream != this->GetStream(). Parsing starts at the stream position when set.

Parameters
streama vtkResourceStream

Definition at line 179 of file vtkResourceParser.h.

◆ GetStream()

vtkResourceStream * vtkResourceParser::GetStream ( ) const
inline

Get the parsed stream.

Returns
the vtkResourceStream used by this parser

Definition at line 186 of file vtkResourceParser.h.

◆ GetStopOnNewLine()

bool vtkResourceParser::GetStopOnNewLine ( ) const
inline

Specifies if the parser should handle newlines as a special token to stop on.

When is property is true the function Parse will break when encountering a new line. When breaking will not modify output value and will return vtkParseResult::EndOfLine

Default value: false

Definition at line 197 of file vtkResourceParser.h.

◆ SetStopOnNewLine()

void vtkResourceParser::SetStopOnNewLine ( bool  on)
inline

Specifies if the parser should handle newlines as a special token to stop on.

When is property is true the function Parse will break when encountering a new line. When breaking will not modify output value and will return vtkParseResult::EndOfLine

Default value: false

Definition at line 198 of file vtkResourceParser.h.

◆ StopOnNewLineOn()

virtual void vtkResourceParser::StopOnNewLineOn ( )
virtual

Specifies if the parser should handle newlines as a special token to stop on.

When is property is true the function Parse will break when encountering a new line. When breaking will not modify output value and will return vtkParseResult::EndOfLine

Default value: false

◆ StopOnNewLineOff()

virtual void vtkResourceParser::StopOnNewLineOff ( )
virtual

Specifies if the parser should handle newlines as a special token to stop on.

When is property is true the function Parse will break when encountering a new line. When breaking will not modify output value and will return vtkParseResult::EndOfLine

Default value: false

◆ Seek()

vtkTypeInt64 vtkResourceParser::Seek ( vtkTypeInt64  pos,
vtkResourceStream::SeekDirection  dir 
)
inline

Move stream cursor.

Calling Read or Seek on the stream associated to the parser may break the parser context and result in unexpected behaviour. To prevent this, Reset must be called if the stream is externally modified before a Parse.

This function will take into account the parser context. This function will move the stream and reset the parser context if needed, as-if by calling this->GetStream()->Seek(pos, dir) followed by this->Reset(), but may be more efficient.

Parameters
posSeeked position, same as vtkResourceStream::Seek
dirSeek direction, same as vtkResourceStream::Seek
Returns
The position of the cursor from parser context, see Tell. -1 if associated stream does not support seeking.

Definition at line 218 of file vtkResourceParser.h.

◆ Tell()

vtkTypeInt64 vtkResourceParser::Tell ( )
inline

Get stream cursor position from parser context.

Tell() will give the real position of the cursor from the parser context. vtkResourceParser will buffer data read for the stream to parse it, this is the context. Because of this, the stream position will always by "in advance" of the parser real input position. this->Tell() will always be lesser or equal to this->GetStream()->Tell().

Returns
The position of the cursor from parser context. -1 if associated stream does not support seeking.

Definition at line 235 of file vtkResourceParser.h.

◆ Read()

std::size_t vtkResourceParser::Read ( char *  output,
std::size_t  size 
)
inline

Read data from the input stream.

Read at most size bytes from input stream. Read less than size bytes if EOS is reached. If less than size bytes are read, bytes outside of [0; returnSize[ are not modified. It is the equivalent of the Read function of vtkResourceStream, but it takes parser context into account.

Returns
the number of read bytes

Definition at line 247 of file vtkResourceParser.h.

◆ Reset()

void vtkResourceParser::Reset ( )
inline

Reset parser internal state.

This may be required in case the stream has been modified using Seek, Read or any other subclass specific member function the will break the internal state, e.g. changing the input file. Using multiple parsers on the same stream is valid as long as each parser get reset before use each time another one was used, and that only one parser is used concurrently.

Definition at line 258 of file vtkResourceParser.h.

◆ Parse()

template<typename T , typename std::enable_if< IsSupported< T >(), bool >::type = true>
vtkParseResult vtkResourceParser::Parse ( T &  output,
const PredicateType discardPred = DiscardWhitespace 
)
inline

Main parsing function.

Parsing operation:

The parsing operation is divided in 2 Steps:

  1. Leading discarded characters are discarded:
    • A character is a discarded characters if discardPred returns true.
    • If no discardPred is specified, the default predicate is DiscardWhitespace
    • If StopOnNewLine is true, this function will return vtkParseResult::EndOfLine if it encounters a new line regardless of what discardPred returns for \n and \r.
    • If end of stream is reached, returns vtkParseResult::EndOfStream.
  2. The value is parsed using different algorithms, depending on its type, see below.

vtkParseResult::EndOfStream will only be signaled if it is reached during step 1. If it is reached during step 2, it will return the result of the decoding operation, and return vtkParseResult::EndOfStream during the next Parse step 1.


Supported types: Supported types are char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double, bool and std::string.

char parsing will read a byte and will return the value as-is.

std::string parsing reads characters until discardPred returns true. This last character is not appended to the string nor discarded from input.

Other types are parsed using vtkValueFromString.

Parameters
outputA reference to the variable where the result will be written. Parsed type can be determined from this.
discardPredThe discard predicate to use during Step 1
Returns
vtkParseResult::Error if parsing of value failed, in that case, the internal context is not modified by Step 2, next Parse will try to parse the same data as long as the discard predicate is semantically the same. vtkParseResult::EndOfLine if a new line is reached during Step 1, the new line marker will be consumed. vtkParseResult::EndOfStream if no data remains after Step 1. vtkParseResult::Ok otherwise.

Definition at line 304 of file vtkResourceParser.h.

◆ ReadUntil()

vtkParseResult vtkResourceParser::ReadUntil ( const PredicateType discardPred,
const DataReceiverType receiver,
std::size_t  limit = NoLimit 
)
inline

Read data from the input stream until the perdicate is met.

Parameters
discardPredfunction matching bool(char c) prototype of PredicateType.
receiverfunction matching the void(const char* data, std::size_t size) prototype of DataReceiverType.
limitmaximum amount of character to read, useful for statically sized buffers (default: no limit)
Returns
vtkParseResult::EndOfStream if EOS is reached before pred is met or limit is reached. vtkParseResult::Limit if limit is reached before pred is met. vtkParseResult::Ok otherwise.

Definition at line 325 of file vtkResourceParser.h.

◆ ReadUntilTo() [1/2]

template<typename OutputIt >
ReadToResult< OutputIt > vtkResourceParser::ReadUntilTo ( const PredicateType discardPred,
OutputIt  output,
std::size_t  limit = NoLimit 
)
inline

Read data from the input stream to any output iterator until the perdicate is met.

Parameters
discardPredfunction matching bool(char c) prototype of PredicateType.
outputOutput iterator where data will be written
limitmaximum amount of character to read, useful for statically sized buffers. (default: no limit)
Returns
A ReadToResult.

Definition at line 361 of file vtkResourceParser.h.

◆ ReadUntilTo() [2/2]

template<typename ForwardIt >
ReadToResult< ForwardIt > vtkResourceParser::ReadUntilTo ( const PredicateType discardPred,
ForwardIt  begin,
ForwardIt  end 
)
inline

Read data from the input stream to any output range until the perdicate is met.

Parameters
discardPredfunction matching bool(char c) prototype of PredicateType
beginForward iterator where data will be written (range begin)
endForward iterator one past the last available output space (range end)
Returns
A ReadToResult

Definition at line 388 of file vtkResourceParser.h.

◆ DiscardUntil()

vtkParseResult vtkResourceParser::DiscardUntil ( const PredicateType pred)
inline

Discard data from the input stream until the perdicate is met.

Parameters
predfunction matching bool(char c) prototype of PredicateType

vtkParseResult::EndOfStream if EOS is reached before pred is met. vtkParseResult::Ok otherwise.

Definition at line 402 of file vtkResourceParser.h.

◆ ReadLine() [1/2]

vtkParseResult vtkResourceParser::ReadLine ( const DataReceiverType receiver,
std::size_t  limit = NoLimit 
)
inline

Read an entire line from the input stream.

This function is similar to std::getline or std::fgets. This function handles both \r, \r\n and \n. The new line marker, either \r, \r\n or \n, will be discarded. i.e. won't be passed to receiver nor kept in input stream.

Return value will be false only if the stream does not contains any characters:

  • \n, \r and \r\n will return true, after calling receiver once with size == 0.
  • "" will return false without calling receiver at all

When limit is reached right before an end of line identifier, it won't be discarded:

  • "abc\n" with limit == 3 will give "abc" to receiver and keep "\n" for the next operation.
Parameters
receiverfunction matching the void(const char* data, std::size_t size) prototype of DataReceiverType.
limitmaximum amount of character to extract
Returns
vtkParseResult::EndOfStream if EOS is reached before any character is read, vtkParseResult::Limit if limit is reached before an end of line marker, vtkParseResult::EndOfLine otherwise. This function never returns vtkParseResult::Ok, vtkParseResult::EndOfLine indicates success.

Definition at line 433 of file vtkResourceParser.h.

◆ ReadLine() [2/2]

template<typename Allocator >
vtkParseResult vtkResourceParser::ReadLine ( std::basic_string< char, std::char_traits< char >, Allocator > &  output,
std::size_t  limit = NoLimit 
)
inline

Read an entire line from the input stream.

Behaves like ReadLine(const DataReceiverType& receiver, std::size_t limit) except that the output data is written to given std::string. This is the closest function to std::getline.

Parameters
outputstd::string to write line to, it is automatically cleared and resized
limitmaximum amount of character to extract
Returns
vtkParseResult::EndOfStream if EOS is reached before pred is met or limit is reached, vtkParseResult::Limit if limit is reached before pred is met, vtkParseResult::EndOfLine otherwise. This function never returns vtkParseResult::Ok, vtkParseResult::EndOfLine indicates success.

Definition at line 454 of file vtkResourceParser.h.

◆ ReadLineTo() [1/2]

template<typename OutputIt >
ReadToResult< OutputIt > vtkResourceParser::ReadLineTo ( OutputIt  output,
std::size_t  limit = NoLimit 
)
inline

Read an entire line from the input stream.

Behaves like ReadLine(const DataReceiverType& receiver, std::size_t limit) except that the output data is written to given output iterator.

Parameters
outputOutput iterator to write line to
limitmaximum amount of character to extract
Returns
A ReadUntilToResult. This function never returns vtkParseResult::Ok, vtkParseResult::EndOfLine indicates success.

Definition at line 476 of file vtkResourceParser.h.

◆ ReadLineTo() [2/2]

template<typename ForwardIt >
ReadToResult< ForwardIt > vtkResourceParser::ReadLineTo ( ForwardIt  begin,
ForwardIt  end 
)
inline

Read an entire line from the input stream.

Behaves like ReadLine(const DataReceiverType& receiver, std::size_t limit) except that the output data is written to given range and limit is determined by end.

Parameters
beginForward iterator where data will be written (range begin)
endForward iterator one past the last available output space (range end)
Returns
A ReadUntilToResult. This function never returns vtkParseResult::Ok, vtkParseResult::EndOfLine indicates success.

Definition at line 504 of file vtkResourceParser.h.

◆ DiscardLine()

vtkParseResult vtkResourceParser::DiscardLine ( std::size_t  limit = NoLimit)
inline

Discard a line from the input stream.

Parameters
limitmaximum amount of character to discard

vtkParseResult::EndOfStream if EOS is reached before any character is discarded, vtkParseResult::Limit if limit is reached before an end of line marker, vtkParseResult::EndOfLine otherwise. This function never returns vtkParseResult::Ok, vtkParseResult::EndOfLine indicates success.

Definition at line 519 of file vtkResourceParser.h.

◆ operator=()

vtkResourceParser & vtkResourceParser::operator= ( const vtkResourceParser )
protecteddelete

Member Data Documentation

◆ DiscardNone

const PredicateType vtkResourceParser::DiscardNone
static

Prebuild predicates for common cases.

DiscardNone: discard no character before parsing. DiscardWhitespace: discard \n, \r, \t, \v, \f and spaces. This is the default predicate. DiscardNonAlphaNumeric: discard everything except [a-z], [A-Z] and [0-9].

Definition at line 74 of file vtkResourceParser.h.

◆ DiscardWhitespace

const PredicateType vtkResourceParser::DiscardWhitespace
static

Prebuild predicates for common cases.

DiscardNone: discard no character before parsing. DiscardWhitespace: discard \n, \r, \t, \v, \f and spaces. This is the default predicate. DiscardNonAlphaNumeric: discard everything except [a-z], [A-Z] and [0-9].

Definition at line 75 of file vtkResourceParser.h.

◆ DiscardNonAlphaNumeric

const PredicateType vtkResourceParser::DiscardNonAlphaNumeric
static

Prebuild predicates for common cases.

DiscardNone: discard no character before parsing. DiscardWhitespace: discard \n, \r, \t, \v, \f and spaces. This is the default predicate. DiscardNonAlphaNumeric: discard everything except [a-z], [A-Z] and [0-9].

Definition at line 76 of file vtkResourceParser.h.

◆ NoLimit

constexpr std::size_t vtkResourceParser::NoLimit = (std::numeric_limits<std::size_t>::max)()
staticconstexpr

Definition at line 84 of file vtkResourceParser.h.


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