rili::stream::OperationResult Class Reference

Public Types

enum  Brief {
  OK, WritableEnd, OutOfRange, UnexpectedData,
  ReadableEnd
}
 

Public Member Functions

 OperationResult ()
 
 OperationResult (Brief brief, std::exception_ptr eptr)
 
 operator bool () const
 
Brief brief () const
 
std::exception_ptr exception () const
 

Member Enumeration Documentation

The Brief enum is used to check rough information about failure reason.

Values description:

  • OK : no error
  • WritableEnd : unexpected end of writable stream underlying object - not all data may be flushed
  • OutOfRange : read operation cannot be completed because provided type cannot hold value visible in stream (overflow, to small variable, value bigger/smaller than provided type max/min etc.)
  • UnexpectedData: unexpected character during stream processing like 'y' character as first in number
  • ReadableEnd : unexpected end of readable stream underlying object - not all data may be correctly retrieved from stream

Constructor & Destructor Documentation

rili::stream::OperationResult::OperationResult ( )
inline

OperationResult default ctor - no error.

rili::stream::OperationResult::OperationResult ( Brief  brief,
std::exception_ptr  eptr 
)
inline

OperationResult ctor which used to indicate error during stream operation processing.

Parameters
briefbrief error description
eptrpointer to exception with details about error

Member Function Documentation

Brief rili::stream::OperationResult::brief ( ) const
inline

brief used to retrieve Brief information about failure

Returns
brief failure reason
std::exception_ptr rili::stream::OperationResult::exception ( ) const
inline

exception used to retrieve detailed information about failure

Returns
exception pointer holding detailed failure reason
rili::stream::OperationResult::operator bool ( ) const
inline

operator bool indicate if operation was successful


The documentation for this class was generated from the following file:
  • rili/stream/OperationResult.hpp