njin
Engine 2D gọn nhẹ để tự tay làm game theo ý mình. Vibe coding cũng ổn luôn
Loading...
Searching...
No Matches
njin_file.h
1#pragma once
2#include "_types.h"
3#include <string>
4#include <string_view>
5
6namespace njin {
7struct context;
8
11
15bool file_exists(const char *path);
16
21bool file_read(const char *path, std::string &out);
22
30bool file_write(const char *path, std::string_view data);
31
41std::string save_path(const context &ctx, const char *file_name);
43} // namespace njin
bool file_exists(const char *path)
File có tồn tại không.
bool file_read(const char *path, std::string &out)
Đọc toàn bộ một file.
std::string save_path(const context &ctx, const char *file_name)
Đường dẫn đầy đủ của một file lưu game, trong thư mục riêng của người dùng.
bool file_write(const char *path, std::string_view data)
Ghi toàn bộ một file, tạo thư mục cha nếu chưa có.