In windows environment, the delimiter has to be "\\".
Change-Id: Icbba8f51a6fcf38349cc8cd673329708c3cf03cf
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
#include "idlc/ast/attribute.h"
namespace tidl {
+namespace {
+
+#if (defined(_WIN32) || defined(__WIN32__))
+constexpr const char kDelim[] = "\\";
+#else
+constexpr const char kDelim[] = "/";
+#endif
+
+} // namespace
Generator::Generator(std::shared_ptr<Document> doc) : doc_(doc) {}
std::string Generator::GetFileNamespace() const {
std::string key1(".");
- std::string key2("/");
+ std::string key2(kDelim);
std::size_t p2 = FileName.rfind(key1);
std::size_t p1 = FileName.rfind(key2);