52 lines
1.6 KiB
C#
52 lines
1.6 KiB
C#
//-----------------------------------------------------------------------------
|
|
// <copyright file="AbstractFile.cs" company="BTU/IIT">
|
|
// Company copyright tag.
|
|
// </copyright>
|
|
// <author>fiedlchr</author>
|
|
// <sience>03.05.2013</sience>
|
|
//-----------------------------------------------------------------------------
|
|
namespace CampusAppWPortalLib8.Utility
|
|
{
|
|
/// <summary>
|
|
/// File class.
|
|
/// </summary>
|
|
public abstract class AbstractFile
|
|
{
|
|
#region Events
|
|
|
|
/// <summary>
|
|
/// Delegation of the write callback function prototype.
|
|
/// </summary>
|
|
public delegate void WriteCallbackFunc();
|
|
|
|
#endregion
|
|
|
|
#region Method
|
|
|
|
#region public
|
|
|
|
/// <summary>Read data from file to a string.</summary>
|
|
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
|
/// <returns>data string.</returns>
|
|
public abstract byte[] ReadFile();
|
|
|
|
/// <summary>Write bytes to the file.</summary>
|
|
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
|
/// <param name="data"> data byte array.</param>
|
|
/// <param name="onSavedCallback"> callback function, called after writing is done.</param>
|
|
/// <param name="onFailedCallback">callback function, called when writing failed.</param>
|
|
public abstract void WriteFile(byte[] data, WriteCallbackFunc onSavedCallback, WriteCallbackFunc onFailedCallback);
|
|
|
|
/// <summary>
|
|
/// Check if a file is existing.
|
|
/// </summary>
|
|
/// <returns>true, if file exists, otherwise false</returns>
|
|
public abstract bool Exist();
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#endregion
|
|
}
|
|
} |