aboutsummaryrefslogtreecommitdiff
path: root/src/utility.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utility.h')
-rw-r--r--src/utility.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/utility.h b/src/utility.h
index 9c88b38..82f52aa 100644
--- a/src/utility.h
+++ b/src/utility.h
@@ -8,6 +8,8 @@
#include <cstddef>
#include <cstdio>
+namespace xalan = xalanc_1_11;
+
namespace {
const int OpenFlags = O_RDONLY;
@@ -15,6 +17,8 @@ const mode_t OpenMode = S_IRUSR | S_IWUSR;
}
+namespace InputXSLT {
+
std::string readFile(const std::string& path) {
int descriptor(
open(path.data(), OpenFlags, OpenMode)
@@ -29,11 +33,11 @@ std::string readFile(const std::string& path) {
fstat(descriptor, &info);
const std::size_t size(info.st_size);
- char* buffer(new char[size]);
+ char* const buffer(new char[size]);
ssize_t readSize(read(
descriptor,
- reinterpret_cast<void*>(buffer),
+ static_cast<void*const>(buffer),
size
));
@@ -50,4 +54,6 @@ std::string readFile(const std::string& path) {
}
}
+}
+
#endif // UTILITY_H_