EGDL2 2.1
Loading...
Searching...
No Matches
FullSerializer.fsResult Struct Reference

The result of some sort of operation. A result is either successful or not, but if it is successful then there may be a set of warnings/messages associated with it. These warnings describe the performed error recovery operations. More...

Collaboration diagram for FullSerializer.fsResult:

Public Member Functions

void AddMessage (string message)
 Adds a new message to this result.
 
void AddMessages (fsResult result)
 Adds only the messages from the other result into this result, ignoring the success/failure status of the other result.
 
fsResult Merge (fsResult other)
 Merges the other result into this one. If the other result failed, then this one too will have failed.
 
fsResult AssertSuccess ()
 A simply utility method that will assert that this result is successful. If it is not, then an exception is thrown.
 
fsResult AssertSuccessWithoutWarnings ()
 A simple utility method that will assert that this result is successful and that there are no warning messages. This throws an exception if either of those asserts are false.
 

Static Public Member Functions

static fsResult Warn (string warning)
 Create a result that is successful but contains the given warning message.
 
static fsResult Fail (string warning)
 Create a result that failed.
 
static fsResult operator+ (fsResult a, fsResult b)
 Only use this as +=!
 

Static Public Attributes

static fsResult Success
 A successful result.
 

Properties

bool Failed [get]
 Did this result fail? If so, you can see the reasons why in RawMessages.
 
bool Succeeded [get]
 Was the result a success? Note that even successful operations may have warning messages (RawMessages) associated with them.
 
bool HasWarnings [get]
 Does this result have any warnings? This says nothing about if it failed or succeeded, just if it has warning messages associated with it.
 
Exception AsException [get]
 Utility method to convert the result to an exception. This method is only defined is Failed returns true.
 

Detailed Description

The result of some sort of operation. A result is either successful or not, but if it is successful then there may be a set of warnings/messages associated with it. These warnings describe the performed error recovery operations.

Member Function Documentation

◆ AddMessage()

void FullSerializer.fsResult.AddMessage ( string message)
inline

Adds a new message to this result.

Parameters
message

◆ Merge()

fsResult FullSerializer.fsResult.Merge ( fsResult other)
inline

Merges the other result into this one. If the other result failed, then this one too will have failed.

Note that you can use += instead of this method so that you don't bury the actual method call that is generating the other fsResult.

Here is the caller graph for this function:

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