RSML.RSDocument Class¶
Represents a Red Sea Markup Language document.
Hierarchy¶
flowchart TB
RSDocument --> System.Object
Constructors¶
RSDocument contains 3 constructor methods.
RSDocument(System.String rsml)¶
Creates a new document from a System.String containing RSML.
Parameters¶
System.String rsml-
The RSML data to load, in the form of a
System.String.
RSDocument(StringReader reader)¶
Creates a new document from a StringReader containing RSML.
Parameters¶
StringReader reader-
The reader containing RSML.
RSDocument(RSParser parser)¶
Creates a new document from a already initialized parser.
Parameters¶
RSParser parser-
An instance of a Red Sea Markup Language parser.
Static Factories¶
RSDocument contains 2 static factory methods.
LoadRSMLFromFileIntoDocument(System.String filepath)¶
Loads a RSML file into a RSDocument.
Parameters¶
System.String filepath-
The path to the file to load.
Returns¶
RSDocument : The document containing ready-to-parse RSML.
NewFromFile(System.String filepath)¶
Creates a new document from a filepath.
Parameters¶
System.String filepath-
The path to the file to load.
Exceptions¶
FileNotFoundException-
The file could not be located.
Returns¶
RSDocument : The document containing ready-to-parse RSML.
Static Methods¶
RSDocument contains 3 static (non-factory) methods.
LoadRSMLFromFile(System.String filepath)¶
Loads a RSML file into a System.String.
Parameters¶
System.String filepath-
The path to the file to load.
Returns¶
System.String : The text contained in the file.
LoadRSMLFromFileAsync(System.String filepath)¶
Loads a RSML file into a System.String, asynchronously.
Parameters¶
System.String filepath-
The path to the file to load.
Returns¶
System.Threading.Tasks.Task<System.String> : The text contained in the file.
SaveRSMLToFile(System.String filepath)¶
Saves RSML into a file.
Parameters¶
System.String filepath-
The path to the file to write the RSML data to.
Instance Methods¶
RSDocument contains 6 instance methods.
EvaluateDocument()¶
Parses and evaluates the document.
Returns¶
System.String-
The System.String matching the return value of the only match that had a primary operator.
null-
There were no primary matches.
EvaluateDocument(System.String lineSeparation)¶
Parses and evaluates the document.
Parameters¶
System.String lineSeparation-
The custom line separation character to use, instead of
System.Environment.NewLine.
Returns¶
System.String-
The System.String matching the return value of the only match that had a primary operator.
null-
There were no primary matches.
EvaluateDocument(bool expandAny, System.String? lineSeparation = null)¶
Parses and evaluates the document.
Parameters¶
bool expandAny-
If set to
true, expandsanyinto Regex expression.+, indicating that any RID will be a match. System.String? lineSeparation = null-
The custom line separation character to use, instead of
System.Environment.NewLine. Defaults tonull. Ifnull, falls back toSystem.Environment.NewLine.
Returns¶
System.String-
The System.String matching the return value of the only match that had a primary operator.
null-
There were no primary matches.
EvaluateDocument(System.String customRid, System.String? lineSeparation = null)¶
Parses and evaluates the document.
Parameters¶
System.String customRid-
A custom RID to pass to the parser, instead of the host's RID.
System.String? lineSeparation = null-
The custom line separation character to use, instead of
System.Environment.NewLine. Defaults tonull. Ifnull, falls back toSystem.Environment.NewLine.
Returns¶
System.String-
The System.String matching the return value of the only match that had a primary operator.
null-
There were no primary matches.
EvaluateDocument(System.String customRid, bool expandAny, System.String? lineSeparation = null)¶
Parses and evaluates the document.
Parameters¶
System.String customRid-
A custom RID to pass to the parser, instead of the host's RID.
bool expandAny-
If set to
true, expandsanyinto Regex expression.+, indicating that any RID will be a match. System.String? lineSeparation = null-
The custom line separation character to use, instead of
System.Environment.NewLine. Defaults tonull. Ifnull, falls back toSystem.Environment.NewLine.
Returns¶
System.String-
The System.String matching the return value of the only match that had a primary operator.
null-
There were no primary matches.
ToString()¶
Note
ToString() overwrites parent class' System.Object.ToString().
Returns the document's contents.
Returns¶
System.String : The loaded RSML.