summaryrefslogtreecommitdiffstats
path: root/src/core/memory.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-11-26 21:48:19 +0100
committerLioncash <mathew1800@gmail.com>2019-11-27 03:55:38 +0100
commitb2165c6b353be5e8117d1f9bc677bb198fa9d8cd (patch)
tree1b08113cf73a864c7c3e74cd4a3e1cca53879ce2 /src/core/memory.h
parentcore/memory: Migrate over GetPointer() (diff)
downloadyuzu-b2165c6b353be5e8117d1f9bc677bb198fa9d8cd.tar
yuzu-b2165c6b353be5e8117d1f9bc677bb198fa9d8cd.tar.gz
yuzu-b2165c6b353be5e8117d1f9bc677bb198fa9d8cd.tar.bz2
yuzu-b2165c6b353be5e8117d1f9bc677bb198fa9d8cd.tar.lz
yuzu-b2165c6b353be5e8117d1f9bc677bb198fa9d8cd.tar.xz
yuzu-b2165c6b353be5e8117d1f9bc677bb198fa9d8cd.tar.zst
yuzu-b2165c6b353be5e8117d1f9bc677bb198fa9d8cd.zip
Diffstat (limited to '')
-rw-r--r--src/core/memory.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/core/memory.h b/src/core/memory.h
index 59b9ce2bb..47765c8a0 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -152,6 +152,23 @@ public:
*/
const u8* GetPointer(VAddr vaddr) const;
+ /**
+ * Reads a null-terminated string from the given virtual address.
+ * This function will continually read characters until either:
+ *
+ * - A null character ('\0') is reached.
+ * - max_length characters have been read.
+ *
+ * @note The final null-terminating character (if found) is not included
+ * in the returned string.
+ *
+ * @param vaddr The address to begin reading the string from.
+ * @param max_length The maximum length of the string to read in characters.
+ *
+ * @returns The read string.
+ */
+ std::string ReadCString(VAddr vaddr, std::size_t max_length);
+
private:
struct Impl;
std::unique_ptr<Impl> impl;
@@ -182,8 +199,6 @@ void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size);
void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size);
void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size);
-std::string ReadCString(VAddr vaddr, std::size_t max_length);
-
/**
* Mark each page touching the region as cached.
*/