summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source/FileReader.cxx
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-03 20:39:06 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-03 20:39:06 +0100
commitf99e383775fa43c5c1354067962b1590ff2abdae (patch)
treef83a9b232c0424963fc9989b517e53f903ee036f /Private/NewBoot/Source/FileReader.cxx
parent0ca5d0d92ee326f3deda797403c27090bd0784ab (diff)
NewBoot: Will work on AHCI instead, ATA is not getting any further in
the future. Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/Source/FileReader.cxx')
-rw-r--r--Private/NewBoot/Source/FileReader.cxx54
1 files changed, 54 insertions, 0 deletions
diff --git a/Private/NewBoot/Source/FileReader.cxx b/Private/NewBoot/Source/FileReader.cxx
new file mode 100644
index 00000000..39884f9f
--- /dev/null
+++ b/Private/NewBoot/Source/FileReader.cxx
@@ -0,0 +1,54 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+ File: FileReader.cxx
+ Purpose: NewBoot FileReader,
+ Read complete file and store it in a buffer.
+
+ Revision History:
+
+
+
+------------------------------------------- */
+
+#include <BootKit/BootKit.hxx>
+#include <EFIKit/Api.hxx>
+#include <FSKit/NewFS.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+//
+// @brief BImageReader class
+//
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/***
+ @brief File Reader constructor.
+*/
+BFileReader::BFileReader(const CharacterType *path) {
+ if (path != nullptr) {
+ SizeT index = 0UL;
+ for (; path[index] != L'\0'; ++index) {
+ mPath[index] = path[index];
+ }
+
+ mPath[index] = 0;
+ }
+}
+
+/**
+ @brief this reads all of the buffer.
+ @param size, new buffer size.
+*/
+HCore::VoidPtr BFileReader::Fetch(SizeT &size) {
+ mWriter.WriteString(L"HCoreLdr: Fetch-File: ")
+ .WriteString(mPath)
+ .WriteString(L"\r\n");
+
+ this->mCached = true;
+ this->mErrorCode = kNotSupported;
+
+ return nullptr;
+}