From 6c205f4859588fc8dad786dce5f2fa32c75fd3f3 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Fri, 18 Apr 2014 22:19:46 +0200 Subject: Code style improvements * marked assignment and equality operators as deleted instead of making them private * XercesParserLiaison is stored in a std::shared_ptr specialization instance for scope guarding * moved implementation details into InputXSLT namespace --- src/utility.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/utility.h') 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 #include +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(buffer), + static_cast(buffer), size )); @@ -50,4 +54,6 @@ std::string readFile(const std::string& path) { } } +} + #endif // UTILITY_H_ -- cgit v1.2.3