Class PlainText
Allows in/out operations and/or data validations with plaint text files.
Inherited Members
Namespace: AutoCheck.Core.Connectors
Assembly: AutoCheck.Core.dll
Syntax
public class PlainText : Base
Constructors
| Improve this Doc View SourcePlainText(Utils.OS, String, String, String, Int32, String)
Declaration
public PlainText(Utils.OS remoteOS, string host, string username, string password, int port, string filePath)
Parameters
Type | Name | Description |
---|---|---|
Utils.OS | remoteOS | |
System.String | host | |
System.String | username | |
System.String | password | |
System.Int32 | port | |
System.String | filePath |
PlainText(Utils.OS, String, String, String, String)
Declaration
public PlainText(Utils.OS remoteOS, string host, string username, string password, string filePath)
Parameters
Type | Name | Description |
---|---|---|
Utils.OS | remoteOS | |
System.String | host | |
System.String | username | |
System.String | password | |
System.String | filePath |
PlainText(String)
Creates a new connector instance.
Declaration
public PlainText(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path. |
Properties
| Improve this Doc View SourceplainTextDoc
The plain text document content.
Declaration
public PlainText.PlainTextDocument plainTextDoc { get; }
Property Value
Type | Description |
---|---|
PlainText.PlainTextDocument |
Methods
| Improve this Doc View SourceCount(String)
Gets how many matches can be found within the document content using a regular expression.
Declaration
public int Count(string regex)
Parameters
Type | Name | Description |
---|---|---|
System.String | regex | The regular expression which will be used to search the content. |
Returns
Type | Description |
---|---|
System.Int32 | The number of matches. |
Dispose()
Disposes the object releasing its unmanaged properties.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceFind(String)
Gets the matches found within the document content using a regular expression.
Declaration
public string[] Find(string regex)
Parameters
Type | Name | Description |
---|---|---|
System.String | regex | The regular expression which will be used to search the content. |
Returns
Type | Description |
---|---|
System.String[] | A set of matches. |
Replace(String, String)
Replaces every match within the given content with the given replacement.
Declaration
public void Replace(string replacement, string regex)
Parameters
Type | Name | Description |
---|---|---|
System.String | replacement | Every match will be replaced with this. |
System.String | regex | The regular expression which will be used to search the content. |
Store(String)
Stores the current content into a local file.
Declaration
public void Store(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path where the file will be stored, file and folder will be created if not exists. |
Store(String, String)
Stores the current content into a local file.
Declaration
public void Store(string folderPath, string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderPath | The folder where the file will be stored, it will be created if not exists. |
System.String | fileName | The file name, it will be replaced if exists. |