1
0
mirror of https://github.com/Halofreak1990/XFXFramework synced 2024-12-26 13:49:34 +01:00
Halofreak1990 e7a47c8ed9 Revamped the List class so that it can (properly) handle pointers as well
Added 'ValueTypes' Single and Double
Added some components in the new System::Net namespace
Added the Console class, which can be used to output text to the screen
Updated a bunch of structs to include the IComparable and IEquatable interfaces, and inheritance from Object to allow better interoperability between container classes and other types
Replaced all exception handling code with a report to stdout.txt - this will, I hope, eventually be reversed, but as of yet, there is no support for exceptions.

BEWARE! Even though all libraries correctly compile, you cannot use any class/structure that inherits from a template class, because stupid G++ wants to include exception handling for each template.
2011-11-07 01:29:50 +00:00

61 lines
2.2 KiB
C++

/********************************************************
* File.h *
* *
* XFX File definition file *
* Copyright © XFX Team. All Rights Reserved *
********************************************************/
#ifndef _SYSTEM_IO_FILE_
#define _SYSTEM_IO_FILE_
#include "Enums.h"
#include "../Object.h"
#if ENABLE_XBOX
#include <hal/fileio.h>
#endif
namespace System
{
class DateTime;
namespace IO
{
class FileStream;
class StreamReader;
class StreamWriter;
// Provides static methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects.
class File : virtual Object
{
private:
#if ENABLE_XBOX
static int FileAttributeInfo(char* path, PXBOX_FIND_DATA data, bool tryagain, bool returnErrorOnNotFound);
#else
static int FileAttributeInfo(char* path, data, bool tryagain, bool returnErrorOnNotFound);
#endif
public:
static StreamWriter AppendText(char* path) __attribute__((nonnull (1)));
static void Copy(char* sourceFileName, char* destFileName) __attribute__((nonnull (1, 2)));
static void Copy(char* sourceFileName, char* destFileName, bool overwrite) __attribute__((nonnull (1, 2)));
static FileStream Create(char* path);
static FileStream Create(char* path, int bufferSize);
static StreamWriter CreateText(char* path) __attribute__((nonnull (1)));
static void Delete(char* path) __attribute__((nonnull (1)));
static bool Exists(char* path);
static DateTime GetCreationTime(char* path);
static DateTime GetLastAccessTime(char* path);
static DateTime GetLastWriteTime(char* path);
static void Move(char* sourceFileName, char* destFileName) __attribute__((nonnull (1, 2)));
static FileStream Open(char* path, FileMode_t mode);
static FileStream Open(char* path, FileMode_t mode, FileAccess_t access);
static FileStream Open(char* path, FileMode_t mode, FileAccess_t access, FileShare_t share);
static FileStream OpenRead(char* path);
static StreamReader OpenText(char* path) __attribute__((nonnull (1)));
static FileStream OpenWrite(char* path);
};
}
}
#endif //_SYSTEM_IO_FILE_