diff --git a/lutinMacro_zeus.py b/lutinMacro_zeus.py index 19c4607..b08b667 100644 --- a/lutinMacro_zeus.py +++ b/lutinMacro_zeus.py @@ -35,6 +35,7 @@ list_of_known_type = [ ["file", "zeus::File"], ["stream", "zeus::Stream"], ["json", "ejson::Object"], + ["buffer", "zeus::Buffer"], ] diff --git a/lutin_zeus.py b/lutin_zeus.py index 2202bf2..35e9850 100644 --- a/lutin_zeus.py +++ b/lutin_zeus.py @@ -1,6 +1,7 @@ #!/usr/bin/python import lutin.debug as debug import lutin.tools as tools +import lutin.macro as macro def get_type(): @@ -41,7 +42,6 @@ def configure(target, my_module): 'zeus/AbstractFunction.cpp', 'zeus/FutureBase.cpp', 'zeus/Future.cpp', - 'zeus/File.cpp', 'zeus/Buffer.cpp', 'zeus/BufferParameter.cpp', 'zeus/BufferCall.cpp', @@ -71,7 +71,6 @@ def configure(target, my_module): 'zeus/FutureData.hpp', 'zeus/FutureBase.hpp', 'zeus/Future.hpp', - 'zeus/File.hpp', 'zeus/Buffer.hpp', 'zeus/BufferParameter.hpp', 'zeus/BufferCall.hpp', @@ -93,6 +92,11 @@ def configure(target, my_module): 'zeus/RemoteProperty.hpp', 'zeus/SystemProxy.hpp', ]) + + # add basic object: + zeus_macro = macro.load_macro('zeus') + zeus_macro.parse_object_idl(my_module, 'zeus/zeus-File.obj.zeus.idl') + if target.config["compilator"] == "clang": my_module.add_flag('c++', "-Wno-unsequenced", export=True) # build in C++ mode diff --git a/zeus/BufferParameter.cpp b/zeus/BufferParameter.cpp index 3ee6fbb..5200454 100644 --- a/zeus/BufferParameter.cpp +++ b/zeus/BufferParameter.cpp @@ -93,7 +93,7 @@ zeus::ParamType zeus::BufferParameter::getParameterType(int32_t _id) const { if (typeId == createType>().getId()) { m_parameter[_id].first = 2; return createType>(); } if (typeId == createType>().getId()) { m_parameter[_id].first = 2; return createType>(); } if (typeId == createType>().getId()) { m_parameter[_id].first = 2; return createType>(); } - if (typeId == createType().getId()) { m_parameter[_id].first = 2; return createType(); } + //if (typeId == createType().getId()) { m_parameter[_id].first = 2; return createType(); } if (typeId == paramTypeRaw) { m_parameter[_id].first = sizeof(uint16_t); return zeus::ParamType("raw", paramTypeRaw); diff --git a/zeus/BufferParameter_addParameter.cpp b/zeus/BufferParameter_addParameter.cpp index 87bdd02..8724acf 100644 --- a/zeus/BufferParameter_addParameter.cpp +++ b/zeus/BufferParameter_addParameter.cpp @@ -307,7 +307,7 @@ namespace zeus { m_parameter.push_back(std::make_pair(2,data)); } #define ZEUS_MINIMUM_SIZE_MULTIPLE (1024*50) - + #if 0 class SendData { private: std::vector m_data; @@ -446,5 +446,6 @@ namespace zeus { m_multipleSend.push_back(zeus::SendFile(_value.getFileName(), _paramId, size)); } } + #endif } diff --git a/zeus/BufferParameter_getParameter.cpp b/zeus/BufferParameter_getParameter.cpp index 122b737..982ce6b 100644 --- a/zeus/BufferParameter_getParameter.cpp +++ b/zeus/BufferParameter_getParameter.cpp @@ -1434,7 +1434,7 @@ namespace zeus { ZEUS_ERROR("Can not get type from '" << type << "'"); return out; } - + /* template<> zeus::File BufferParameter::getParameter(int32_t _id) const { zeus::File out; @@ -1470,6 +1470,7 @@ namespace zeus { ZEUS_ERROR("Can not get type from '" << type << "'"); return out; } + */ template<> ememory::SharedPtr BufferParameter::getParameter>(const ememory::SharedPtr& _iface, int32_t _id) const { ememory::SharedPtr out; diff --git a/zeus/ParamType.cpp b/zeus/ParamType.cpp index 5d08173..e26774b 100644 --- a/zeus/ParamType.cpp +++ b/zeus/ParamType.cpp @@ -128,8 +128,10 @@ generate_basic_type(std::vector, "vector:uint16", 0x010B, true, true); generate_basic_type(std::vector, "vector:uint8", 0x010C, true, true); generate_basic_type(std::vector, "vector:string", 0x010D, false, true); +#if 0 generate_basic_type(zeus::File, "file", 0x000E, false, false); generate_basic_type(zeus::FileServer, "file", 0x000E, false, false); +#endif const uint16_t zeus::paramTypeObject = 0xFFFF; const uint16_t zeus::paramTypeRaw = 0xFFFE; diff --git a/zeus/zeus-File.obj.zeus.idl b/zeus/zeus-File.obj.zeus.idl new file mode 100644 index 0000000..a324141 --- /dev/null +++ b/zeus/zeus-File.obj.zeus.idl @@ -0,0 +1,20 @@ +#elem-brief: File Object interface +#elem-version: 1.0 +#elem-type:FILE +#elem-author:Heero Yui + +#brief:Get size of the file +#return:current size of the file +uint64 size() + +#brief:Get the name of the file +#return:Full name of the file (sha512) +string name() + +#brief:Get the file "mine-type" +#return:string of the mine-type +string getMineType() + +#brief:get a part of the file (size < 64ko) +#return:Buffer with the data +buffer getPart(uint64, uint64) diff --git a/zeus/File.cpp b/zeus/zzz_File.cpp similarity index 99% rename from zeus/File.cpp rename to zeus/zzz_File.cpp index e7e919e..9d3f72e 100644 --- a/zeus/File.cpp +++ b/zeus/zzz_File.cpp @@ -3,6 +3,7 @@ * @copyright 2016, Edouard DUPIN, all right reserved * @license APACHE v2.0 (see license file) */ +#if 0 #include #include #include @@ -12,7 +13,6 @@ #include - zeus::File::File() { } @@ -74,4 +74,5 @@ namespace etk { } } +#endif diff --git a/zeus/File.hpp b/zeus/zzz_File.hpp similarity index 99% rename from zeus/File.hpp rename to zeus/zzz_File.hpp index c6c4629..a229e53 100644 --- a/zeus/File.hpp +++ b/zeus/zzz_File.hpp @@ -6,6 +6,8 @@ #pragma once #include + +#if 0 namespace zeus { /** * @brief File inetrface @@ -119,3 +121,5 @@ namespace zeus { }; } +#endif +