remove reflectcpp dependency

This commit is contained in:
Mars 2025-03-11 01:25:16 -04:00
parent 2ac6fbfdec
commit b3e79b56f7
Signed by: pupbrained
GPG key ID: 874E22DF2F9DFCB5
9 changed files with 369 additions and 159 deletions

View file

@ -2,10 +2,12 @@
#include <expected>
#include <map>
#include <sys/statvfs.h>
#include <sys/sysctl.h>
#include "macos/bridge.h"
#include "os.h"
#include "src/util/types.h"
fn GetMemInfo() -> expected<u64, string> {
u64 mem = 0;
@ -194,4 +196,16 @@ fn GetHost() -> string {
return modelNameByHwModel[hwModel.data()];
}
// returns free/total
fn GetDiskUsage() -> std::pair<u64, u64> {
struct statvfs vfs;
if (statvfs("/", &vfs) != 0)
return { 0, 0 };
return { (vfs.f_blocks - vfs.f_bfree) * vfs.f_frsize, vfs.f_blocks * vfs.f_frsize };
}
fn GetShell() -> string { return ""; }
#endif