refactor database.cpp (1/2)
This commit is contained in:
parent
c1fc832b88
commit
6b3f5d1364
|
@ -39,8 +39,7 @@
|
||||||
SuperScriptMaterializer处理流程里会涉及很多不同的数据库文件,以下是这些数据库和其内表的格式。
|
SuperScriptMaterializer处理流程里会涉及很多不同的数据库文件,以下是这些数据库和其内表的格式。
|
||||||
其中这些是Materializer直接输出的基于文档的数据库:
|
其中这些是Materializer直接输出的基于文档的数据库:
|
||||||
|
|
||||||
* script.db
|
* doc.db
|
||||||
* data.db
|
|
||||||
* env.db
|
* env.db
|
||||||
|
|
||||||
这些数据库是上面数据库经过Decorator处理可以被Viewer接受的数据库:
|
这些数据库是上面数据库经过Decorator处理可以被Viewer接受的数据库:
|
||||||
|
@ -50,9 +49,9 @@ SuperScriptMaterializer处理流程里会涉及很多不同的数据库文件,
|
||||||
* query.db
|
* query.db
|
||||||
* composition.db
|
* composition.db
|
||||||
|
|
||||||
## script.db 格式
|
## doc.db 格式
|
||||||
|
|
||||||
script.db导出的是当前Virtools文档内的脚本及其它重要数据。
|
doc.db导出的是当前Virtools文档内的脚本及其它重要数据。
|
||||||
|
|
||||||
表列表:
|
表列表:
|
||||||
|
|
||||||
|
|
|
@ -12,32 +12,24 @@ EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Debug|x86 = Debug|x86
|
Debug|x86 = Debug|x86
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
Release|x64 = Release|x64
|
|
||||||
Release|x86 = Release|x86
|
Release|x86 = Release|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{6D751BF5-87D6-4123-94B3-34721938CF04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{6D751BF5-87D6-4123-94B3-34721938CF04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{6D751BF5-87D6-4123-94B3-34721938CF04}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{6D751BF5-87D6-4123-94B3-34721938CF04}.Debug|x86.ActiveCfg = Debug|Any CPU
|
{6D751BF5-87D6-4123-94B3-34721938CF04}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
{6D751BF5-87D6-4123-94B3-34721938CF04}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6D751BF5-87D6-4123-94B3-34721938CF04}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{6D751BF5-87D6-4123-94B3-34721938CF04}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{6D751BF5-87D6-4123-94B3-34721938CF04}.Release|x86.ActiveCfg = Release|Any CPU
|
{6D751BF5-87D6-4123-94B3-34721938CF04}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||||
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Debug|x64.ActiveCfg = Debug|Win32
|
|
||||||
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Debug|x86.ActiveCfg = Debug|Win32
|
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Debug|x86.Build.0 = Debug|Win32
|
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Debug|x86.Build.0 = Debug|Win32
|
||||||
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Release|Any CPU.ActiveCfg = Release|Win32
|
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||||
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Release|x64.ActiveCfg = Release|Win32
|
|
||||||
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Release|x86.ActiveCfg = Release|Win32
|
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Release|x86.ActiveCfg = Release|Win32
|
||||||
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Release|x86.Build.0 = Release|Win32
|
{4D941003-020F-47FD-9FA2-FFC989E306B8}.Release|x86.Build.0 = Release|Win32
|
||||||
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Debug|x86.ActiveCfg = Debug|Any CPU
|
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Release|x86.ActiveCfg = Release|Any CPU
|
{0E4B5021-27EA-4F79-B87D-E123AFB3D788}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
|
@ -113,6 +114,7 @@
|
||||||
<ClInclude Include="resource.h" />
|
<ClInclude Include="resource.h" />
|
||||||
<ClInclude Include="script_export.h" />
|
<ClInclude Include="script_export.h" />
|
||||||
<ClInclude Include="shared_export.h" />
|
<ClInclude Include="shared_export.h" />
|
||||||
|
<ClInclude Include="string_helper.hpp" />
|
||||||
<ClInclude Include="virtools_compatible.h" />
|
<ClInclude Include="virtools_compatible.h" />
|
||||||
<ClInclude Include="vt_menu.h" />
|
<ClInclude Include="vt_menu.h" />
|
||||||
<ClInclude Include="stdafx.h" />
|
<ClInclude Include="stdafx.h" />
|
||||||
|
@ -124,6 +126,7 @@
|
||||||
<ClCompile Include="main.cpp" />
|
<ClCompile Include="main.cpp" />
|
||||||
<ClCompile Include="script_export.cpp" />
|
<ClCompile Include="script_export.cpp" />
|
||||||
<ClCompile Include="shared_export.cpp" />
|
<ClCompile Include="shared_export.cpp" />
|
||||||
|
<ClCompile Include="string_helper.cpp" />
|
||||||
<ClCompile Include="virtools_compatible.cpp" />
|
<ClCompile Include="virtools_compatible.cpp" />
|
||||||
<ClCompile Include="vt_menu.cpp" />
|
<ClCompile Include="vt_menu.cpp" />
|
||||||
<ClCompile Include="vt_player.cpp" />
|
<ClCompile Include="vt_player.cpp" />
|
||||||
|
|
|
@ -42,6 +42,9 @@
|
||||||
<ClInclude Include="data_export.h">
|
<ClInclude Include="data_export.h">
|
||||||
<Filter>头文件</Filter>
|
<Filter>头文件</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="string_helper.hpp">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="database.cpp">
|
<ClCompile Include="database.cpp">
|
||||||
|
@ -71,6 +74,9 @@
|
||||||
<ClCompile Include="data_export.cpp">
|
<ClCompile Include="data_export.cpp">
|
||||||
<Filter>源文件</Filter>
|
<Filter>源文件</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="string_helper.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="SuperScriptMaterializer.def">
|
<None Include="SuperScriptMaterializer.def">
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
|
|
||||||
void DigCKObjectData(CKObject* cko, scriptDatabase* db, db_shared_dictData* helper, EXPAND_CK_ID parents);
|
void DigCKObjectData(CKObject* cko, DocumentDatabase* mDb, dbdoc_data* helper, EXPAND_CK_ID parents);
|
||||||
|
|
||||||
#endif
|
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -6,9 +6,6 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include "virtools_compatible.h"
|
|
||||||
|
|
||||||
#define STRINGCACHE_SIZE 25565
|
|
||||||
|
|
||||||
typedef long EXPAND_CK_ID;
|
typedef long EXPAND_CK_ID;
|
||||||
enum bLinkInputOutputType {
|
enum bLinkInputOutputType {
|
||||||
|
@ -25,9 +22,16 @@ enum pLinkInputOutputType {
|
||||||
|
|
||||||
#pragma region data struct define
|
#pragma region data struct define
|
||||||
|
|
||||||
// =================== script db
|
// =================== doc mDb
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script {
|
||||||
|
EXPAND_CK_ID thisobj;
|
||||||
|
std::string host_name;
|
||||||
|
int index;
|
||||||
|
EXPAND_CK_ID behavior;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct dbdoc_script_behavior {
|
||||||
EXPAND_CK_ID thisobj;
|
EXPAND_CK_ID thisobj;
|
||||||
std::string name;
|
std::string name;
|
||||||
CK_BEHAVIOR_TYPE type;
|
CK_BEHAVIOR_TYPE type;
|
||||||
|
@ -39,59 +43,52 @@ typedef struct {
|
||||||
//pTarget, pIn, pOut, bIn, bOut
|
//pTarget, pIn, pOut, bIn, bOut
|
||||||
std::string pin_count;
|
std::string pin_count;
|
||||||
EXPAND_CK_ID parent;
|
EXPAND_CK_ID parent;
|
||||||
}db_script_behavior;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_bIO {
|
||||||
EXPAND_CK_ID thisobj;
|
EXPAND_CK_ID thisobj;
|
||||||
std::string host_name;
|
|
||||||
int index;
|
int index;
|
||||||
EXPAND_CK_ID behavior;
|
std::string name;
|
||||||
}db_script_script;
|
EXPAND_CK_ID parent;
|
||||||
|
};
|
||||||
|
typedef dbdoc_script_bIO dbdoc_script_bIn;
|
||||||
|
typedef dbdoc_script_bIO dbdoc_script_bOut;
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_pTarget {
|
||||||
EXPAND_CK_ID thisobj;
|
EXPAND_CK_ID thisobj;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string type;
|
std::string type;
|
||||||
std::string type_guid;
|
std::string type_guid;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
EXPAND_CK_ID direct_source;
|
EXPAND_CK_ID direct_source;
|
||||||
EXPAND_CK_ID shared_source;
|
EXPAND_CK_ID shared_source;
|
||||||
}db_script_pTarget;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_pIn {
|
||||||
EXPAND_CK_ID thisobj;
|
EXPAND_CK_ID thisobj;
|
||||||
int index;
|
int index;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string type;
|
std::string type;
|
||||||
std::string type_guid;
|
std::string type_guid;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
EXPAND_CK_ID direct_source;
|
EXPAND_CK_ID direct_source;
|
||||||
EXPAND_CK_ID shared_source;
|
EXPAND_CK_ID shared_source;
|
||||||
}db_script_pIn;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_pOut {
|
||||||
EXPAND_CK_ID thisobj;
|
EXPAND_CK_ID thisobj;
|
||||||
int index;
|
int index;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string type;
|
std::string type;
|
||||||
std::string type_guid;
|
std::string type_guid;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
}db_script_pOut;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_bLink {
|
||||||
EXPAND_CK_ID thisobj;
|
|
||||||
int index;
|
|
||||||
std::string name;
|
|
||||||
EXPAND_CK_ID belong_to;
|
|
||||||
}db_shared_bIO;
|
|
||||||
typedef db_shared_bIO db_script_bIn;
|
|
||||||
typedef db_shared_bIO db_script_bOut;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
EXPAND_CK_ID input;
|
EXPAND_CK_ID input;
|
||||||
EXPAND_CK_ID output;
|
EXPAND_CK_ID output;
|
||||||
int delay;
|
int delay;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
|
|
||||||
//additional field
|
//additional field
|
||||||
EXPAND_CK_ID input_obj;
|
EXPAND_CK_ID input_obj;
|
||||||
|
@ -100,35 +97,28 @@ typedef struct {
|
||||||
EXPAND_CK_ID output_obj;
|
EXPAND_CK_ID output_obj;
|
||||||
bLinkInputOutputType output_type;
|
bLinkInputOutputType output_type;
|
||||||
int output_index;
|
int output_index;
|
||||||
}db_script_bLink;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_pLocal {
|
||||||
EXPAND_CK_ID thisobj;
|
EXPAND_CK_ID thisobj;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string type;
|
std::string type;
|
||||||
std::string type_guid;
|
std::string type_guid;
|
||||||
BOOL is_setting;
|
BOOL is_setting;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
}db_script_pLocal;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_pAttr {
|
||||||
EXPAND_CK_ID thisobj;
|
EXPAND_CK_ID thisobj;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string type;
|
std::string type;
|
||||||
std::string type_guid;
|
std::string type_guid;
|
||||||
}db_script_pAttr;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_pLink {
|
||||||
std::string field;
|
|
||||||
std::string data;
|
|
||||||
EXPAND_CK_ID belong_to;
|
|
||||||
}db_shared_dictData;
|
|
||||||
typedef db_shared_dictData db_script_pData;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
EXPAND_CK_ID input;
|
EXPAND_CK_ID input;
|
||||||
EXPAND_CK_ID output;
|
EXPAND_CK_ID output;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
|
|
||||||
//additional field
|
//additional field
|
||||||
EXPAND_CK_ID input_obj;
|
EXPAND_CK_ID input_obj;
|
||||||
|
@ -139,64 +129,61 @@ typedef struct {
|
||||||
pLinkInputOutputType output_type;
|
pLinkInputOutputType output_type;
|
||||||
BOOL output_is_bb;
|
BOOL output_is_bb;
|
||||||
int output_index;
|
int output_index;
|
||||||
}db_script_pLink;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_pOper {
|
||||||
EXPAND_CK_ID thisobj;
|
EXPAND_CK_ID thisobj;
|
||||||
std::string op;
|
std::string op;
|
||||||
std::string op_guid;
|
std::string op_guid;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
}db_script_pOper;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_script_eLink {
|
||||||
EXPAND_CK_ID export_obj;
|
EXPAND_CK_ID export_obj;
|
||||||
EXPAND_CK_ID internal_obj;
|
EXPAND_CK_ID internal_obj;
|
||||||
BOOL is_in;
|
BOOL is_in;
|
||||||
int index;
|
int index;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
}db_script_eLink;
|
};
|
||||||
|
|
||||||
|
struct dbdoc_msg {
|
||||||
|
CKMessageType index;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
|
||||||
// =================== data db
|
struct dbdoc_array {
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
EXPAND_CK_ID thisobj;
|
EXPAND_CK_ID thisobj;
|
||||||
std::string name;
|
std::string name;
|
||||||
CK_CLASSID type_classid;
|
|
||||||
std::string type_guid;
|
|
||||||
std::string type_name;
|
|
||||||
int rows;
|
int rows;
|
||||||
int columns;
|
int columns;
|
||||||
}db_data_obj;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_array_header {
|
||||||
int index;
|
int index;
|
||||||
std::string name;
|
std::string name;
|
||||||
CK_ARRAYTYPE type;
|
CK_ARRAYTYPE type;
|
||||||
std::string param_type;
|
std::string param_type;
|
||||||
std::string param_type_guid;
|
std::string param_type_guid;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
}db_data_objHeader;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbdoc_array_cell {
|
||||||
int row;
|
int row;
|
||||||
int column;
|
int column;
|
||||||
std::string showcase;
|
std::string showcase;
|
||||||
EXPAND_CK_ID inner_object;
|
|
||||||
EXPAND_CK_ID inner_param;
|
EXPAND_CK_ID inner_param;
|
||||||
EXPAND_CK_ID belong_to;
|
EXPAND_CK_ID parent;
|
||||||
}db_data_objBody;
|
};
|
||||||
|
|
||||||
typedef db_shared_dictData db_data_objParam;
|
struct dbdoc_data {
|
||||||
|
std::string field;
|
||||||
|
std::string data;
|
||||||
|
EXPAND_CK_ID parent;
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct {
|
// =================== env mDb
|
||||||
CKMessageType index;
|
|
||||||
std::string name;
|
|
||||||
}db_data_msg;
|
|
||||||
|
|
||||||
// =================== env db
|
struct dbenv_op {
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
CK_PARAMETEROPERATION funcPtr;
|
CK_PARAMETEROPERATION funcPtr;
|
||||||
std::string in1_guid;
|
std::string in1_guid;
|
||||||
std::string in2_guid;
|
std::string in2_guid;
|
||||||
|
@ -204,9 +191,9 @@ typedef struct {
|
||||||
std::string op_guid;
|
std::string op_guid;
|
||||||
std::string op_name;
|
std::string op_name;
|
||||||
CKOperationType op_code;
|
CKOperationType op_code;
|
||||||
}db_env_op;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbenv_param {
|
||||||
CKParameterType index;
|
CKParameterType index;
|
||||||
std::string guid;
|
std::string guid;
|
||||||
std::string derived_from;
|
std::string derived_from;
|
||||||
|
@ -225,9 +212,9 @@ typedef struct {
|
||||||
CKDWORD dw_flags;
|
CKDWORD dw_flags;
|
||||||
CKDWORD cid;
|
CKDWORD cid;
|
||||||
std::string saver_manager;
|
std::string saver_manager;
|
||||||
}db_env_param;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbenv_attr {
|
||||||
CKAttributeType index;
|
CKAttributeType index;
|
||||||
std::string name;
|
std::string name;
|
||||||
CKAttributeCategory category_index;
|
CKAttributeCategory category_index;
|
||||||
|
@ -236,15 +223,14 @@ typedef struct {
|
||||||
CKParameterType param_index;
|
CKParameterType param_index;
|
||||||
CK_CLASSID compatible_classid;
|
CK_CLASSID compatible_classid;
|
||||||
std::string default_value;
|
std::string default_value;
|
||||||
}db_env_attr;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbenv_plugin {
|
||||||
int dll_index;
|
int dll_index;
|
||||||
std::string dll_name;
|
std::string dll_name;
|
||||||
int plugin_index;
|
int plugin_index;
|
||||||
std::string category;
|
std::string category;
|
||||||
CKBOOL active;
|
CKBOOL active;
|
||||||
CKBOOL needed_by_file;
|
|
||||||
std::string guid;
|
std::string guid;
|
||||||
std::string desc;
|
std::string desc;
|
||||||
std::string author;
|
std::string author;
|
||||||
|
@ -252,136 +238,124 @@ typedef struct {
|
||||||
DWORD version;
|
DWORD version;
|
||||||
CK_INITINSTANCEFCT func_init;
|
CK_INITINSTANCEFCT func_init;
|
||||||
CK_EXITINSTANCEFCT func_exit;
|
CK_EXITINSTANCEFCT func_exit;
|
||||||
}db_env_plugin;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct dbenv_variable {
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string desciption;
|
std::string desciption;
|
||||||
XWORD flags;
|
XWORD flags;
|
||||||
UNIVERSAL_VAR_TYPE type;
|
UNIVERSAL_VAR_TYPE type;
|
||||||
std::string representation;
|
std::string representation;
|
||||||
std::string data;
|
std::string data;
|
||||||
}db_env_variable;
|
};
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
class dbScriptDataStructHelper {
|
class DbDataStructHelper_Doc {
|
||||||
public:
|
public:
|
||||||
void init(CKParameterManager* paramManager);
|
DbDataStructHelper_Doc(CKParameterManager* paramManager);
|
||||||
void dispose();
|
~DbDataStructHelper_Doc();
|
||||||
|
|
||||||
char* _stringCache;
|
CKParameterManager* param_manager;
|
||||||
CKParameterManager* _parameterManager;
|
|
||||||
db_script_behavior* _db_behavior;
|
dbdoc_script script;
|
||||||
db_script_script* _db_script;
|
dbdoc_script_behavior script_behavior;
|
||||||
db_script_pTarget* _db_pTarget;
|
dbdoc_script_bIn script_bIn;
|
||||||
db_script_pIn* _db_pIn;
|
dbdoc_script_bOut script_bOut;
|
||||||
db_script_pOut* _db_pOut;
|
dbdoc_script_pIn script_pIn;
|
||||||
db_script_bIn* _db_bIn;
|
dbdoc_script_pOut script_pOut;
|
||||||
db_script_bOut* _db_bOut;
|
dbdoc_script_bLink script_bLink;
|
||||||
db_script_bLink* _db_bLink;
|
dbdoc_script_pLocal script_pLocal;
|
||||||
db_script_pLocal* _db_pLocal;
|
dbdoc_script_pAttr script_pAttr;
|
||||||
db_script_pAttr* _db_pAttr;
|
dbdoc_script_pLink script_pLink;
|
||||||
db_script_pLink* _db_pLink;
|
dbdoc_script_pOper script_pOper;
|
||||||
db_script_pData* _db_pData;
|
dbdoc_script_eLink script_eLink;
|
||||||
db_script_pOper* _db_pOper;
|
dbdoc_script_pTarget script_pTarget;
|
||||||
db_script_eLink* _db_eLink;
|
|
||||||
|
dbdoc_msg msg;
|
||||||
|
|
||||||
|
dbdoc_array _array;
|
||||||
|
dbdoc_array_header array_header;
|
||||||
|
dbdoc_array_cell array_cell;
|
||||||
|
|
||||||
|
dbdoc_data data;
|
||||||
};
|
};
|
||||||
|
|
||||||
class dbDataDataStructHelper {
|
class DbDataStructHelper_Env {
|
||||||
public:
|
public:
|
||||||
void init(CKParameterManager* paramManager);
|
DbDataStructHelper_Env();
|
||||||
void dispose();
|
~DbDataStructHelper_Env();
|
||||||
|
|
||||||
char* _stringCache;
|
dbenv_op op;
|
||||||
CKParameterManager* _parameterManager;
|
dbenv_param param;
|
||||||
db_data_obj* _db_obj;
|
dbenv_attr attr;
|
||||||
db_data_objHeader* _db_objHeader;
|
dbenv_plugin plugin;
|
||||||
db_data_objBody* _db_objBody;
|
dbenv_variable variable;
|
||||||
db_data_objParam* _db_objParam;
|
|
||||||
db_data_msg* _db_msg;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class dbEnvDataStructHelper {
|
|
||||||
public:
|
|
||||||
void init();
|
|
||||||
void dispose();
|
|
||||||
|
|
||||||
char* _stringCache;
|
|
||||||
db_env_op* _db_op;
|
|
||||||
db_env_param* _db_param;
|
|
||||||
//db_data_msg* _db_envMsg;
|
|
||||||
db_env_attr* _db_attr;
|
|
||||||
db_env_plugin* _db_plugin;
|
|
||||||
db_env_variable* _db_variable;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class database {
|
class SSMaterializerDatabase {
|
||||||
public:
|
public:
|
||||||
void open(const char* file);
|
SSMaterializerDatabase(const char* file);
|
||||||
void close();
|
virtual ~SSMaterializerDatabase();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
sqlite3_stmt* safeStmt(size_t index);
|
sqlite3_stmt* CreateStmt(const char* stmt);
|
||||||
virtual BOOL init() { return TRUE; }
|
virtual BOOL Init() = 0;
|
||||||
virtual BOOL finalJob() { return TRUE; }
|
virtual BOOL Finalize() = 0;
|
||||||
|
|
||||||
sqlite3* db;
|
sqlite3* mDb;
|
||||||
std::vector<sqlite3_stmt*>* stmtCache;
|
std::vector<sqlite3_stmt*> mStmtCache;
|
||||||
};
|
};
|
||||||
|
|
||||||
class scriptDatabase : public database {
|
class DocumentDatabase : public SSMaterializerDatabase {
|
||||||
public:
|
public:
|
||||||
void write_behavior(db_script_behavior* data);
|
DocumentDatabase(const char* file);
|
||||||
void write_script(db_script_script* data);
|
virtual ~DocumentDatabase();
|
||||||
void write_pTarget(db_script_pTarget* data);
|
|
||||||
void write_pIn(db_script_pIn* data);
|
void write_script(dbdoc_script& data);
|
||||||
void write_pOut(db_script_pOut* data);
|
void write_script_behavior(dbdoc_script_behavior& data);
|
||||||
void write_bIn(db_script_bIn* data);
|
void write_script_pTarget(dbdoc_script_pTarget& data);
|
||||||
void write_bOut(db_script_bOut* data);
|
void write_script_pIn(dbdoc_script_pIn& data);
|
||||||
void write_bLink(db_script_bLink* data);
|
void write_script_pOut(dbdoc_script_pOut& data);
|
||||||
void write_pLocal(db_script_pLocal* data);
|
void write_script_bIn(dbdoc_script_bIn& data);
|
||||||
void write_pLink(db_script_pLink* data);
|
void write_script_bOut(dbdoc_script_bOut& data);
|
||||||
void write_pData(db_script_pData* data);
|
void write_script_bLink(dbdoc_script_bLink& data);
|
||||||
void write_pOper(db_script_pOper* data);
|
void write_script_pLocal(dbdoc_script_pLocal& data);
|
||||||
void write_eLink(db_script_eLink* data);
|
void write_script_pLink(dbdoc_script_pLink& data);
|
||||||
BOOL write_pAttr(db_script_pAttr* data);
|
void write_script_pOper(dbdoc_script_pOper& data);
|
||||||
|
void write_script_eLink(dbdoc_script_eLink& data);
|
||||||
|
BOOL write_script_pAttr(dbdoc_script_pAttr& data);
|
||||||
|
|
||||||
|
void write_msg(dbdoc_msg& data);
|
||||||
|
|
||||||
|
void write_array(dbdoc_array& data);
|
||||||
|
void write_array_header(dbdoc_array_header& data);
|
||||||
|
void write_array_cell(dbdoc_array_cell& data);
|
||||||
|
|
||||||
|
void write_data(dbdoc_data& data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BOOL init();
|
BOOL Init() override;
|
||||||
BOOL finalJob();
|
BOOL Finalize() override;
|
||||||
|
|
||||||
std::set<EXPAND_CK_ID>* pAttrUniqueEnsurance;
|
std::set<EXPAND_CK_ID> m_pAttrUniqueEnsurance;
|
||||||
};
|
};
|
||||||
|
|
||||||
class dataDatabase : public database {
|
class EnvironmentDatabase : public SSMaterializerDatabase {
|
||||||
public:
|
public:
|
||||||
void write_obj(db_data_obj* data);
|
EnvironmentDatabase(const char* file);
|
||||||
void write_objHeader(db_data_objHeader* data);
|
virtual ~EnvironmentDatabase();
|
||||||
void write_objBody(db_data_objBody* data);
|
|
||||||
void write_objParam(db_data_objParam* data);
|
void write_op(dbenv_op& data);
|
||||||
void write_msg(db_data_msg* data);
|
void write_param(dbenv_param& data);
|
||||||
|
void write_attr(dbenv_attr& data);
|
||||||
|
void write_plugin(dbenv_plugin& data);
|
||||||
|
void write_variable(dbenv_variable& data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BOOL init();
|
BOOL Init() override;
|
||||||
BOOL finalJob();
|
BOOL Finalize() override;
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class envDatabase : public database {
|
|
||||||
public:
|
|
||||||
void write_op(db_env_op* data);
|
|
||||||
void write_param(db_env_param* data);
|
|
||||||
//void write_msg(db_data_msg* data);
|
|
||||||
void write_attr(db_env_attr* data);
|
|
||||||
void write_plugin(db_env_plugin* data);
|
|
||||||
void write_variable(db_env_variable* data);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
BOOL init();
|
|
||||||
BOOL finalJob();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -5,7 +5,7 @@
|
||||||
#define copyGuid(guid,str) sprintf(helper->_stringCache,"%d,%d",guid.d1,guid.d2);str=helper->_stringCache;
|
#define copyGuid(guid,str) sprintf(helper->_stringCache,"%d,%d",guid.d1,guid.d2);str=helper->_stringCache;
|
||||||
#define safeStringCopy(storage,str) storage=(str)?(str):"";
|
#define safeStringCopy(storage,str) storage=(str)?(str):"";
|
||||||
|
|
||||||
void IterateParameterOperation(CKParameterManager* parameterManager, envDatabase* db, dbEnvDataStructHelper* helper) {
|
void IterateParameterOperation(CKParameterManager* parameterManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper) {
|
||||||
int count = parameterManager->GetParameterOperationCount();
|
int count = parameterManager->GetParameterOperationCount();
|
||||||
CKOperationDesc* opList = NULL;
|
CKOperationDesc* opList = NULL;
|
||||||
int listCount = 0, cacheListCount = 0;
|
int listCount = 0, cacheListCount = 0;
|
||||||
|
@ -32,14 +32,14 @@ void IterateParameterOperation(CKParameterManager* parameterManager, envDatabase
|
||||||
copyGuid(opList[j].ResGuid, helper->_db_op->out_guid);
|
copyGuid(opList[j].ResGuid, helper->_db_op->out_guid);
|
||||||
helper->_db_op->funcPtr = opList[j].Fct;
|
helper->_db_op->funcPtr = opList[j].Fct;
|
||||||
|
|
||||||
db->write_op(helper->_db_op);
|
mDb->write_op(helper->_db_op);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (opList != NULL) free(opList);
|
if (opList != NULL) free(opList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IterateParameter(CKParameterManager* parameterManager, envDatabase* db, dbEnvDataStructHelper* helper) {
|
void IterateParameter(CKParameterManager* parameterManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper) {
|
||||||
int count = parameterManager->GetParameterTypesCount();
|
int count = parameterManager->GetParameterTypesCount();
|
||||||
CKParameterTypeDesc* desc = NULL;
|
CKParameterTypeDesc* desc = NULL;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
|
@ -70,21 +70,21 @@ void IterateParameter(CKParameterManager* parameterManager, envDatabase* db, dbE
|
||||||
helper->_db_param->cid = desc->Cid;
|
helper->_db_param->cid = desc->Cid;
|
||||||
copyGuid(desc->Saver_Manager, helper->_db_param->saver_manager);
|
copyGuid(desc->Saver_Manager, helper->_db_param->saver_manager);
|
||||||
|
|
||||||
db->write_param(helper->_db_param);
|
mDb->write_param(helper->_db_param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IterateMessage(CKMessageManager* msgManager, envDatabase* db, dbEnvDataStructHelper* helper) {
|
void IterateMessage(CKMessageManager* msgManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper) {
|
||||||
int count = msgManager->GetMessageTypeCount();
|
int count = msgManager->GetMessageTypeCount();
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
helper->_db_envMsg->index = i;
|
helper->_db_envMsg->index = i;
|
||||||
helper->_db_envMsg->name = msgManager->GetMessageTypeName(i);
|
helper->_db_envMsg->name = msgManager->GetMessageTypeName(i);
|
||||||
|
|
||||||
db->write_msg(helper->_db_envMsg);
|
mDb->write_msg(helper->_db_envMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IterateAttribute(CKAttributeManager* attrManager, envDatabase* db, dbEnvDataStructHelper* helper) {
|
void IterateAttribute(CKAttributeManager* attrManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper) {
|
||||||
int count = attrManager->GetAttributeCount();
|
int count = attrManager->GetAttributeCount();
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
helper->_db_attr->index = i;
|
helper->_db_attr->index = i;
|
||||||
|
@ -96,11 +96,11 @@ void IterateAttribute(CKAttributeManager* attrManager, envDatabase* db, dbEnvDat
|
||||||
helper->_db_attr->compatible_classid = attrManager->GetAttributeCompatibleClassId(i);
|
helper->_db_attr->compatible_classid = attrManager->GetAttributeCompatibleClassId(i);
|
||||||
helper->_db_attr->default_value = attrManager->GetAttributeDefaultValue(i) != NULL ? attrManager->GetAttributeDefaultValue(i) : "";
|
helper->_db_attr->default_value = attrManager->GetAttributeDefaultValue(i) != NULL ? attrManager->GetAttributeDefaultValue(i) : "";
|
||||||
|
|
||||||
db->write_attr(helper->_db_attr);
|
mDb->write_attr(helper->_db_attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IteratePlugin(CKPluginManager* plgManager, envDatabase* db, dbEnvDataStructHelper* helper) {
|
void IteratePlugin(CKPluginManager* plgManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper) {
|
||||||
for (int i = 0; i <= 7; i++) {
|
for (int i = 0; i <= 7; i++) {
|
||||||
int catCount = plgManager->GetPluginCount(i);
|
int catCount = plgManager->GetPluginCount(i);
|
||||||
helper->_db_plugin->category = plgManager->GetCategoryName(i);
|
helper->_db_plugin->category = plgManager->GetCategoryName(i);
|
||||||
|
@ -121,13 +121,13 @@ void IteratePlugin(CKPluginManager* plgManager, envDatabase* db, dbEnvDataStruct
|
||||||
helper->_db_plugin->func_init = plgInfo->m_InitInstanceFct;
|
helper->_db_plugin->func_init = plgInfo->m_InitInstanceFct;
|
||||||
helper->_db_plugin->func_exit = plgInfo->m_ExitInstanceFct;
|
helper->_db_plugin->func_exit = plgInfo->m_ExitInstanceFct;
|
||||||
|
|
||||||
db->write_plugin(helper->_db_plugin);
|
mDb->write_plugin(helper->_db_plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(VIRTOOLS_21)
|
#if !defined(VIRTOOLS_21)
|
||||||
void IterateVariable(CKVariableManager* varManager, envDatabase* db, dbEnvDataStructHelper* helper) {
|
void IterateVariable(CKVariableManager* varManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper) {
|
||||||
CKVariableManager::Iterator it = varManager->GetVariableIterator();
|
CKVariableManager::Iterator it = varManager->GetVariableIterator();
|
||||||
CKVariableManager::Variable* varobj = NULL;
|
CKVariableManager::Variable* varobj = NULL;
|
||||||
XString dataCopyCache;
|
XString dataCopyCache;
|
||||||
|
@ -141,7 +141,7 @@ void IterateVariable(CKVariableManager* varManager, envDatabase* db, dbEnvDataSt
|
||||||
varobj->GetStringValue(dataCopyCache);
|
varobj->GetStringValue(dataCopyCache);
|
||||||
helper->_db_variable->data = dataCopyCache.CStr();
|
helper->_db_variable->data = dataCopyCache.CStr();
|
||||||
|
|
||||||
db->write_variable(helper->_db_variable);
|
mDb->write_variable(helper->_db_variable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
|
@ -4,11 +4,11 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
|
|
||||||
void IterateParameterOperation(CKParameterManager* parameterManager, envDatabase* db, dbEnvDataStructHelper* helper);
|
void IterateParameterOperation(CKParameterManager* parameterManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper);
|
||||||
void IterateParameter(CKParameterManager* parameterManager, envDatabase* db, dbEnvDataStructHelper* helper);
|
void IterateParameter(CKParameterManager* parameterManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper);
|
||||||
void IterateMessage(CKMessageManager* msgManager, envDatabase* db, dbEnvDataStructHelper* helper);
|
void IterateMessage(CKMessageManager* msgManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper);
|
||||||
void IterateAttribute(CKAttributeManager* attrManager, envDatabase* db, dbEnvDataStructHelper* helper);
|
void IterateAttribute(CKAttributeManager* attrManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper);
|
||||||
void IteratePlugin(CKPluginManager* plgManager, envDatabase* db, dbEnvDataStructHelper* helper);
|
void IteratePlugin(CKPluginManager* plgManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper);
|
||||||
void IterateVariable(CKVariableManager* varManager, envDatabase* db, dbEnvDataStructHelper* helper);
|
void IterateVariable(CKVariableManager* varManager, EnvironmentDatabase* mDb, dbEnvDataStructHelper* helper);
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#pragma region inline func
|
#pragma region inline func
|
||||||
|
|
||||||
void generate_pLink_in_pIn(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB, BOOL isTarget) {
|
void generate_pLink_in_pIn(CKContext* ctx, CKParameterIn* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB, BOOL isTarget) {
|
||||||
//WARNING: i only choose one between [DirectSource] and [SharedSource] bucause i don't find any pIn both have these two field
|
//WARNING: i only choose one between [DirectSource] and [SharedSource] bucause i don't find any pIn both have these two field
|
||||||
CKParameter* directSource = NULL;
|
CKParameter* directSource = NULL;
|
||||||
CKObject* ds_Owner = NULL;
|
CKObject* ds_Owner = NULL;
|
||||||
|
@ -48,7 +48,7 @@ void generate_pLink_in_pIn(CKContext* ctx, CKParameterIn* cache, scriptDatabase*
|
||||||
helper->_db_pLink->input_type = pLinkInputOutputType_PATTR;
|
helper->_db_pLink->input_type = pLinkInputOutputType_PATTR;
|
||||||
helper->_db_pLink->input_is_bb = FALSE;
|
helper->_db_pLink->input_is_bb = FALSE;
|
||||||
helper->_db_pLink->input_index = -1;
|
helper->_db_pLink->input_index = -1;
|
||||||
proc_pAttr(ctx, db, helper, directSource);
|
proc_pAttr(ctx, mDb, helper, directSource);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//normal object, see as virtual bb pLocal shortcut
|
//normal object, see as virtual bb pLocal shortcut
|
||||||
|
@ -56,7 +56,7 @@ void generate_pLink_in_pIn(CKContext* ctx, CKParameterIn* cache, scriptDatabase*
|
||||||
helper->_db_pLink->input_type = pLinkInputOutputType_PATTR;
|
helper->_db_pLink->input_type = pLinkInputOutputType_PATTR;
|
||||||
helper->_db_pLink->input_is_bb = FALSE;
|
helper->_db_pLink->input_is_bb = FALSE;
|
||||||
helper->_db_pLink->input_index = -1;
|
helper->_db_pLink->input_index = -1;
|
||||||
proc_pAttr(ctx, db, helper, directSource);
|
proc_pAttr(ctx, mDb, helper, directSource);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,11 +91,11 @@ void generate_pLink_in_pIn(CKContext* ctx, CKParameterIn* cache, scriptDatabase*
|
||||||
helper->_db_pLink->output_index = index;
|
helper->_db_pLink->output_index = index;
|
||||||
helper->_db_pLink->belong_to = grandparents;
|
helper->_db_pLink->belong_to = grandparents;
|
||||||
|
|
||||||
db->write_pLink(helper->_db_pLink);
|
mDb->write_script_pLink(helper->_db_pLink);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_pTarget(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents) {
|
void proc_pTarget(CKContext* ctx, CKParameterIn* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents) {
|
||||||
helper->_db_pTarget->thisobj = cache->GetID();
|
helper->_db_pTarget->thisobj = cache->GetID();
|
||||||
helper->_db_pTarget->name = cache->GetName();
|
helper->_db_pTarget->name = cache->GetName();
|
||||||
helper->_db_pTarget->type = helper->_parameterManager->ParameterTypeToName(cache->GetType());
|
helper->_db_pTarget->type = helper->_parameterManager->ParameterTypeToName(cache->GetType());
|
||||||
|
@ -104,9 +104,9 @@ void proc_pTarget(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbSc
|
||||||
helper->_db_pTarget->direct_source = cache->GetDirectSource() ? cache->GetDirectSource()->GetID() : -1;
|
helper->_db_pTarget->direct_source = cache->GetDirectSource() ? cache->GetDirectSource()->GetID() : -1;
|
||||||
helper->_db_pTarget->shared_source = cache->GetSharedSource() ? cache->GetSharedSource()->GetID() : -1;
|
helper->_db_pTarget->shared_source = cache->GetSharedSource() ? cache->GetSharedSource()->GetID() : -1;
|
||||||
|
|
||||||
db->write_pTarget(helper->_db_pTarget);
|
mDb->write_script_pTarget(helper->_db_pTarget);
|
||||||
|
|
||||||
//judge whether expoer parameter and write database
|
//judge whether expoer parameter and write SSMaterializerDatabase
|
||||||
if (((CKBehavior*)ctx->GetObject(grandparents))->GetInputParameterPosition(cache) != -1) {
|
if (((CKBehavior*)ctx->GetObject(grandparents))->GetInputParameterPosition(cache) != -1) {
|
||||||
helper->_db_eLink->export_obj = cache->GetID();
|
helper->_db_eLink->export_obj = cache->GetID();
|
||||||
helper->_db_eLink->internal_obj = parents;
|
helper->_db_eLink->internal_obj = parents;
|
||||||
|
@ -114,15 +114,15 @@ void proc_pTarget(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbSc
|
||||||
helper->_db_eLink->index = -1;
|
helper->_db_eLink->index = -1;
|
||||||
helper->_db_eLink->belong_to = grandparents;
|
helper->_db_eLink->belong_to = grandparents;
|
||||||
|
|
||||||
db->write_eLink(helper->_db_eLink);
|
mDb->write_script_eLink(helper->_db_eLink);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========try generate pLink
|
//=========try generate pLink
|
||||||
generate_pLink_in_pIn(ctx, cache, db, helper, parents, grandparents, -1, TRUE, TRUE);
|
generate_pLink_in_pIn(ctx, cache, mDb, helper, parents, grandparents, -1, TRUE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_pIn(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB) {
|
void proc_pIn(CKContext* ctx, CKParameterIn* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB) {
|
||||||
helper->_db_pIn->thisobj = cache->GetID();
|
helper->_db_pIn->thisobj = cache->GetID();
|
||||||
helper->_db_pIn->index = index;
|
helper->_db_pIn->index = index;
|
||||||
helper->_db_pIn->name = cache->GetName();
|
helper->_db_pIn->name = cache->GetName();
|
||||||
|
@ -134,9 +134,9 @@ void proc_pIn(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbScript
|
||||||
helper->_db_pIn->direct_source = cache->GetDirectSource() ? cache->GetDirectSource()->GetID() : -1;
|
helper->_db_pIn->direct_source = cache->GetDirectSource() ? cache->GetDirectSource()->GetID() : -1;
|
||||||
helper->_db_pIn->shared_source = cache->GetSharedSource() ? cache->GetSharedSource()->GetID() : -1;
|
helper->_db_pIn->shared_source = cache->GetSharedSource() ? cache->GetSharedSource()->GetID() : -1;
|
||||||
|
|
||||||
db->write_pIn(helper->_db_pIn);
|
mDb->write_script_pIn(helper->_db_pIn);
|
||||||
|
|
||||||
//judge whether expoer parameter and write database
|
//judge whether expoer parameter and write SSMaterializerDatabase
|
||||||
if (((CKBehavior*)ctx->GetObject(grandparents))->GetInputParameterPosition(cache) != -1) {
|
if (((CKBehavior*)ctx->GetObject(grandparents))->GetInputParameterPosition(cache) != -1) {
|
||||||
helper->_db_eLink->export_obj = cache->GetID();
|
helper->_db_eLink->export_obj = cache->GetID();
|
||||||
helper->_db_eLink->internal_obj = parents;
|
helper->_db_eLink->internal_obj = parents;
|
||||||
|
@ -144,16 +144,16 @@ void proc_pIn(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbScript
|
||||||
helper->_db_eLink->index = index;
|
helper->_db_eLink->index = index;
|
||||||
helper->_db_eLink->belong_to = grandparents;
|
helper->_db_eLink->belong_to = grandparents;
|
||||||
|
|
||||||
db->write_eLink(helper->_db_eLink);
|
mDb->write_script_eLink(helper->_db_eLink);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========try generate pLink
|
//=========try generate pLink
|
||||||
generate_pLink_in_pIn(ctx, cache, db, helper, parents, grandparents, index, executedFromBB, FALSE);
|
generate_pLink_in_pIn(ctx, cache, mDb, helper, parents, grandparents, index, executedFromBB, FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_pOut(CKContext* ctx, CKParameterOut* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB) {
|
void proc_pOut(CKContext* ctx, CKParameterOut* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB) {
|
||||||
helper->_db_pOut->thisobj = cache->GetID();
|
helper->_db_pOut->thisobj = cache->GetID();
|
||||||
helper->_db_pOut->index = index;
|
helper->_db_pOut->index = index;
|
||||||
helper->_db_pOut->name = cache->GetName();
|
helper->_db_pOut->name = cache->GetName();
|
||||||
|
@ -163,9 +163,9 @@ void proc_pOut(CKContext* ctx, CKParameterOut* cache, scriptDatabase* db, dbScri
|
||||||
copyGuid(cache->GetGUID(), helper->_db_pOut->type_guid);
|
copyGuid(cache->GetGUID(), helper->_db_pOut->type_guid);
|
||||||
helper->_db_pOut->belong_to = parents;
|
helper->_db_pOut->belong_to = parents;
|
||||||
|
|
||||||
db->write_pOut(helper->_db_pOut);
|
mDb->write_script_pOut(helper->_db_pOut);
|
||||||
|
|
||||||
//judge whether expoer parameter and write database
|
//judge whether expoer parameter and write SSMaterializerDatabase
|
||||||
if (((CKBehavior*)ctx->GetObject(grandparents))->GetOutputParameterPosition(cache) != -1) {
|
if (((CKBehavior*)ctx->GetObject(grandparents))->GetOutputParameterPosition(cache) != -1) {
|
||||||
helper->_db_eLink->export_obj = cache->GetID();
|
helper->_db_eLink->export_obj = cache->GetID();
|
||||||
helper->_db_eLink->internal_obj = parents;
|
helper->_db_eLink->internal_obj = parents;
|
||||||
|
@ -173,7 +173,7 @@ void proc_pOut(CKContext* ctx, CKParameterOut* cache, scriptDatabase* db, dbScri
|
||||||
helper->_db_eLink->index = index;
|
helper->_db_eLink->index = index;
|
||||||
helper->_db_eLink->belong_to = grandparents;
|
helper->_db_eLink->belong_to = grandparents;
|
||||||
|
|
||||||
db->write_eLink(helper->_db_eLink);
|
mDb->write_script_eLink(helper->_db_eLink);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,29 +210,29 @@ void proc_pOut(CKContext* ctx, CKParameterOut* cache, scriptDatabase* db, dbScri
|
||||||
|
|
||||||
helper->_db_pLink->belong_to = grandparents;
|
helper->_db_pLink->belong_to = grandparents;
|
||||||
|
|
||||||
db->write_pLink(helper->_db_pLink);
|
mDb->write_script_pLink(helper->_db_pLink);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_bIn(CKBehaviorIO* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, int index) {
|
void proc_bIn(CKBehaviorIO* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, int index) {
|
||||||
helper->_db_bIn->thisobj = cache->GetID();
|
helper->_db_bIn->thisobj = cache->GetID();
|
||||||
helper->_db_bIn->index = index;
|
helper->_db_bIn->index = index;
|
||||||
helper->_db_bIn->name = cache->GetName();
|
helper->_db_bIn->name = cache->GetName();
|
||||||
helper->_db_bIn->belong_to = parents;
|
helper->_db_bIn->belong_to = parents;
|
||||||
|
|
||||||
db->write_bIn(helper->_db_bIn);
|
mDb->write_script_bIn(helper->_db_bIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_bOut(CKBehaviorIO* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, int index) {
|
void proc_bOut(CKBehaviorIO* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, int index) {
|
||||||
helper->_db_bOut->thisobj = cache->GetID();
|
helper->_db_bOut->thisobj = cache->GetID();
|
||||||
helper->_db_bOut->index = index;
|
helper->_db_bOut->index = index;
|
||||||
helper->_db_bOut->name = cache->GetName();
|
helper->_db_bOut->name = cache->GetName();
|
||||||
helper->_db_bOut->belong_to = parents;
|
helper->_db_bOut->belong_to = parents;
|
||||||
|
|
||||||
db->write_bOut(helper->_db_bOut);
|
mDb->write_script_bOut(helper->_db_bOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_bLink(CKBehaviorLink* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents) {
|
void proc_bLink(CKBehaviorLink* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents) {
|
||||||
CKBehaviorIO* io = cache->GetInBehaviorIO();
|
CKBehaviorIO* io = cache->GetInBehaviorIO();
|
||||||
CKBehavior* beh = io->GetOwner();
|
CKBehavior* beh = io->GetOwner();
|
||||||
helper->_db_bLink->input = io->GetID();
|
helper->_db_bLink->input = io->GetID();
|
||||||
|
@ -249,10 +249,10 @@ void proc_bLink(CKBehaviorLink* cache, scriptDatabase* db, dbScriptDataStructHel
|
||||||
helper->_db_bLink->delay = cache->GetActivationDelay();
|
helper->_db_bLink->delay = cache->GetActivationDelay();
|
||||||
helper->_db_bLink->belong_to = parents;
|
helper->_db_bLink->belong_to = parents;
|
||||||
|
|
||||||
db->write_bLink(helper->_db_bLink);
|
mDb->write_script_bLink(helper->_db_bLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_pLocal(CKParameterLocal* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, BOOL is_setting) {
|
void proc_pLocal(CKParameterLocal* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, BOOL is_setting) {
|
||||||
helper->_db_pLocal->thisobj = cache->GetID();
|
helper->_db_pLocal->thisobj = cache->GetID();
|
||||||
helper->_db_pLocal->name = cache->GetName() ? cache->GetName() : "";
|
helper->_db_pLocal->name = cache->GetName() ? cache->GetName() : "";
|
||||||
CKParameterType vaildTypeChecker = cache->GetType();
|
CKParameterType vaildTypeChecker = cache->GetType();
|
||||||
|
@ -262,27 +262,27 @@ void proc_pLocal(CKParameterLocal* cache, scriptDatabase* db, dbScriptDataStruct
|
||||||
helper->_db_pLocal->is_setting = is_setting;
|
helper->_db_pLocal->is_setting = is_setting;
|
||||||
helper->_db_pLocal->belong_to = parents;
|
helper->_db_pLocal->belong_to = parents;
|
||||||
|
|
||||||
db->write_pLocal(helper->_db_pLocal);
|
mDb->write_script_pLocal(helper->_db_pLocal);
|
||||||
|
|
||||||
//export plocal metadata
|
//export plocal metadata
|
||||||
DigParameterData(cache, db, helper, cache->GetID());
|
DigParameterData(cache, mDb, helper, cache->GetID());
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_pOper(CKContext* ctx, CKParameterOperation* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents) {
|
void proc_pOper(CKContext* ctx, CKParameterOperation* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents) {
|
||||||
helper->_db_pOper->thisobj = cache->GetID();
|
helper->_db_pOper->thisobj = cache->GetID();
|
||||||
helper->_db_pOper->op = helper->_parameterManager->OperationGuidToName(cache->GetOperationGuid());
|
helper->_db_pOper->op = helper->_parameterManager->OperationGuidToName(cache->GetOperationGuid());
|
||||||
copyGuid(cache->GetOperationGuid(), helper->_db_pOper->op_guid);
|
copyGuid(cache->GetOperationGuid(), helper->_db_pOper->op_guid);
|
||||||
helper->_db_pOper->belong_to = parents;
|
helper->_db_pOper->belong_to = parents;
|
||||||
|
|
||||||
db->write_pOper(helper->_db_pOper);
|
mDb->write_script_pOper(helper->_db_pOper);
|
||||||
|
|
||||||
//export 2 input param and 1 output param
|
//export 2 input param and 1 output param
|
||||||
proc_pIn(ctx, cache->GetInParameter1(), db, helper, cache->GetID(), parents, 0, FALSE);
|
proc_pIn(ctx, cache->GetInParameter1(), mDb, helper, cache->GetID(), parents, 0, FALSE);
|
||||||
proc_pIn(ctx, cache->GetInParameter2(), db, helper, cache->GetID(), parents, 1, FALSE);
|
proc_pIn(ctx, cache->GetInParameter2(), mDb, helper, cache->GetID(), parents, 1, FALSE);
|
||||||
proc_pOut(ctx, cache->GetOutParameter(), db, helper, cache->GetID(), parents, 0, FALSE);
|
proc_pOut(ctx, cache->GetOutParameter(), mDb, helper, cache->GetID(), parents, 0, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_pAttr(CKContext* ctx, scriptDatabase* db, dbScriptDataStructHelper* helper, CKParameter* cache) {
|
void proc_pAttr(CKContext* ctx, DocumentDatabase* mDb, dbDocDataStructHelper* helper, CKParameter* cache) {
|
||||||
//write self first to detect conflict
|
//write self first to detect conflict
|
||||||
helper->_db_pAttr->thisobj = cache->GetID();
|
helper->_db_pAttr->thisobj = cache->GetID();
|
||||||
safeStringCopy(helper->_db_pAttr->name, cache->GetName());
|
safeStringCopy(helper->_db_pAttr->name, cache->GetName());
|
||||||
|
@ -291,32 +291,32 @@ void proc_pAttr(CKContext* ctx, scriptDatabase* db, dbScriptDataStructHelper* he
|
||||||
else helper->_db_pAttr->type = "!!UNKNOW TYPE!!"; //unknow type
|
else helper->_db_pAttr->type = "!!UNKNOW TYPE!!"; //unknow type
|
||||||
copyGuid(cache->GetGUID(), helper->_db_pAttr->type_guid);
|
copyGuid(cache->GetGUID(), helper->_db_pAttr->type_guid);
|
||||||
|
|
||||||
if (!db->write_pAttr(helper->_db_pAttr))
|
if (!mDb->write_script_pAttr(helper->_db_pAttr))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//not duplicated, continue write property
|
//not duplicated, continue write property
|
||||||
CKObject* host = cache->GetOwner();
|
CKObject* host = cache->GetOwner();
|
||||||
helper_pDataExport("attr.host_id", (long)host->GetID(), db, helper, cache->GetID());
|
helper_pDataExport("attr.host_id", (long)host->GetID(), mDb, helper, cache->GetID());
|
||||||
helper_pDataExport("attr.host_name", host->GetName(), db, helper, cache->GetID());
|
helper_pDataExport("attr.host_name", host->GetName(), mDb, helper, cache->GetID());
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================helper for pLocal data export
|
//============================helper for pLocal data export
|
||||||
void helper_pDataExport(const char* field, const char* data, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents) {
|
void helper_pDataExport(const char* field, const char* data, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents) {
|
||||||
helper->_db_pData->field = field;
|
helper->_db_pData->field = field;
|
||||||
helper->_db_pData->data = data;
|
helper->_db_pData->data = data;
|
||||||
helper->_db_pData->belong_to = parents;
|
helper->_db_pData->belong_to = parents;
|
||||||
|
|
||||||
db->write_pData(helper->_db_pData);
|
mDb->write_pData(helper->_db_pData);
|
||||||
}
|
}
|
||||||
void helper_pDataExport(const char* field, float data, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents) {
|
void helper_pDataExport(const char* field, float data, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents) {
|
||||||
char str[32];
|
char str[32];
|
||||||
sprintf(str, "%f", data);
|
sprintf(str, "%f", data);
|
||||||
helper_pDataExport(field, str, db, helper, parents);
|
helper_pDataExport(field, str, mDb, helper, parents);
|
||||||
}
|
}
|
||||||
void helper_pDataExport(const char* field, long data, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents) {
|
void helper_pDataExport(const char* field, long data, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents) {
|
||||||
char str[32];
|
char str[32];
|
||||||
ltoa(data, str, 10);
|
ltoa(data, str, 10);
|
||||||
helper_pDataExport(field, str, db, helper, parents);
|
helper_pDataExport(field, str, mDb, helper, parents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ void helper_pDataExport(const char* field, long data, scriptDatabase* db, dbScri
|
||||||
|
|
||||||
#pragma region normal func
|
#pragma region normal func
|
||||||
|
|
||||||
void IterateScript(CKContext* ctx, scriptDatabase* db, dbScriptDataStructHelper* helper) {
|
void IterateScript(CKContext* ctx, DocumentDatabase* mDb, dbDocDataStructHelper* helper) {
|
||||||
CKBeObject* beobj = NULL;
|
CKBeObject* beobj = NULL;
|
||||||
CKBehavior* beh = NULL;
|
CKBehavior* beh = NULL;
|
||||||
XObjectPointerArray objArray = ctx->GetObjectListByType(CKCID_BEOBJECT, TRUE);
|
XObjectPointerArray objArray = ctx->GetObjectListByType(CKCID_BEOBJECT, TRUE);
|
||||||
|
@ -342,15 +342,15 @@ void IterateScript(CKContext* ctx, scriptDatabase* db, dbScriptDataStructHelper*
|
||||||
helper->_db_script->host_name = beobj->GetName();
|
helper->_db_script->host_name = beobj->GetName();
|
||||||
helper->_db_script->index = j;
|
helper->_db_script->index = j;
|
||||||
helper->_db_script->behavior = beh->GetID();
|
helper->_db_script->behavior = beh->GetID();
|
||||||
db->write_script(helper->_db_script);
|
mDb->write_script(helper->_db_script);
|
||||||
|
|
||||||
//iterate script
|
//iterate script
|
||||||
IterateBehavior(ctx, beh, db, helper, -1);
|
IterateBehavior(ctx, beh, mDb, helper, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IterateBehavior(CKContext* ctx, CKBehavior* bhv, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents) {
|
void IterateBehavior(CKContext* ctx, CKBehavior* bhv, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents) {
|
||||||
//write self data
|
//write self data
|
||||||
helper->_db_behavior->thisobj = bhv->GetID();
|
helper->_db_behavior->thisobj = bhv->GetID();
|
||||||
helper->_db_behavior->name = bhv->GetName();
|
helper->_db_behavior->name = bhv->GetName();
|
||||||
|
@ -368,42 +368,42 @@ void IterateBehavior(CKContext* ctx, CKBehavior* bhv, scriptDatabase* db, dbScri
|
||||||
bhv->GetInputCount(),
|
bhv->GetInputCount(),
|
||||||
bhv->GetOutputCount());
|
bhv->GetOutputCount());
|
||||||
helper->_db_behavior->pin_count = helper->_stringCache;
|
helper->_db_behavior->pin_count = helper->_stringCache;
|
||||||
db->write_behavior(helper->_db_behavior);
|
mDb->write_script_behavior(helper->_db_behavior);
|
||||||
|
|
||||||
//write target
|
//write target
|
||||||
if (bhv->IsUsingTarget())
|
if (bhv->IsUsingTarget())
|
||||||
proc_pTarget(ctx, bhv->GetTargetParameter(), db, helper, bhv->GetID(), parents);
|
proc_pTarget(ctx, bhv->GetTargetParameter(), mDb, helper, bhv->GetID(), parents);
|
||||||
|
|
||||||
int count = 0, i = 0;
|
int count = 0, i = 0;
|
||||||
//pIn
|
//pIn
|
||||||
for (i = 0, count = bhv->GetInputParameterCount(); i < count; i++)
|
for (i = 0, count = bhv->GetInputParameterCount(); i < count; i++)
|
||||||
proc_pIn(ctx, bhv->GetInputParameter(i), db, helper, bhv->GetID(), parents, i, TRUE);
|
proc_pIn(ctx, bhv->GetInputParameter(i), mDb, helper, bhv->GetID(), parents, i, TRUE);
|
||||||
//pOut
|
//pOut
|
||||||
for (i = 0, count = bhv->GetOutputParameterCount(); i < count; i++)
|
for (i = 0, count = bhv->GetOutputParameterCount(); i < count; i++)
|
||||||
proc_pOut(ctx, bhv->GetOutputParameter(i), db, helper, bhv->GetID(), parents, i, TRUE);
|
proc_pOut(ctx, bhv->GetOutputParameter(i), mDb, helper, bhv->GetID(), parents, i, TRUE);
|
||||||
//bIn
|
//bIn
|
||||||
for (i = 0, count = bhv->GetInputCount(); i < count; i++)
|
for (i = 0, count = bhv->GetInputCount(); i < count; i++)
|
||||||
proc_bIn(bhv->GetInput(i), db, helper, bhv->GetID(), i);
|
proc_bIn(bhv->GetInput(i), mDb, helper, bhv->GetID(), i);
|
||||||
//bOut
|
//bOut
|
||||||
for (i = 0, count = bhv->GetOutputCount(); i < count; i++)
|
for (i = 0, count = bhv->GetOutputCount(); i < count; i++)
|
||||||
proc_bOut(bhv->GetOutput(i), db, helper, bhv->GetID(), i);
|
proc_bOut(bhv->GetOutput(i), mDb, helper, bhv->GetID(), i);
|
||||||
//bLink
|
//bLink
|
||||||
for (i = 0, count = bhv->GetSubBehaviorLinkCount(); i < count; i++)
|
for (i = 0, count = bhv->GetSubBehaviorLinkCount(); i < count; i++)
|
||||||
proc_bLink(bhv->GetSubBehaviorLink(i), db, helper, bhv->GetID());
|
proc_bLink(bhv->GetSubBehaviorLink(i), mDb, helper, bhv->GetID());
|
||||||
//pLocal
|
//pLocal
|
||||||
for (i = 0, count = bhv->GetLocalParameterCount(); i < count; i++)
|
for (i = 0, count = bhv->GetLocalParameterCount(); i < count; i++)
|
||||||
proc_pLocal(bhv->GetLocalParameter(i), db, helper, bhv->GetID(),
|
proc_pLocal(bhv->GetLocalParameter(i), mDb, helper, bhv->GetID(),
|
||||||
bhv->IsLocalParameterSetting(i));
|
bhv->IsLocalParameterSetting(i));
|
||||||
//pOper
|
//pOper
|
||||||
for (i = 0, count = bhv->GetParameterOperationCount(); i < count; i++)
|
for (i = 0, count = bhv->GetParameterOperationCount(); i < count; i++)
|
||||||
proc_pOper(ctx, bhv->GetParameterOperation(i), db, helper, bhv->GetID());
|
proc_pOper(ctx, bhv->GetParameterOperation(i), mDb, helper, bhv->GetID());
|
||||||
|
|
||||||
//iterate sub bb
|
//iterate sub bb
|
||||||
for (i = 0, count = bhv->GetSubBehaviorCount(); i < count; i++)
|
for (i = 0, count = bhv->GetSubBehaviorCount(); i < count; i++)
|
||||||
IterateBehavior(ctx, bhv->GetSubBehavior(i), db, helper, bhv->GetID());
|
IterateBehavior(ctx, bhv->GetSubBehavior(i), mDb, helper, bhv->GetID());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigParameterData(CKParameterLocal* p, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents) {
|
void DigParameterData(CKParameterLocal* p, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents) {
|
||||||
CKGUID t = p->GetGUID();
|
CKGUID t = p->GetGUID();
|
||||||
BOOL unknowType = FALSE;
|
BOOL unknowType = FALSE;
|
||||||
|
|
||||||
|
@ -412,12 +412,12 @@ void DigParameterData(CKParameterLocal* p, scriptDatabase* db, dbScriptDataStruc
|
||||||
//nothing
|
//nothing
|
||||||
if (t == CKPGUID_NONE) return;
|
if (t == CKPGUID_NONE) return;
|
||||||
if (p->GetParameterClassID() && p->GetValueObject(false)) {
|
if (p->GetParameterClassID() && p->GetValueObject(false)) {
|
||||||
helper_pDataExport("id", (long)p->GetValueObject(false)->GetID(), db, helper, parents);
|
helper_pDataExport("id", (long)p->GetValueObject(false)->GetID(), mDb, helper, parents);
|
||||||
helper_pDataExport("name", p->GetValueObject(false)->GetName(), db, helper, parents);
|
helper_pDataExport("name", p->GetValueObject(false)->GetName(), mDb, helper, parents);
|
||||||
|
|
||||||
CK_CLASSID none_classid = p->GetValueObject(false)->GetClassID();
|
CK_CLASSID none_classid = p->GetValueObject(false)->GetClassID();
|
||||||
CKParameterType none_type = helper->_parameterManager->ClassIDToType(none_classid);
|
CKParameterType none_type = helper->_parameterManager->ClassIDToType(none_classid);
|
||||||
helper_pDataExport("type",helper->_parameterManager->ParameterTypeToName(none_type), db, helper, parents);
|
helper_pDataExport("type",helper->_parameterManager->ParameterTypeToName(none_type), mDb, helper, parents);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//float
|
//float
|
||||||
|
@ -426,7 +426,7 @@ void DigParameterData(CKParameterLocal* p, scriptDatabase* db, dbScriptDataStruc
|
||||||
|| t == CKPGUID_FLOATSLIDER
|
|| t == CKPGUID_FLOATSLIDER
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
helper_pDataExport("float-data", *(float*)(p->GetReadDataPtr(false)), db, helper, parents);
|
helper_pDataExport("float-data", *(float*)(p->GetReadDataPtr(false)), mDb, helper, parents);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//int
|
//int
|
||||||
|
@ -437,22 +437,22 @@ void DigParameterData(CKParameterLocal* p, scriptDatabase* db, dbScriptDataStruc
|
||||||
|| t == CKPGUID_LIGHTTYPE || t == CKPGUID_SPRITEALIGN || t == CKPGUID_DIRECTION || t == CKPGUID_LAYERTYPE
|
|| t == CKPGUID_LIGHTTYPE || t == CKPGUID_SPRITEALIGN || t == CKPGUID_DIRECTION || t == CKPGUID_LAYERTYPE
|
||||||
|| t == CKPGUID_COMPOPERATOR || t == CKPGUID_BINARYOPERATOR || t == CKPGUID_SETOPERATOR
|
|| t == CKPGUID_COMPOPERATOR || t == CKPGUID_BINARYOPERATOR || t == CKPGUID_SETOPERATOR
|
||||||
|| t == CKPGUID_OBSTACLEPRECISION || t == CKPGUID_OBSTACLEPRECISIONBEH) {
|
|| t == CKPGUID_OBSTACLEPRECISION || t == CKPGUID_OBSTACLEPRECISIONBEH) {
|
||||||
helper_pDataExport("int-data", (long)(*(int*)(p->GetReadDataPtr(false))), db, helper, parents);
|
helper_pDataExport("int-data", (long)(*(int*)(p->GetReadDataPtr(false))), mDb, helper, parents);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t == CKPGUID_VECTOR) {
|
if (t == CKPGUID_VECTOR) {
|
||||||
VxVector vec;
|
VxVector vec;
|
||||||
memcpy(&vec, p->GetReadDataPtr(false), sizeof(vec));
|
memcpy(&vec, p->GetReadDataPtr(false), sizeof(vec));
|
||||||
helper_pDataExport("vector.x", vec.x, db, helper, parents);
|
helper_pDataExport("vector.x", vec.x, mDb, helper, parents);
|
||||||
helper_pDataExport("vector.y", vec.y, db, helper, parents);
|
helper_pDataExport("vector.y", vec.y, mDb, helper, parents);
|
||||||
helper_pDataExport("vector.z", vec.z, db, helper, parents);
|
helper_pDataExport("vector.z", vec.z, mDb, helper, parents);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t == CKPGUID_2DVECTOR) {
|
if (t == CKPGUID_2DVECTOR) {
|
||||||
Vx2DVector vec;
|
Vx2DVector vec;
|
||||||
memcpy(&vec, p->GetReadDataPtr(false), sizeof(vec));
|
memcpy(&vec, p->GetReadDataPtr(false), sizeof(vec));
|
||||||
helper_pDataExport("2dvector.x", vec.x, db, helper, parents);
|
helper_pDataExport("2dvector.x", vec.x, mDb, helper, parents);
|
||||||
helper_pDataExport("2dvector.y", vec.y, db, helper, parents);
|
helper_pDataExport("2dvector.y", vec.y, mDb, helper, parents);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t == CKPGUID_MATRIX) {
|
if (t == CKPGUID_MATRIX) {
|
||||||
|
@ -463,7 +463,7 @@ void DigParameterData(CKParameterLocal* p, scriptDatabase* db, dbScriptDataStruc
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
for (int j = 0; j < 4; ++j) {
|
for (int j = 0; j < 4; ++j) {
|
||||||
sprintf(position, "matrix[%d][%d]", i, j);
|
sprintf(position, "matrix[%d][%d]", i, j);
|
||||||
helper_pDataExport(position, mat[i][j], db, helper, parents);
|
helper_pDataExport(position, mat[i][j], mDb, helper, parents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -471,10 +471,10 @@ void DigParameterData(CKParameterLocal* p, scriptDatabase* db, dbScriptDataStruc
|
||||||
if (t == CKPGUID_COLOR) {
|
if (t == CKPGUID_COLOR) {
|
||||||
VxColor col;
|
VxColor col;
|
||||||
memcpy(&col, p->GetReadDataPtr(false), sizeof(col));
|
memcpy(&col, p->GetReadDataPtr(false), sizeof(col));
|
||||||
helper_pDataExport("color.r", col.r, db, helper, parents);
|
helper_pDataExport("color.r", col.r, mDb, helper, parents);
|
||||||
helper_pDataExport("color.g", col.g, db, helper, parents);
|
helper_pDataExport("color.g", col.g, mDb, helper, parents);
|
||||||
helper_pDataExport("color.b", col.b, db, helper, parents);
|
helper_pDataExport("color.b", col.b, mDb, helper, parents);
|
||||||
helper_pDataExport("color.a", col.a, db, helper, parents);
|
helper_pDataExport("color.a", col.a, mDb, helper, parents);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t == CKPGUID_2DCURVE) {
|
if (t == CKPGUID_2DCURVE) {
|
||||||
|
@ -488,27 +488,27 @@ void DigParameterData(CKParameterLocal* p, scriptDatabase* db, dbScriptDataStruc
|
||||||
endIndex = strlen(prefix);
|
endIndex = strlen(prefix);
|
||||||
|
|
||||||
changeSuffix(".pos.x");
|
changeSuffix(".pos.x");
|
||||||
helper_pDataExport(prefix, c->GetControlPoint(i)->GetPosition().x, db, helper, parents);
|
helper_pDataExport(prefix, c->GetControlPoint(i)->GetPosition().x, mDb, helper, parents);
|
||||||
changeSuffix(".pos.y");
|
changeSuffix(".pos.y");
|
||||||
helper_pDataExport(prefix, c->GetControlPoint(i)->GetPosition().y, db, helper, parents);
|
helper_pDataExport(prefix, c->GetControlPoint(i)->GetPosition().y, mDb, helper, parents);
|
||||||
changeSuffix(".islinear");
|
changeSuffix(".islinear");
|
||||||
helper_pDataExport(prefix, (long)c->GetControlPoint(i)->IsLinear(), db, helper, parents);
|
helper_pDataExport(prefix, (long)c->GetControlPoint(i)->IsLinear(), mDb, helper, parents);
|
||||||
if (c->GetControlPoint(i)->IsTCB()) {
|
if (c->GetControlPoint(i)->IsTCB()) {
|
||||||
changeSuffix(".bias");
|
changeSuffix(".bias");
|
||||||
helper_pDataExport(prefix, c->GetControlPoint(i)->GetBias(), db, helper, parents);
|
helper_pDataExport(prefix, c->GetControlPoint(i)->GetBias(), mDb, helper, parents);
|
||||||
changeSuffix(".continuity");
|
changeSuffix(".continuity");
|
||||||
helper_pDataExport(prefix, c->GetControlPoint(i)->GetContinuity(), db, helper, parents);
|
helper_pDataExport(prefix, c->GetControlPoint(i)->GetContinuity(), mDb, helper, parents);
|
||||||
changeSuffix(".tension");
|
changeSuffix(".tension");
|
||||||
helper_pDataExport(prefix, c->GetControlPoint(i)->GetTension(), db, helper, parents);
|
helper_pDataExport(prefix, c->GetControlPoint(i)->GetTension(), mDb, helper, parents);
|
||||||
} else {
|
} else {
|
||||||
changeSuffix(".intangent.x");
|
changeSuffix(".intangent.x");
|
||||||
helper_pDataExport(prefix, c->GetControlPoint(i)->GetInTangent().x, db, helper, parents);
|
helper_pDataExport(prefix, c->GetControlPoint(i)->GetInTangent().x, mDb, helper, parents);
|
||||||
changeSuffix(".intangent.y");
|
changeSuffix(".intangent.y");
|
||||||
helper_pDataExport(prefix, c->GetControlPoint(i)->GetInTangent().y, db, helper, parents);
|
helper_pDataExport(prefix, c->GetControlPoint(i)->GetInTangent().y, mDb, helper, parents);
|
||||||
changeSuffix(".outtangent.x");
|
changeSuffix(".outtangent.x");
|
||||||
helper_pDataExport(prefix, c->GetControlPoint(i)->GetOutTangent().x, db, helper, parents);
|
helper_pDataExport(prefix, c->GetControlPoint(i)->GetOutTangent().x, mDb, helper, parents);
|
||||||
changeSuffix(".outtangent.y");
|
changeSuffix(".outtangent.y");
|
||||||
helper_pDataExport(prefix, c->GetControlPoint(i)->GetOutTangent().y, db, helper, parents);
|
helper_pDataExport(prefix, c->GetControlPoint(i)->GetOutTangent().y, mDb, helper, parents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -521,7 +521,7 @@ void DigParameterData(CKParameterLocal* p, scriptDatabase* db, dbScriptDataStruc
|
||||||
helper->_db_pData->data.insert(0, cptr, 0, cc);
|
helper->_db_pData->data.insert(0, cptr, 0, cc);
|
||||||
helper->_db_pData->field = "str";
|
helper->_db_pData->field = "str";
|
||||||
helper->_db_pData->belong_to = p->GetID();
|
helper->_db_pData->belong_to = p->GetID();
|
||||||
db->write_pData(helper->_db_pData);
|
mDb->write_pData(helper->_db_pData);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -554,10 +554,10 @@ void DigParameterData(CKParameterLocal* p, scriptDatabase* db, dbScriptDataStruc
|
||||||
else
|
else
|
||||||
helper->_db_pData->field = "dump.partial_data";
|
helper->_db_pData->field = "dump.partial_data";
|
||||||
helper->_db_pData->belong_to = p->GetID();
|
helper->_db_pData->belong_to = p->GetID();
|
||||||
db->write_pData(helper->_db_pData);
|
mDb->write_pData(helper->_db_pData);
|
||||||
|
|
||||||
//dump data length
|
//dump data length
|
||||||
helper_pDataExport("dump.length", (long)cc, db, helper, parents);
|
helper_pDataExport("dump.length", (long)cc, mDb, helper, parents);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,23 +4,23 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
|
|
||||||
void generate_pLink_in_pIn(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB, BOOL isTarget);
|
void generate_pLink_in_pIn(CKContext* ctx, CKParameterIn* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB, BOOL isTarget);
|
||||||
void proc_pTarget(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents);
|
void proc_pTarget(CKContext* ctx, CKParameterIn* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents);
|
||||||
void proc_pIn(CKContext* ctx, CKParameterIn* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB);
|
void proc_pIn(CKContext* ctx, CKParameterIn* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB);
|
||||||
void proc_pOut(CKContext* ctx, CKParameterOut* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB);
|
void proc_pOut(CKContext* ctx, CKParameterOut* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, EXPAND_CK_ID grandparents, int index, BOOL executedFromBB);
|
||||||
void proc_bIn(CKBehaviorIO* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, int index);
|
void proc_bIn(CKBehaviorIO* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, int index);
|
||||||
void proc_bOut(CKBehaviorIO* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, int index);
|
void proc_bOut(CKBehaviorIO* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, int index);
|
||||||
void proc_bLink(CKBehaviorLink* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents);
|
void proc_bLink(CKBehaviorLink* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents);
|
||||||
void proc_pLocal(CKParameterLocal* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents, BOOL is_setting);
|
void proc_pLocal(CKParameterLocal* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents, BOOL is_setting);
|
||||||
void proc_pOper(CKContext* ctx, CKParameterOperation* cache, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents);
|
void proc_pOper(CKContext* ctx, CKParameterOperation* cache, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents);
|
||||||
void proc_pAttr(CKContext* ctx, scriptDatabase* db, dbScriptDataStructHelper* helper, CKParameter* cache);
|
void proc_pAttr(CKContext* ctx, DocumentDatabase* mDb, dbDocDataStructHelper* helper, CKParameter* cache);
|
||||||
|
|
||||||
void helper_pDataExport(const char* field, long data, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents);
|
void helper_pDataExport(const char* field, long data, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents);
|
||||||
void helper_pDataExport(const char* field, float data, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents);
|
void helper_pDataExport(const char* field, float data, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents);
|
||||||
void helper_pDataExport(const char* field, const char* data, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents);
|
void helper_pDataExport(const char* field, const char* data, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents);
|
||||||
|
|
||||||
void IterateBehavior(CKContext* ctx, CKBehavior* bhv, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents);
|
void IterateBehavior(CKContext* ctx, CKBehavior* bhv, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents);
|
||||||
void IterateScript(CKContext* ctx, scriptDatabase* db, dbScriptDataStructHelper* helper);
|
void IterateScript(CKContext* ctx, DocumentDatabase* mDb, dbDocDataStructHelper* helper);
|
||||||
void DigParameterData(CKParameterLocal* pl, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents);
|
void DigParameterData(CKParameterLocal* pl, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents);
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -8,7 +8,7 @@ combined_database::combined_database() :
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
db_shared_dictData* combined_database::get_struct() {
|
dbdoc_data* combined_database::get_struct() {
|
||||||
if (helper_script != NULL) return helper_script->_db_pData;
|
if (helper_script != NULL) return helper_script->_db_pData;
|
||||||
if (helper_data != NULL) return helper_data->_db_objParam;
|
if (helper_data != NULL) return helper_data->_db_objParam;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -20,22 +20,22 @@ char* combined_database::get_string_cache() {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void combined_database::write_dict(db_shared_dictData* data) {
|
void combined_database::write_dict(dbdoc_data* data) {
|
||||||
if (db_script != NULL) db_script->write_pData(data);
|
if (db_script != NULL) db_script->write_pData(data);
|
||||||
if (db_data != NULL) db_data->write_objParam(data);
|
if (db_data != NULL) db_data->write_objParam(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigParameterData(CKParameter* p, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents) {
|
void DigParameterData(CKParameter* p, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents) {
|
||||||
combined_database cdb;
|
combined_database cdb;
|
||||||
cdb.db_script = db;
|
cdb.db_script = mDb;
|
||||||
cdb.helper_script = helper;
|
cdb.helper_script = helper;
|
||||||
|
|
||||||
DigParameterData(p, &cdb, parents);
|
DigParameterData(p, &cdb, parents);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigParameterData(CKParameter* p, dataDatabase* db, dbDataDataStructHelper* helper, EXPAND_CK_ID parents) {
|
void DigParameterData(CKParameter* p, dataDatabase* mDb, dbDataDataStructHelper* helper, EXPAND_CK_ID parents) {
|
||||||
combined_database cdb;
|
combined_database cdb;
|
||||||
cdb.db_data = db;
|
cdb.db_data = mDb;
|
||||||
cdb.helper_data = helper;
|
cdb.helper_data = helper;
|
||||||
|
|
||||||
DigParameterData(p, &cdb, parents);
|
DigParameterData(p, &cdb, parents);
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
class combined_database {
|
class combined_database {
|
||||||
public:
|
public:
|
||||||
combined_database();
|
combined_database();
|
||||||
db_shared_dictData* get_struct();
|
dbdoc_data* get_struct();
|
||||||
char* get_string_cache();
|
char* get_string_cache();
|
||||||
void write_dict(db_shared_dictData* data);
|
void write_dict(dbdoc_data* data);
|
||||||
|
|
||||||
scriptDatabase* db_script;
|
DocumentDatabase* db_script;
|
||||||
dbScriptDataStructHelper* helper_script;
|
dbDocDataStructHelper* helper_script;
|
||||||
dataDatabase* db_data;
|
dataDatabase* db_data;
|
||||||
dbDataDataStructHelper* helper_data;
|
dbDataDataStructHelper* helper_data;
|
||||||
};
|
};
|
||||||
|
@ -21,11 +21,11 @@ public:
|
||||||
#define safeStringCopy(storage,str) storage=(str)?(str):"";
|
#define safeStringCopy(storage,str) storage=(str)?(str):"";
|
||||||
|
|
||||||
void DigParameterData(CKParameter* p, combined_database* helper, EXPAND_CK_ID parents);
|
void DigParameterData(CKParameter* p, combined_database* helper, EXPAND_CK_ID parents);
|
||||||
void DigParameterData(CKParameter* p, scriptDatabase* db, dbScriptDataStructHelper* helper, EXPAND_CK_ID parents);
|
void DigParameterData(CKParameter* p, DocumentDatabase* mDb, dbDocDataStructHelper* helper, EXPAND_CK_ID parents);
|
||||||
void DigParameterData(CKParameter* p, dataDatabase* db, dbDataDataStructHelper* helper, EXPAND_CK_ID parents);
|
void DigParameterData(CKParameter* p, dataDatabase* mDb, dbDataDataStructHelper* helper, EXPAND_CK_ID parents);
|
||||||
|
|
||||||
void helper_FillStruct(const char* field, long data, db_shared_dictData* helper);
|
void helper_FillStruct(const char* field, long data, dbdoc_data* helper);
|
||||||
void helper_FillStruct(const char* field, float data, db_shared_dictData* helper);
|
void helper_FillStruct(const char* field, float data, dbdoc_data* helper);
|
||||||
void helper_FillStruct(const char* field, const char* data, db_shared_dictData* helper);
|
void helper_FillStruct(const char* field, const char* data, dbdoc_data* helper);
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -17,11 +17,11 @@
|
||||||
|
|
||||||
|
|
||||||
#ifndef _AFX_NO_DB_SUPPORT
|
#ifndef _AFX_NO_DB_SUPPORT
|
||||||
#include <afxdb.h> // MFC ODBC database classes
|
#include <afxdb.h> // MFC ODBC SSMaterializerDatabase classes
|
||||||
#endif // _AFX_NO_DB_SUPPORT
|
#endif // _AFX_NO_DB_SUPPORT
|
||||||
|
|
||||||
#ifndef _AFX_NO_DAO_SUPPORT
|
#ifndef _AFX_NO_DAO_SUPPORT
|
||||||
#include <afxdao.h> // MFC DAO database classes
|
#include <afxdao.h> // MFC DAO SSMaterializerDatabase classes
|
||||||
#endif // _AFX_NO_DAO_SUPPORT
|
#endif // _AFX_NO_DAO_SUPPORT
|
||||||
|
|
||||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||||
|
|
0
SuperScriptMaterializer/string_helper.cpp
Normal file
0
SuperScriptMaterializer/string_helper.cpp
Normal file
1
SuperScriptMaterializer/string_helper.hpp
Normal file
1
SuperScriptMaterializer/string_helper.hpp
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#pragma once
|
|
@ -80,25 +80,25 @@ void PluginMenuCallback(int commandID) {
|
||||||
switch (commandID) {
|
switch (commandID) {
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
//init file
|
//Init file
|
||||||
std::string file;
|
std::string file;
|
||||||
OpenFileDialog(&file);
|
OpenFileDialog(&file);
|
||||||
if (file.empty())
|
if (file.empty())
|
||||||
break;
|
break;
|
||||||
DeleteFile(file.c_str());
|
DeleteFile(file.c_str());
|
||||||
|
|
||||||
//init resources
|
//Init resources
|
||||||
scriptDatabase* _db = new scriptDatabase();
|
DocumentDatabase* _db = new DocumentDatabase();
|
||||||
dbScriptDataStructHelper* _helper = new dbScriptDataStructHelper();
|
dbDocDataStructHelper* _helper = new dbDocDataStructHelper();
|
||||||
_db->open(file.c_str());
|
_db->Open(file.c_str());
|
||||||
_helper->init(ctx->GetParameterManager());
|
_helper->Init(ctx->GetParameterManager());
|
||||||
|
|
||||||
//iterate item
|
//iterate item
|
||||||
IterateScript(ctx, _db, _helper);
|
IterateScript(ctx, _db, _helper);
|
||||||
|
|
||||||
//close all resources
|
//Close all resources
|
||||||
_helper->dispose();
|
_helper->dispose();
|
||||||
_db->close();
|
_db->Close();
|
||||||
delete _helper;
|
delete _helper;
|
||||||
delete _db;
|
delete _db;
|
||||||
|
|
||||||
|
@ -107,18 +107,18 @@ void PluginMenuCallback(int commandID) {
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
//init file
|
//Init file
|
||||||
std::string file;
|
std::string file;
|
||||||
OpenFileDialog(&file);
|
OpenFileDialog(&file);
|
||||||
if (file.empty())
|
if (file.empty())
|
||||||
break;
|
break;
|
||||||
DeleteFile(file.c_str());
|
DeleteFile(file.c_str());
|
||||||
|
|
||||||
//init
|
//Init
|
||||||
envDatabase* _db = new envDatabase();
|
EnvironmentDatabase* _db = new EnvironmentDatabase();
|
||||||
dbEnvDataStructHelper* _helper = new dbEnvDataStructHelper();
|
dbEnvDataStructHelper* _helper = new dbEnvDataStructHelper();
|
||||||
_db->open(file.c_str());
|
_db->Open(file.c_str());
|
||||||
_helper->init();
|
_helper->Init();
|
||||||
|
|
||||||
//iterate parameter operation/param
|
//iterate parameter operation/param
|
||||||
IterateParameterOperation(ctx->GetParameterManager(), _db, _helper);
|
IterateParameterOperation(ctx->GetParameterManager(), _db, _helper);
|
||||||
|
@ -132,7 +132,7 @@ void PluginMenuCallback(int commandID) {
|
||||||
|
|
||||||
//release all
|
//release all
|
||||||
_helper->dispose();
|
_helper->dispose();
|
||||||
_db->close();
|
_db->Close();
|
||||||
delete _helper;
|
delete _helper;
|
||||||
delete _db;
|
delete _db;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ void PlayerMain(const char* virtools_composition, const char* script_db_path, co
|
||||||
printf("Homepage: https://github.com/yyc12345/SuperScriptMaterializer\n");
|
printf("Homepage: https://github.com/yyc12345/SuperScriptMaterializer\n");
|
||||||
printf("Report bug: https://github.com/yyc12345/SuperScriptMaterializer/issues\n");
|
printf("Report bug: https://github.com/yyc12345/SuperScriptMaterializer/issues\n");
|
||||||
|
|
||||||
// ====================== init ck2 engine
|
// ====================== Init ck2 engine
|
||||||
#if defined(VIRTOOLS_21)
|
#if defined(VIRTOOLS_21)
|
||||||
CommonAssert(LoadLibrary("CK2.dll") != NULL, "Error loading CK2.dll");
|
CommonAssert(LoadLibrary("CK2.dll") != NULL, "Error loading CK2.dll");
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,8 +34,8 @@ void PlayerMain(const char* virtools_composition, const char* script_db_path, co
|
||||||
#endif
|
#endif
|
||||||
printf("Parsing %s...\n", virtools_composition);
|
printf("Parsing %s...\n", virtools_composition);
|
||||||
|
|
||||||
// ====================== do database export
|
// ====================== do SSMaterializerDatabase export
|
||||||
// define and init
|
// define and Init
|
||||||
scriptDatabase* _script_db = new scriptDatabase();
|
scriptDatabase* _script_db = new scriptDatabase();
|
||||||
dbScriptDataStructHelper* _script_helper = new dbScriptDataStructHelper();
|
dbScriptDataStructHelper* _script_helper = new dbScriptDataStructHelper();
|
||||||
envDatabase* _env_db = new envDatabase();
|
envDatabase* _env_db = new envDatabase();
|
||||||
|
@ -88,13 +88,13 @@ void PlayerMain(const char* virtools_composition, const char* script_db_path, co
|
||||||
context->ClearAll();
|
context->ClearAll();
|
||||||
|
|
||||||
// todo: Virtools 4.0 standalone version throw exception in there, but i don't knwo why
|
// todo: Virtools 4.0 standalone version throw exception in there, but i don't knwo why
|
||||||
// but it doesn't affect database export, perhaps
|
// but it doesn't affect SSMaterializerDatabase export, perhaps
|
||||||
CKCloseContext(context);
|
CKCloseContext(context);
|
||||||
|
|
||||||
CKShutdown();
|
CKShutdown();
|
||||||
|
|
||||||
// todo: Virtools 2.5 standalone version throw exception in there, but i don't knwo why
|
// todo: Virtools 2.5 standalone version throw exception in there, but i don't knwo why
|
||||||
// but it doesn't affect database export, perhaps
|
// but it doesn't affect SSMaterializerDatabase export, perhaps
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommonAssert(BOOL condition, const char* desc) {
|
void CommonAssert(BOOL condition, const char* desc) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user