summaryrefslogtreecommitdiffhomepage
path: root/Public/Developer/System.Core/Headers/File.hxx
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-26 05:16:48 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-26 05:16:48 +0100
commit1cd930c0c72f215101300dfcc5860800a474362d (patch)
tree78b3a29c8d9936baaa78b628e0862eb6546c56d8 /Public/Developer/System.Core/Headers/File.hxx
parent4bac72356c29f6f92c0d0df40e1aef09a4216d56 (diff)
Kernel: Adding IPC support.
Kernel: Adding better framebuffer support. Kernel: Expose part of CFKit' URL API. System.Core: Rename most of API types to their <Prefix> with Ref at the end. System.Core: Add API to Window.hxx System.Driver: Add Driver SDK. Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Developer/System.Core/Headers/File.hxx')
-rw-r--r--Public/Developer/System.Core/Headers/File.hxx47
1 files changed, 30 insertions, 17 deletions
diff --git a/Public/Developer/System.Core/Headers/File.hxx b/Public/Developer/System.Core/Headers/File.hxx
index 06c2a22e..f76dbb60 100644
--- a/Public/Developer/System.Core/Headers/File.hxx
+++ b/Public/Developer/System.Core/Headers/File.hxx
@@ -9,13 +9,13 @@
#include <System.Core/Headers/Defines.hxx>
+#define kFileOpenInterface 10
+#define kFileAliasInterface 11
+
namespace System {
class FileInterface;
class DirectoryInterface;
-typedef IntPtrType SymlinkType;
-typedef IntPtrType FileType;
-typedef IntPtrType DirectoryType;
typedef IntPtrType FSRef;
enum {
@@ -31,13 +31,17 @@ enum {
class FileInterface final {
public:
explicit FileInterface(const char *path) {
- mHandle = kApplicationObject->Invoke(kApplicationObject, kProcessCallOpenHandle,
- 0, path);
+ CA_MUST_PASS(path);
+
+ mHandle = kApplicationObject->Invoke(
+ kApplicationObject, kProcessCallOpenHandle, kFileOpenInterface, path);
}
~FileInterface() {
- kApplicationObject->Invoke(kApplicationObject, kProcessCallCloseHandle, 0,
- mHandle);
+ CA_MUST_PASS(kApplicationObject);
+
+ kApplicationObject->Invoke(kApplicationObject, kProcessCallCloseHandle,
+ kFileOpenInterface, mHandle);
}
public:
@@ -45,17 +49,19 @@ class FileInterface final {
public:
PtrVoidType Read(UIntPtrType off, SizeType sz) {
- return (PtrVoidType)kApplicationObject->Invoke(kApplicationObject, mHandle, 2,
- off, sz);
+ return (PtrVoidType)kApplicationObject->Invoke(kApplicationObject, mHandle,
+ 2, off, sz);
}
+
PtrVoidType Read(SizeType sz) {
- return (PtrVoidType)kApplicationObject->Invoke(kApplicationObject, mHandle, 3,
- sz);
+ return (PtrVoidType)kApplicationObject->Invoke(kApplicationObject, mHandle,
+ 3, sz);
}
void Write(PtrVoidType buf, UIntPtrType off, SizeType sz) {
kApplicationObject->Invoke(kApplicationObject, mHandle, 4, buf, off, sz);
}
+
void Write(PtrVoidType buf, SizeType sz) {
kApplicationObject->Invoke(kApplicationObject, mHandle, 5, buf, sz);
}
@@ -63,14 +69,21 @@ class FileInterface final {
void Seek(UIntPtrType off) {
kApplicationObject->Invoke(kApplicationObject, mHandle, 5);
}
+
void Rewind() { kApplicationObject->Invoke(kApplicationObject, mHandle, 6); }
public:
- const char *MIME();
- void MIME(const char *mime);
+ const char *MIME() {
+ return (const char *)kApplicationObject->Invoke(kApplicationObject, mHandle,
+ 7);
+ }
+
+ void MIME(const char *mime) {
+ kApplicationObject->Invoke(kApplicationObject, mHandle, 8, mime);
+ }
private:
- FileType mHandle;
+ FSRef mHandle;
};
typedef FileInterface *FilePtr;
@@ -93,12 +106,12 @@ class FileException : public SystemException {
const char *mReason{"System.Core: FileException: Catastrophic failure!"};
};
-inline IntPtrType MakeSymlink(const char *from, const char *outputWhere) {
+inline IntPtrType FSMakeAlias(const char *from, const char *outputWhere) {
CA_MUST_PASS(from);
CA_MUST_PASS(outputWhere);
- return kApplicationObject->Invoke(kApplicationObject, kProcessCallOpenHandle, 1,
- from);
+ return kApplicationObject->Invoke(kApplicationObject, kProcessCallOpenHandle,
+ kFileAliasInterface, from);
}
} // namespace System