io: implement path manipulation and directory iteration on darwin
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#include <CuTest.h>
|
||||
#include <blue/core/stringstream.h>
|
||||
#include <blue/io/path.h>
|
||||
#include <blue/object/object.h>
|
||||
#include <blue/core/stringstream.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void test_path_1(CuTest *tc)
|
||||
{
|
||||
@@ -17,9 +18,9 @@ void test_path_1(CuTest *tc)
|
||||
b_path *path2 = b_path_create_from_cstr("path1\\path2\\");
|
||||
b_path *path3 = b_path_create_from_cstr("path3\\path4\\");
|
||||
|
||||
b_path *paths[] = {path, path2, path3};
|
||||
const b_path *paths[] = {path, path2, path3};
|
||||
|
||||
b_path *path4 = b_path_join(paths, sizeof paths / sizeof *paths);
|
||||
b_path *path4 = b_path_join(paths, sizeof paths / sizeof paths[0]);
|
||||
|
||||
b_stringstream_begin(&str, buf, sizeof buf);
|
||||
b_to_string(B_OBJECT(path4), &str);
|
||||
|
||||
@@ -24,7 +24,7 @@ int main(int argc, const char **argv)
|
||||
b_directory_iterator it = {0};
|
||||
b_directory_iterator_begin(dir, &it, B_DIRECTORY_ITERATE_PARENT_FIRST);
|
||||
while (b_directory_iterator_is_valid(&it)) {
|
||||
printf("%s\n", it.filename);
|
||||
printf("%s\n", it.filepath);
|
||||
b_directory_iterator_next(&it);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user