Change dali-scene-loader to dali-scene3d
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / utils.h
similarity index 76%
rename from dali-scene-loader/public-api/utils.h
rename to dali-scene3d/public-api/loader/utils.h
index f9213e1..05a2063 100644 (file)
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_UTILS_H_
-#define DALI_SCENE_LOADER_UTILS_H_
+#ifndef DALI_SCENE3D_LOADER_UTILS_H_
+#define DALI_SCENE3D_LOADER_UTILS_H_
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/public-api/api.h"
+#include "dali-scene3d/public-api/api.h"
 
 // EXTERNAL INCLUDES
 #include <cctype>
@@ -29,7 +29,9 @@
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 /*
  * @brief Fixed size backing buffer to use with std::ostreams where control over
@@ -37,7 +39,7 @@ namespace SceneLoader
  * @note All stream insertions that would overflow the buffer that StreamBuffer
  *  was created with, will fail.
  */
-class DALI_SCENE_LOADER_API StreamBuffer : public std::basic_streambuf<char>
+class DALI_SCENE3D_API StreamBuffer : public std::basic_streambuf<char>
 {
 public:
   StreamBuffer(char* buffer, size_t size) noexcept(true);
@@ -48,7 +50,7 @@ public:
  *  which a message can be formatted into. Upon destruction, it throws a
  *  DaliException with the message.
  */
-class DALI_SCENE_LOADER_API ExceptionFlinger
+class DALI_SCENE3D_API ExceptionFlinger
 {
 public:
   enum
@@ -85,12 +87,12 @@ private:
 /*
  * @brief Formats the given printf-style varargs into a std::string.
  */
-DALI_SCENE_LOADER_API std::string FormatString(const char* format, ...);
+DALI_SCENE3D_API std::string FormatString(const char* format, ...);
 
 /*
  * @return The @n th bit in a bitmask.
  */
-DALI_SCENE_LOADER_API constexpr size_t NthBit(size_t n)
+DALI_SCENE3D_API constexpr size_t NthBit(size_t n)
 {
   return 1 << n;
 }
@@ -98,7 +100,7 @@ DALI_SCENE_LOADER_API constexpr size_t NthBit(size_t n)
 /*
  * @return Whether all of @a mask 's bits are set on @a value.
  */
-inline DALI_SCENE_LOADER_API bool MaskMatch(uint32_t value, uint32_t mask)
+inline DALI_SCENE3D_API bool MaskMatch(uint32_t value, uint32_t mask)
 {
   return (value & mask) == mask;
 }
@@ -106,7 +108,7 @@ inline DALI_SCENE_LOADER_API bool MaskMatch(uint32_t value, uint32_t mask)
 /*
  * @brief Convert a four-letter(, null-terminated) string literal into a uint32_t.
  */
-inline DALI_SCENE_LOADER_API constexpr uint32_t FourCC(const char (&fourCC)[5])
+inline DALI_SCENE3D_API constexpr uint32_t FourCC(const char (&fourCC)[5])
 {
   return (fourCC[3] << 24) | (fourCC[2] << 16) | (fourCC[1] << 8) | fourCC[0];
 }
@@ -117,7 +119,7 @@ inline DALI_SCENE_LOADER_API constexpr uint32_t FourCC(const char (&fourCC)[5])
  * @param[in] b, compare string
  * @return true if strings are equal
  */
-inline DALI_SCENE_LOADER_API bool CaseInsensitiveCharacterCompare(unsigned char a, unsigned char b)
+inline DALI_SCENE3D_API bool CaseInsensitiveCharacterCompare(unsigned char a, unsigned char b)
 {
   // Converts to lower case in the current locale.
   return std::tolower(a) == std::tolower(b);
@@ -128,7 +130,7 @@ inline DALI_SCENE_LOADER_API bool CaseInsensitiveCharacterCompare(unsigned char
  * @param[in] a, compare string
  * @param[in] b, compare string
  */
-inline DALI_SCENE_LOADER_API bool CaseInsensitiveStringCompare(const std::string& a, const std::string& b)
+inline DALI_SCENE3D_API bool CaseInsensitiveStringCompare(const std::string& a, const std::string& b)
 {
   bool result = false;
   if(a.length() == b.length())
@@ -144,7 +146,7 @@ inline DALI_SCENE_LOADER_API bool CaseInsensitiveStringCompare(const std::string
  *  to true in case of failure (should only be checked if the returned string
  *  was empty()).
  */
-DALI_SCENE_LOADER_API std::string LoadTextFile(const char* path, bool* fail = nullptr);
+DALI_SCENE3D_API std::string LoadTextFile(const char* path, bool* fail = nullptr);
 
 /*
  * @brief Makes a number of calls to @a fn, passing to each one the given
@@ -154,7 +156,7 @@ DALI_SCENE_LOADER_API std::string LoadTextFile(const char* path, bool* fail = nu
  *  for performance and stability reasons.
  */
 template<typename Func>
-inline DALI_SCENE_LOADER_API void VisitActor(Actor a, Func fn)
+inline DALI_SCENE3D_API void VisitActor(Actor a, Func fn)
 {
   fn(a);
 
@@ -169,7 +171,7 @@ inline DALI_SCENE_LOADER_API void VisitActor(Actor a, Func fn)
  * @brief Convenience function to set the given actor @a 's anchor point
  *  and parent origin to center.
  */
-inline DALI_SCENE_LOADER_API void SetActorCentered(Actor a)
+inline DALI_SCENE3D_API void SetActorCentered(Actor a)
 {
   a.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
   a.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
@@ -179,7 +181,7 @@ namespace TexturedQuadOptions
 {
 using Type = uint32_t;
 
-enum DALI_SCENE_LOADER_API Values : Type
+enum DALI_SCENE3D_API Values : Type
 {
   NONE          = 0x00,
   FLIP_VERTICAL = 0x01,
@@ -189,15 +191,16 @@ enum DALI_SCENE_LOADER_API Values : Type
 /*
  * @brief Makes... geometry for a textured quad.
  */
-DALI_SCENE_LOADER_API Geometry MakeTexturedQuadGeometry(TexturedQuadOptions::Type options = TexturedQuadOptions::NONE);
+DALI_SCENE3D_API Geometry MakeTexturedQuadGeometry(TexturedQuadOptions::Type options = TexturedQuadOptions::NONE);
 
 /*
  * @brief Fixes the path of a file. Replaces the '\\' separator by the '/' one.
  * @param[in,out] path The path to be fixed.
  */
-DALI_SCENE_LOADER_API void ToUnixFileSeparators(std::string& path);
+DALI_SCENE3D_API void ToUnixFileSeparators(std::string& path);
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
 
-#endif /* DALI_SCENE_LOADER_UTILS_H_ */
+#endif /* DALI_SCENE3D_LOADER_UTILS_H_ */