meta: rename to fx
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
#include <CuTest.h>
|
||||
#include <blue/core/stringstream.h>
|
||||
#include <blue/io/path.h>
|
||||
#include <fx/core/stringstream.h>
|
||||
#include <fx/io/path.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void test_path_1(CuTest *tc)
|
||||
{
|
||||
b_path *path = b_path_create_from_cstr("C:\\hello\\world\\");
|
||||
fx_path *path = fx_path_create_from_cstr("C:\\hello\\world\\");
|
||||
char buf[512];
|
||||
b_stringstream *str = b_stringstream_create_with_buffer(buf, sizeof buf);
|
||||
fx_stringstream *str = fx_stringstream_create_with_buffer(buf, sizeof buf);
|
||||
|
||||
b_object_to_string(path, str);
|
||||
fx_object_to_string(path, str);
|
||||
|
||||
printf("%s\n", buf);
|
||||
|
||||
b_path *path2 = b_path_create_from_cstr("path1\\path2\\");
|
||||
b_path *path3 = b_path_create_from_cstr("path3\\path4\\");
|
||||
fx_path *path2 = fx_path_create_from_cstr("path1\\path2\\");
|
||||
fx_path *path3 = fx_path_create_from_cstr("path3\\path4\\");
|
||||
|
||||
const b_path *paths[] = {path, path2, path3};
|
||||
const fx_path *paths[] = {path, path2, path3};
|
||||
|
||||
b_path *path4 = b_path_join(paths, sizeof paths / sizeof paths[0]);
|
||||
fx_path *path4 = fx_path_join(paths, sizeof paths / sizeof paths[0]);
|
||||
|
||||
b_stringstream_reset_with_buffer(str, buf, sizeof buf);
|
||||
b_object_to_string(path4, str);
|
||||
fx_stringstream_reset_with_buffer(str, buf, sizeof buf);
|
||||
fx_object_to_string(path4, str);
|
||||
printf("%s\n", buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <blue/io/directory.h>
|
||||
#include <blue/io/path.h>
|
||||
#include <fx/io/directory.h>
|
||||
#include <fx/io/path.h>
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
@@ -9,14 +9,14 @@ int main(int argc, const char **argv)
|
||||
|
||||
const char *path = argv[1];
|
||||
|
||||
b_directory *dir;
|
||||
b_result result = b_directory_open(
|
||||
NULL, B_RV_PATH(path), B_DIRECTORY_OPEN_CREATE_INTERMEDIATE, &dir);
|
||||
if (b_result_is_error(result)) {
|
||||
b_throw(result);
|
||||
fx_directory *dir;
|
||||
fx_result result = fx_directory_open(
|
||||
NULL, FX_RV_PATH(path), FX_DIRECTORY_OPEN_CREATE_INTERMEDIATE, &dir);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
b_directory_unref(dir);
|
||||
fx_directory_unref(dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <blue/io/directory.h>
|
||||
#include <fx/io/directory.h>
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
@@ -8,16 +8,16 @@ int main(int argc, const char **argv)
|
||||
|
||||
const char *path = argv[1];
|
||||
|
||||
b_directory *dir;
|
||||
b_result result = b_directory_open(NULL, B_RV_PATH(path), 0, &dir);
|
||||
if (b_result_is_error(result)) {
|
||||
b_throw(result);
|
||||
fx_directory *dir;
|
||||
fx_result result = fx_directory_open(NULL, FX_RV_PATH(path), 0, &dir);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
result = b_directory_delete(dir);
|
||||
if (b_result_is_error(result)) {
|
||||
b_throw(result);
|
||||
result = fx_directory_delete(dir);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
#include <blue/core/stream.h>
|
||||
#include <blue/io/file.h>
|
||||
#include <blue/io/path.h>
|
||||
#include <fx/core/stream.h>
|
||||
#include <fx/io/file.h>
|
||||
#include <fx/io/path.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
b_file *dest;
|
||||
b_path *path = b_path_create_from_cstr("data.txt");
|
||||
b_result result = b_file_open(
|
||||
NULL, path, B_FILE_WRITE_ONLY | B_FILE_CREATE, &dest);
|
||||
if (b_result_is_error(result)) {
|
||||
b_throw(result);
|
||||
fx_file *dest;
|
||||
fx_path *path = fx_path_create_from_cstr("data.txt");
|
||||
fx_result result = fx_file_open(
|
||||
NULL, path, FX_FILE_WRITE_ONLY | FX_FILE_CREATE, &dest);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
size_t nr_read = 0;
|
||||
b_stream_buffer *buf = b_stream_buffer_create_dynamic(1024);
|
||||
b_stream_read_all_bytes_s(b_stdin, dest, buf, &nr_read);
|
||||
fx_stream_buffer *buf = fx_stream_buffer_create_dynamic(1024);
|
||||
fx_stream_read_all_bytes_s(fx_stdin, dest, buf, &nr_read);
|
||||
|
||||
printf("done. read %zu bytes total.\n", nr_read);
|
||||
|
||||
b_path_unref(path);
|
||||
b_file_unref(dest);
|
||||
fx_path_unref(path);
|
||||
fx_file_unref(dest);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <blue/io/directory.h>
|
||||
#include <fx/io/directory.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define NRAND_NUMBERS 12
|
||||
@@ -11,22 +11,22 @@ int main(int argc, const char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
b_directory *dir = NULL;
|
||||
b_path *path = b_path_create_from_cstr(argv[1]);
|
||||
b_result result = b_directory_open(B_DIRECTORY_ROOT, path, 0, &dir);
|
||||
fx_directory *dir = NULL;
|
||||
fx_path *path = fx_path_create_from_cstr(argv[1]);
|
||||
fx_result result = fx_directory_open(FX_DIRECTORY_ROOT, path, 0, &dir);
|
||||
|
||||
if (b_result_is_error(result)) {
|
||||
b_throw(result);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
b_iterator *it = b_directory_begin(dir, B_DIRECTORY_ITERATE_PARENT_FIRST);
|
||||
b_foreach(b_directory_entry *, entry, it)
|
||||
fx_iterator *it = fx_directory_begin(dir, FX_DIRECTORY_ITERATE_PARENT_FIRST);
|
||||
fx_foreach(fx_directory_entry *, entry, it)
|
||||
{
|
||||
printf("%s\n", b_path_ptr(entry->filepath));
|
||||
printf("%s\n", fx_path_ptr(entry->filepath));
|
||||
}
|
||||
|
||||
b_iterator_unref(it);
|
||||
fx_iterator_unref(it);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user