Skip to content

Commit de94725

Browse files
committed
🔧 add from_string overloads with permissions support
- Added two new from_string overloads to allow writing file contents while setting explicit boost::filesystem::perms - Ensures callers can both write file content and control file permissions in one operation. - Maintains consistency with existing from_string API by providing both error-code and exception-throwing variants.
1 parent 0410195 commit de94725

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pre/file/string.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,16 @@ namespace pre::file {
9191
}
9292
}
9393

94+
inline void from_string(const std::string &path, const std::string &content, std::error_condition &ec,const boost::filesystem::perms& perms) {
95+
from_string(path, content, ec);
96+
boost::filesystem::permissions(path, perms);
97+
}
98+
99+
inline void from_string(const std::string &path, const std::string &content, const boost::filesystem::perms& perms) {
100+
from_string(path, content);
101+
boost::filesystem::permissions(path, perms);
102+
}
103+
104+
105+
94106
}

0 commit comments

Comments
 (0)