about summary refs log tree commit diff
path: root/src/fs.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs.zig')
-rw-r--r--src/fs.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fs.zig b/src/fs.zig
index 7a8717a..d29ee05 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -65,10 +65,10 @@ pub const FileSwapper = struct {
     }
 };
 
-pub fn replace_extension(alloc: std.mem.Allocator, p: []const u8, new: []const u8) ![]const u8 {
+pub fn replaceExtension(alloc: std.mem.Allocator, p: []const u8, new: []const u8) ![]const u8 {
     const dirname = std.fs.path.dirname(p) orelse ".";
-    const basename = try strip_extension(std.fs.path.basename(p));
-    return try join_path_and_filename(
+    const basename = try stripExtension(std.fs.path.basename(p));
+    return try joinPathAndFilename(
         alloc,
         &.{dirname},
         &.{ basename, ".", new },
@@ -76,14 +76,14 @@ pub fn replace_extension(alloc: std.mem.Allocator, p: []const u8, new: []const u
 }
 
 // also trims off base paths
-pub fn strip_extension(path: []const u8) ![]const u8 {
+pub fn stripExtension(path: []const u8) ![]const u8 {
     const ext = std.fs.path.extension(path);
     const ext_idx = std.mem.indexOfPosLinear(u8, path, 0, ext);
     std.debug.assert(ext_idx != null);
     return path[0..ext_idx.?];
 }
 
-pub fn join_path_and_filename(alloc: std.mem.Allocator, paths: []const []const u8, filename_parts: []const []const u8) ![]const u8 {
+pub fn joinPathAndFilename(alloc: std.mem.Allocator, paths: []const []const u8, filename_parts: []const []const u8) ![]const u8 {
     const filename = try std.mem.concat(alloc, u8, filename_parts);
     defer alloc.free(filename);
 
@@ -100,7 +100,7 @@ pub fn join_path_and_filename(alloc: std.mem.Allocator, paths: []const []const u
     return try std.fs.path.join(alloc, paths2);
 }
 
-pub fn get_mtime(alloc: std.mem.Allocator, path: []const u8) !std.os.linux.timespec {
+pub fn getMtime(alloc: std.mem.Allocator, path: []const u8) !std.os.linux.timespec {
     const attr = try alloc.create(std.os.linux.Stat);
     defer alloc.destroy(attr);
 
@@ -115,7 +115,7 @@ pub fn get_mtime(alloc: std.mem.Allocator, path: []const u8) !std.os.linux.times
 }
 
 // use libc strftime to format time string
-pub fn format_mtime(alloc: std.mem.Allocator, mtime: std.os.linux.timespec, fmt: [*c]const u8) ![]const u8 {
+pub fn formatMtime(alloc: std.mem.Allocator, mtime: std.os.linux.timespec, fmt: [*c]const u8) ![]const u8 {
     const mtime_str = try alloc.alloc(u8, std.os.linux.PATH_MAX);
     var tm: c.struct_tm = undefined;
     _ = c.localtime_r(&mtime.sec, &tm);