commit dfea385dd576790c6386b83d4550a1b2583f9d99 Author: lijh Date: Tue Mar 10 15:53:57 2026 +0800 first commit diff --git a/.vs/connor_signature/v16/.suo b/.vs/connor_signature/v16/.suo new file mode 100644 index 0000000..c00db97 Binary files /dev/null and b/.vs/connor_signature/v16/.suo differ diff --git a/.vs/connor_signature/v16/Browse.VC.db b/.vs/connor_signature/v16/Browse.VC.db new file mode 100644 index 0000000..f75b120 Binary files /dev/null and b/.vs/connor_signature/v16/Browse.VC.db differ diff --git a/connor_signature.VC.db b/connor_signature.VC.db new file mode 100644 index 0000000..84d1c15 Binary files /dev/null and b/connor_signature.VC.db differ diff --git a/connor_signature.sdf b/connor_signature.sdf new file mode 100644 index 0000000..e157479 Binary files /dev/null and b/connor_signature.sdf differ diff --git a/connor_signature.sln b/connor_signature.sln new file mode 100644 index 0000000..11c4720 --- /dev/null +++ b/connor_signature.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "meling_itk", "connor_signature\connor_signature.vcxproj", "{87A8539F-972D-4E90-844B-DABEE71C1D40}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {87A8539F-972D-4E90-844B-DABEE71C1D40}.Debug|Win32.ActiveCfg = Debug|Win32 + {87A8539F-972D-4E90-844B-DABEE71C1D40}.Debug|Win32.Build.0 = Debug|Win32 + {87A8539F-972D-4E90-844B-DABEE71C1D40}.Debug|x64.ActiveCfg = Debug|x64 + {87A8539F-972D-4E90-844B-DABEE71C1D40}.Debug|x64.Build.0 = Debug|x64 + {87A8539F-972D-4E90-844B-DABEE71C1D40}.Release|Win32.ActiveCfg = Release|Win32 + {87A8539F-972D-4E90-844B-DABEE71C1D40}.Release|Win32.Build.0 = Release|Win32 + {87A8539F-972D-4E90-844B-DABEE71C1D40}.Release|x64.ActiveCfg = Release|x64 + {87A8539F-972D-4E90-844B-DABEE71C1D40}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/connor_signature.v11.suo b/connor_signature.v11.suo new file mode 100644 index 0000000..36b9597 Binary files /dev/null and b/connor_signature.v11.suo differ diff --git a/connor_signature/CRUL_server_call_httpserver2.h b/connor_signature/CRUL_server_call_httpserver2.h new file mode 100644 index 0000000..f7ad0e7 --- /dev/null +++ b/connor_signature/CRUL_server_call_httpserver2.h @@ -0,0 +1,8 @@ +#pragma once +#include +#include +#include +using namespace std; +void callHttpserver(string signinfoJsonString, char* HTTP_HOST); +void callHttpserverDwgtopdf(string signinfoJsonString, char* HTTP_HOST); +void callHttpserverMail(string signinfoJsonString, char* HTTP_HOST); \ No newline at end of file diff --git a/connor_signature/Connor_ElevateTask.cpp b/connor_signature/Connor_ElevateTask.cpp new file mode 100644 index 0000000..1f3faae --- /dev/null +++ b/connor_signature/Connor_ElevateTask.cpp @@ -0,0 +1,61 @@ +/*============================================================================== + Copyright (c) 2008-2018 Connor Corporation + Unpublished - All Rights Reserved +==============================================================================*/ +#include "kutil.h" + +int LD_ElevateTask(EPM_action_message_t msg) +{ + printf("=========================̽ڵ Start===================\n"); + int ifail = ITK_ok, att_cnt = 0, i = 0, arg_cnt = 0; + tag_t task_tag = NULL_TAG, rootTask_tag = NULL_TAG; + task_tag = msg.task; + if (task_tag == NULLTAG) + { + return -1; + } + ITKCALL(EPM_ask_root_task(task_tag, &rootTask_tag)); + char* taskname = NULL, * type = NULL; + ITKCALL(EPM_ask_name2(task_tag, &taskname)); + ITKCALL(AOM_ask_value_string(task_tag, "object_type", &type)); + printf("name=%s\n", taskname); + printf("type=%s\n", type); + if (strcmp(type, "EPMReviewTask") == 0 || strcmp(type, "EPMAcknowledgeTask") == 0) + { + int num = 0; + tag_t* sub_tags = NULL; + ITKCALL(EPM_ask_sub_tasks(task_tag, &num, &sub_tags)); + for (int j = 0; j < num; j++) + { + char* taskname2 = NULL, * type2 = NULL; + ITKCALL(EPM_ask_name2(sub_tags[j], &taskname2)); + ITKCALL(AOM_ask_value_string(sub_tags[j], "object_type", &type2)); + if (strcmp(type2, "EPMPerformSignoffTask") == 0) + { + printf("name2=%s,type2=%s\n", taskname2, type2); + int valid_num = 0; + tag_t* valid_tags = NULL; + ITKCALL(AOM_ask_value_tags(sub_tags[j], "valid_signoffs", &valid_num, &valid_tags)); + printf("valid_num=%d\n", valid_num); + if (valid_num == 0) + { + printf("δѡִ\n"); + POM_AM__set_application_bypass(true); + ITKCALL(EPM_promote_task(task_tag, "")); + POM_AM__set_application_bypass(false); + } + DOFREE(valid_tags); + + } + DOFREE(taskname2); + DOFREE(type2); + + } + DOFREE(sub_tags); + + } + DOFREE(taskname); + DOFREE(type); + printf("=========================̽ڵ End===================\n"); + return ITK_ok; +} diff --git a/connor_signature/Connor_Review_Person.cpp b/connor_signature/Connor_Review_Person.cpp new file mode 100644 index 0000000..85d3e4c --- /dev/null +++ b/connor_signature/Connor_Review_Person.cpp @@ -0,0 +1,244 @@ +#include"kutil.h" +#define debug true +#define ITK_err 919012 + +int Connor_Review_Person(EPM_action_message_t msg) { + int ifail = ITK_ok, arg_cnt = 0, att_cnt = 0, task_count = 0, ifTabel = 0;//0tableԣ1table + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + string type, proName; + string processNameRel; + vector types; + vector proNames; + tag_t* attachments = NULLTAG, task_tag = NULLTAG, rootTask_tag = NULLTAG, * task_tags = NULLTAG; + set sh_set; + + WriteLog(debug, "ʼִУȡtableΪ˽ڵ(Connor_Review_Person) ..."); + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "From") == 0) { + type.assign(argvalue); + } + else if (strcmp(argflag, "Person") == 0) { + proName.assign(argvalue); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + else { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲"); + ifail = 1; + goto end; + } + { + Split(type, ";", types); + if (types.size() == 0) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-From"); + goto end; + } + if (strstr(proName.c_str(), ".") != NULL) { + ifTabel = 1; + Split(proName, ".", proNames); + if (proNames.size() == 0) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-Person"); + goto end; + } + } + } + + //õǰڵ + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + ITKCALL(ifail = EPM_ask_root_task(task_tag, &rootTask_tag)); + //ȡĿж + ITKCALL(ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt == 0) { + goto end; + } + char* task_type = NULL; + WSOM_ask_object_type2(task_tag, &task_type); + printf("ǰڵΪ:%s\n", task_type); + char* processName; + EPM_ask_name2(task_tag, &processName); + printf("ȡ̽ڵ ==== %s \n", processName); + int ifPromote = 0; + if (strcmp("EPMReviewTask", task_type) == 0) { + vector ans; + Split(processName, "_", ans); + processNameRel.append(ans[0]); + } + else if (strcmp("EPMAcknowledgeTask", task_type) == 0) { + processNameRel.append(processName); + } + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + + for each (string type in types) + { + if (!isTypeOf(attachment, type.c_str())) + { + continue; + } + if (ifTabel == 0) { + char** values = NULL; + int value_count = 0; + AOM_ask_value_strings(attachment, proName.c_str(), &value_count, &values); + for (int j = 0; j < value_count; j++) { + if (sh_set.insert(values[j]).second == false) { + continue; + } + } + } + else if (ifTabel == 1) { + printf("ȡ=====\n"); + tag_t* tags = NULL, * rows = NULLTAG; + int value_count = 0; + int tags_count = 0; + //õ + printf("Ϊ%s====Ϊ%s=====Ϊ%s\n", proNames[0].c_str(), proNames[1].c_str(), proNames[2].c_str()); + AOM_ask_value_tags(attachment, proNames[0].c_str(), &tags_count, &tags); + //õ + printf("ȡе===\n"); + for (int j = 0; j < tags_count; j++) { + char* cellValue = NULL; + char* isFlag = NULL, * changeName; + AOM_ask_value_string(tags[j], proNames[2].c_str(), &cellValue); + AOM_ask_value_string(tags[j], "ld6_YNChange", &isFlag); + AOM_ask_value_string(tags[j], "ld6_ChangeTaskName", &changeName); + + //printf("õĸΪ:%s\n", changeName); + if (strcmp(changeName, processNameRel.c_str()) != 0) { + continue; + } + printf("isFlagΪ:%s\n", isFlag); + printf("õûIDΪ:%s\n", cellValue); + if (strcmp(changeName, processNameRel.c_str()) == 0 && (strcmp("", isFlag) == 0)) { + ifPromote++; + continue; + } + if (strcmp("", isFlag) != 0) { + continue; + } + if (strcmp("", cellValue) == 0 || strcmp(" ", cellValue) == 0) { + continue; + } + + string userID = cellValue; + if (strstr(cellValue, "") != NULL) { + vector vec1; + Split(cellValue, "", vec1); + if (strstr(vec1[1].c_str(), "") != NULL) { + vector vec2; + Split(vec1[1], "", vec2); + userID = vec2[0]; + } + } + if (strstr(cellValue, "(") != NULL) { + vector vec1; + Split(cellValue, "(", vec1); + if (strstr(vec1[1].c_str(), ")") != NULL) { + vector vec2; + Split(vec1[1], ")", vec2); + userID = vec2[0]; + } + } + printf("ûIDΪ:%s\n", userID.c_str()); + if (sh_set.insert(userID).second == false) { + continue; + } + } + //AOM_ask_table_rows(tags[0], proNames[2].c_str(), &value_count, &rows); + /*for (int j = 0; j < value_count; j++) { + char* cellValue = NULL; + AOM_ask_value_string(rows[j], proNames[2].c_str(), &cellValue); + if (sh_set.insert(cellValue).second == false) { + continue; + } + }*/ + } + } + } + + //EPM_ask_sub_tasks(rootTask_tag, &task_count, &task_tags); + //printf("%d\n", task_count); + //printf("%d\n", sh_set.size()); + //for (int i = 0; i < task_count; i++) { + // char* task_type = NULL; + // WSOM_ask_object_type2(task_tags[i], &task_type); + // printf("ǰڵΪ:%s\n", task_type); + // if (strcmp("EPMReviewTask", task_type) == 0) { + // char* object_name = NULL; + // int mem_cnt = 0, signoff_cnt = 0; + // tag_t user_tag = NULLTAG, login_group = NULLTAG, * members = NULLTAG, * signoffs = NULLTAG, select_signoff_tag = NULLTAG; + // AOM_ask_value_string(task_tags[i], "object_name", &object_name);// + // EPM_ask_sub_task(task_tags[i], "select-signoff-team", &select_signoff_tag); + // printf("ǰڵΪ:%s\n", object_name); + // if (strcmp("", object_name) == 0) { + // for (set::iterator it = sh_set.begin(); it != sh_set.end(); it++) { + // printf("ӣ%s\n", it->c_str()); + // ITKCALL(SA_find_user2(it->c_str(), &user_tag)); + // ITKCALL(SA_ask_user_login_group(user_tag, &login_group)); + // ITKCALL(SA_find_groupmembers(user_tag, login_group, &mem_cnt, &members)); + // ITKCALL(EPM_create_adhoc_signoff(select_signoff_tag, members[0], &signoff_cnt, &signoffs)); + // } + // if (sh_set.size() > 0) { + // ITKCALL(EPM_set_adhoc_signoff_selection_done(select_signoff_tag, true)); + // } + // } + // DOFREE(object_name); + // DOFREE(members); + // DOFREE(signoffs); + // } + //} + printf("˵Ϊ%d======ifPromoteΪ%d\n", sh_set.size(), ifPromote); + if (strcmp("EPMAcknowledgeTask", task_type) == 0) { + int mem_cnt = 0, signoff_cnt = 0,signmem_count = 0, * attach_type; + tag_t user_tag = NULLTAG, login_group = NULLTAG, * members = NULLTAG, * signoffs = NULLTAG, select_signoff_tag = NULLTAG, *attachmentTags = NULLTAG; + EPM_ask_sub_task(task_tag, "select-signoff-team", &select_signoff_tag); + //EPM_ask_sub_task(task_tags[i], "select-signoff-team", &cur_perform_task); + EPM_ask_all_attachments(select_signoff_tag, &signmem_count, &attachmentTags, &attach_type); + if (signmem_count == 0) { + for (set::iterator it = sh_set.begin(); it != sh_set.end(); it++) { + printf("ӣ%s\n", it->c_str()); + ITKCALL(SA_find_user2(it->c_str(), &user_tag)); + ITKCALL(SA_ask_user_login_group(user_tag, &login_group)); + ITKCALL(SA_find_groupmembers(user_tag, login_group, &mem_cnt, &members)); + ITKCALL(EPM_create_adhoc_signoff(select_signoff_tag, members[0], &signoff_cnt, &signoffs)); + } + if (sh_set.size() > 0) { + ITKCALL(EPM_set_adhoc_signoff_selection_done(select_signoff_tag, true)); + } + if (sh_set.size() == 0 && ifPromote != 0) { + POM_AM__set_application_bypass(true); + ITKCALL(EPM_promote_task(task_tag, "")); + POM_AM__set_application_bypass(false); + + } + } + DOFREE(members); + DOFREE(signoffs); + } + else if (strcmp("EPMReviewTask", task_type) == 0) { + if (sh_set.size() == 0 && ifPromote != 0) { + POM_AM__set_application_bypass(true); + ITKCALL(EPM_promote_task(task_tag, "")); + POM_AM__set_application_bypass(false); + + } + } + + +end: + DOFREE(attachments); + types.clear(); + sh_set.clear(); + set().swap(sh_set); + WriteLog(debug, "ִнȡtableΪ˽ڵ(Connor_Review_Person)..."); + return ifail; +} \ No newline at end of file diff --git a/connor_signature/Connor_allow_Workflow.cpp b/connor_signature/Connor_allow_Workflow.cpp new file mode 100644 index 0000000..ed50656 --- /dev/null +++ b/connor_signature/Connor_allow_Workflow.cpp @@ -0,0 +1,92 @@ +#include"kutil.h" +#define ITK_err 919012 + +int Connor_allow_Workflow(EPM_action_message_t msg) { + int ifail = ITK_ok, att_cnt = 0, arg_cnt = 0; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + tag_t* attachments = NULLTAG, task_tag = NULLTAG, rootTask_tag; + string type, grant_value; + vector types; + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "type") == 0) { + type.assign(argvalue); + printf("%s\n", argvalue); + } + else if (strcmp(argflag, "grant") == 0) { + grant_value.assign(argvalue); + printf("%s\n", argvalue); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + else { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲"); + ifail = 1; + goto end; + } + { + if (grant_value.empty()) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-grant"); + ifail = 1; + goto end; + } + Split(type, ";", types); + if (types.size() == 0) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-type"); + ifail = 1; + goto end; + } + } + task_tag = msg.task; + if (task_tag == NULLTAG) { + ifail = 1; + goto end; + } + ITKCALL(ifail = EPM_ask_root_task(task_tag, &rootTask_tag)); + //ȡĿж + ITKCALL(ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt == 0) { + goto end; + } + printf("typesijΪ%d\n", types.size()); + for (int i = 0; i < att_cnt; i++) + { + tag_t target_tag = attachments[i]; + char* object_type = NULL; + AOM_ask_value_string(target_tag,"object_type",&object_type); + printf("ǰΪ:%s\n",object_type); + int sum = 0; + for each (string type in types) + { + if (isTypeOf(target_tag, type.c_str())) + { + sum++; + //EMH_store_error_s1(EMH_severity_error, ITK_err, "̲-typeв"); + //ifail = 1; + //goto end; + } + } + printf("sumijΪ%d\n", sum); + if (sum == 0) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "̲-typeв"); + ifail = 1; + goto end; + } + logical verdict = false; + ITKCALL(ifail = AM_check_privilege(target_tag, grant_value.c_str(), &verdict)); + if (!verdict) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "Ȩ޲ϣ"); + ifail = 1; + goto end; + } + } + +end: + DOFREE(attachments); + return ifail; +} \ No newline at end of file diff --git a/connor_signature/LD_AutoAssign.cpp b/connor_signature/LD_AutoAssign.cpp new file mode 100644 index 0000000..81da87c --- /dev/null +++ b/connor_signature/LD_AutoAssign.cpp @@ -0,0 +1,265 @@ +#include"kutil.h" +#include "ado.h" +#define debug true +#define ITK_err 919012 + +//ݼļ +int export_dataset_file_to_dir(tag_t dataset, const char *ref_name, const char* temp_path, char *ext, char **filename, char **original_name) +{ + int ifail = ITK_ok; + tag_t ref_object = NULLTAG, + datasettype = NULLTAG, + new_ds = NULLTAG, + tool = NULLTAG, + folder_tag = NULLTAG, + spec_dataset_rev = NULLTAG; + AE_reference_type_t reference_type; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor; + char *target_ds_name = NULL; + char *new_file_name; + WSOM_ask_name2(dataset, &target_ds_name); + WriteLog(debug, "ʼݼ<%s>ļ", target_ds_name); + DOFREE(target_ds_name); + *filename = (char *)MEM_alloc(sizeof(char) * 512); + *original_name = (char *)MEM_alloc(sizeof(char) * 512); + strcpy(*filename, ""); + AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev); + AE_ask_dataset_named_ref2(dataset, ref_name, &reference_type, &ref_object); + if (ref_object == NULLTAG) + { + WriteLog(debug, "ļΪ"); + return 1; + } + if (reference_type == AE_PART_OF) + { + char *pathname2 = NULL; + IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname2); + DOFREE(pathname2); + char *origin_file_name2 = NULL; + IMF_ask_original_file_name2(ref_object, &origin_file_name2); + strcpy(*original_name, origin_file_name2); + DOFREE(origin_file_name2); + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, temp_path); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + WriteLog(debug, "ʱļ·%s", temp_file); + if ((_access(temp_file, 0)) != -1) { + if (!remove(temp_file)) { + remove(temp_file); + } + } + ITKCALL(ifail = IMF_export_file(ref_object, temp_file)); + strcpy(*filename, temp_file); + return ifail; + } + return -1; +} +int uploadFile(void* returnValue) { + int ifail = ITK_ok; + char *datasetUid,*refName,*ext, *dataset_file_path, *dataset_file_name; + ITKCALL(ifail = USERARG_get_string_argument(&datasetUid)); + ITKCALL(ifail = USERARG_get_string_argument(&refName)); + ITKCALL(ifail = USERARG_get_string_argument(&ext)); + tag_t dataset; + ITK__convert_uid_to_tag(datasetUid, &dataset); + export_dataset_file_to_dir(debug, dataset, refName, "D:\\Siemens\\IIS\\web\\file", ext, &dataset_file_path, &dataset_file_name); + string buff = dataset_file_path; + *((char**)returnValue) = (char*)MEM_alloc((strlen(buff.c_str()) + 1) * sizeof(char)); + tc_strcpy(*((char**)returnValue), buff.c_str()); + return ifail; +} + +int LD_AutoAssign(EPM_action_message_t msg) { + int ifail = ITK_ok, arg_cnt = 0, att_cnt = 0, task_count = 0; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + tag_t* attachments = NULLTAG, task_tag = NULLTAG, rootTask_tag = NULLTAG, * task_tags = NULLTAG; + vector values; + set sh_set; + getPrefStrings("Connor_PRType_Person_Mapping", TC_preference_site,values); + //õǰڵ + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + ITKCALL(ifail = EPM_ask_root_task(task_tag, &rootTask_tag)); + //ȡĿж + ITKCALL(ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt == 0) { + goto end; + } + + for (int i = 0; i < att_cnt; i++) + { + char* object_type = NULL; + AOM_ask_value_string(attachments[i],"object_type",&object_type); + if (strcmp("LD6_PRRevision",object_type) == 0) { + char* problem_type = NULL; + char* company_value = NULL; + AOM_ask_value_string(attachments[i], "ld6_company", &company_value); + AOM_ask_value_string(attachments[i], "ld6_problemType", &problem_type); + /*for each (string problem in values) + { + vector split; + Split(problem.c_str(), "=", split); + if (split.size() == 2 && strcmp(split[0].c_str(),problem_type) == 0) { + if (sh_set.insert(split[1]).second == false) { + continue; + } + } + }*/ + for each (string company in values) + { + vector split; + vector split2; + Split(company.c_str(), ":", split); + if (split[0].empty()) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", company.c_str()); + goto end; + } + //˾ͬ + if (split.size() == 2 && strcmp(split[0].c_str(), company_value) == 0) { + Split(split[1].c_str(), "=", split2); + if (split2.size() == 2) { + //Ϊ + if (split2[0].empty()) { + if (sh_set.insert(split2[1]).second == false) { + continue; + } + } + //ͲΪգͬ + else if (strcmp(split2[0].c_str(), problem_type) == 0) { + if (sh_set.insert(split2[1]).second == false) { + continue; + } + } + } + + } + } + } + } + + char* task_type = NULL; + WSOM_ask_object_type2(task_tag, &task_type); + printf("ǰڵΪ:%s\n", task_type); + if (strcmp("EPMReviewTask", task_type) == 0 || strcmp("EPMAcknowledgeTask", task_type) == 0) { + char* object_name = NULL; + int mem_cnt = 0, signoff_cnt = 0; + tag_t user_tag = NULLTAG, login_group = NULLTAG, * members = NULLTAG, * signoffs = NULLTAG, select_signoff_tag = NULLTAG; + AOM_ask_value_string(task_tag, "object_name", &object_name);// + EPM_ask_sub_task(task_tag, "select-signoff-team", &select_signoff_tag); + printf("ǰڵΪ:%s\n", object_name); + + int attachments_num = 0,* attach_type; tag_t* attachmentTags; + EPM_ask_all_attachments(select_signoff_tag, &attachments_num, &attachmentTags, &attach_type); + if (attachments_num > 0) { + goto end; + } + + for (set::iterator it = sh_set.begin(); it != sh_set.end(); it++) { + printf("ӣ%s\n", it->c_str()); + ITKCALL(SA_find_user2(it->c_str(), &user_tag)); + ITKCALL(SA_ask_user_login_group(user_tag, &login_group)); + ITKCALL(SA_find_groupmembers(user_tag, login_group, &mem_cnt, &members)); + ITKCALL(EPM_create_adhoc_signoff(select_signoff_tag, members[0], &signoff_cnt, &signoffs)); + } + if (sh_set.size() > 0) { + ITKCALL(EPM_set_adhoc_signoff_selection_done(select_signoff_tag, true)); + } + DOFREE(object_name); + DOFREE(members); + DOFREE(signoffs); + } + if (strcmp("EPMDoTask", task_type) == 0 || strcmp("EPMConditionTask", task_type) == 0) { + tag_t user_tag = NULLTAG; + for (set::iterator it = sh_set.begin(); it != sh_set.end(); it++) { + ITKCALL(SA_find_user2(it->c_str(), &user_tag)); + ITKCALL(EPM_assign_responsible_party(task_tag, user_tag));//ñƽڵη + } + } +end: + DOFREE(attachments); + return ifail; +} +int ML_ItemRevSave(METHOD_message_t* msg, va_list args) +{ + printf("========================= Start===================\n"); + int ifail = ITK_ok; + tag_t new_rev = va_arg(args, tag_t); + + if (isTypeOf(new_rev, "Part Revision")) { + printf("ΪPart Revision \n"); + char* ld6_materialDesc, * item_id; + AOM_ask_value_string(new_rev, "ld6_materialDesc", &ld6_materialDesc); + AOM_ask_value_string(new_rev, "item_id", &item_id); + tag_t query; + int n_found; + ITKCALL(ifail = QRY_find2("6LD_Om_PartRevision", &query)); + tag_t* tags; + boolean saveFlag = true; + char* qry_entries[2] = { "materialDesc" ,"id01" }, + * qry_values[2] = { ld6_materialDesc ,item_id }, * errorId = ""; + ITKCALL(ifail = QRY_execute(query, 2, qry_entries, qry_values, &n_found, &tags)); + if (n_found == 0) { + saveFlag = true; + } + else { + + for (int i = 0; i < n_found; i++) { + char* itemId; + AOM_ask_value_string(tags[i], "item_id", &itemId); + printf("ѯitemId==> %s\n", itemId); + } + ifail = 1; + saveFlag = false; + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ʾ", + "ѴͬĶظ!"); + } + + } + + va_end(args); + return ifail; +} +// +// +//int LD6_CusProdFolderSave(METHOD_message_t* msg, va_list args) +//{ +// +// char* log_file = NULL; +// +// printf("־ļ\n"); +// char* TO_SRM = (char*)malloc(sizeof("LD6_CusProdFolderSave")); +// strcpy(TO_SRM, "emp_register_handler"); +// CreateLogFile(TO_SRM,"", &log_file); +// +// WriteLog(true, "=========================ļк Start===================\n"); +// int ifail = ITK_ok; +// tag_t folder = va_arg(args, tag_t); +// +// if (isTypeOf(folder, "LD6_CusProdFolder")) { +// //ݿⱣ浱ǰƵݿ +// char* folder_uid; +// ITK__convert_tag_to_uid(folder,&folder_uid);//ȡļuid +// bool conn = open("infodba", "infodba", "TC13", "10.10.22.39"); +// if (conn != NULL && conn) { +// WriteLog(true, "=========================ӳɹ===================\n"); +// } +// else { +// WriteLog(true, "=========================ʧ==================\n"); +// } +// +// +// } +// +// va_end(args); +// WriteLog(true, "=========================ļк End===================\n"); +// CloseLog(); +// return ifail; +//} \ No newline at end of file diff --git a/connor_signature/LD_CompletionDate.cpp b/connor_signature/LD_CompletionDate.cpp new file mode 100644 index 0000000..85dc1c0 --- /dev/null +++ b/connor_signature/LD_CompletionDate.cpp @@ -0,0 +1,128 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "ado.h" +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + +#define debug true +#define ITK_err 919012 + +int LD_CompletionDate(EPM_action_message_t msg) { + printf("=========================ʼ===================\n"); + + int cnt = 0; + char** vals = NULL; + //ȡѡֵ + PREF_ask_char_values("LD_dbinfo2", &cnt, &vals); + + + //ȡǰʱ + time_t now = time(0); + tm* p = localtime(&now); + char dateNow[128] = ""; + sprintf_s(dateNow, "%04d%02d%02d%02d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + string dateString = dateNow; + + int ifail = ITK_ok; + int attachments_num = 0; + tag_t rootTask = NULLTAG, * attachments = NULLTAG; + //ȡ + EPM_ask_root_task(msg.task, &rootTask); + //ȡĿ + EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments); + + + for (int r = 0; r < attachments_num; r++) { + char* itemObjId; + char* objectType; + char* revision_id; + AOM_ask_value_string(attachments[r], "object_type", &objectType); + printf("objectType===%s\n", objectType); + if (strcmp(objectType, "LD6_CusProdFolder") == 0) { + + //ȡǰconditionڵֵ + tag_t* fnd0ActuatedInteractiveTsks_val; + int fnd0ActuatedInteractiveTsks_num = 0; + AOM_ask_value_tags(attachments[r], "fnd0ActuatedInteractiveTsks", &fnd0ActuatedInteractiveTsks_num, &fnd0ActuatedInteractiveTsks_val); + if (fnd0ActuatedInteractiveTsks_num > 0) { + + for (int i = 0; i < fnd0ActuatedInteractiveTsks_num; i++) + { + char* task_type; + AOM_ask_value_string(fnd0ActuatedInteractiveTsks_val[i], "task_type", &task_type); + printf("task_type===%s\n", task_type); + if (strcmp(task_type, "EPMConditionTask") == 0) { + + char* task_result; + AOM_ask_value_string(fnd0ActuatedInteractiveTsks_val[i], "task_result", &task_result); + printf("task_result===%s\n", task_result); + + //ݿⱣ浱ǰƵݿ + char* folder_uid; + ITK__convert_tag_to_uid(attachments[r], &folder_uid);//ȡļuid + + if (open("infodba", "infodba", vals[1], vals[0])) { + printf("=========================ʧ===================\n"); + } + else { + //ȡǰʱ + auto now = std::chrono::system_clock::now(); + std::time_t time = std::chrono::system_clock::to_time_t(now); + std::tm* ptm = std::localtime(&time); + char buf[128]; + strftime(buf, sizeof(buf), "%Y-%m-%d", ptm); + printf("time===%s\n", buf); + //update + char sql[200] = ""; + sprintf(sql, "UPDATE LD6_NewProdForm_VALUES SET CompletionDate = '%s' WHERE ClientProductFolderPUID = '%s' AND NewProductTaskItem = '%s'", buf, folder_uid, task_result); + printf("sql===%s\n", sql); + if (ExecuteSQLNoInputParam(sql) == 0) + { + printf("=========================޸ijɹ===================\n"); + } + else + { + printf("=========================޸ʧ===================\n"); + } + } + break; + } + + } + + + + } + } + } + + printf("============================================\n"); + return 0; + } + + diff --git a/connor_signature/LD_ECN01_SetCICNFormProperty.cpp b/connor_signature/LD_ECN01_SetCICNFormProperty.cpp new file mode 100644 index 0000000..a67b7e2 --- /dev/null +++ b/connor_signature/LD_ECN01_SetCICNFormProperty.cpp @@ -0,0 +1,534 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include + +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + + +#define debug true +#define ITK_err 919012 + +int is_in(char* wenben, char* search_word) +{ + int i = 0, j = 0, flag = -1; + while (i < strlen(wenben) && j < strlen(search_word)) + { + if (wenben[i] == search_word[j]) + { //ַַͬ + i++; + j++; + } + else + { + i = i - j + 1; //ַصȽʼȽϵĺһַ + j = 0; //ִַ¿ʼ + } + if (j == strlen(search_word)) + { //ƥɹ + flag = 1; //ִ + break; + } + } + return flag; +} + + + +int LD_ECN01_SetCICNFormProperty(EPM_action_message_t msg) { + printf("================================================ʼִLD_ECN01_SetCICNFormProperty================================================\n"); + //· + POM_AM__set_application_bypass(true); + int att_cnt = 0; + int doc_num = 0; + tag_t rootTask_tag = NULLTAG; + tag_t task = NULLTAG; + tag_t* attachments = NULLTAG; + tag_t* doc_tags = NULLTAG; + string error; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + int arg_cnt = TC_number_of_arguments(msg.arguments); + char* property = NULL, * value = NULL, * type = NULL; + task = msg.task; + string erro2 = ""; + string erro = ""; + int send1 = 0; + int send2 = 0; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "property") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + property = argvalue; + + } + } + if (strcmp(argflag, "value") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + value = argvalue; + } + } + } + //ȡĿϵµĶ + printf("ȡĿϵµĶ\n"); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + for (int i = 0; i < doc_num; i++) { + char* objtype = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &objtype)); + if (strcmp("LD6_CNRevision", objtype) == 0) { + int relnum; tag_t* reltags; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "LD6_WorkFRelation", &relnum, &reltags)); + for (int j = 0; j < relnum; j++) { + //ȡ + printf("ȡ\n"); + char* formtype; + tag_t form = NULL; + ITKCALL(AOM_ask_value_string(reltags[j], "object_type", &formtype)); + if (strcmp(formtype, "LD6_CIForm") == 0 || strcmp(formtype, "LD6_CNForm") == 0) { + printf("ʼ޸ֵ\n"); + //ʼ޸ֵ + AOM_lock(reltags[j]); + //ȡǰ̽ڵ + printf("ȡǰ̽ڵ\n"); + char* taskName, * getValue; + ITKCALL(AOM_ask_value_string(task, "object_name", &taskName)); + printf("ǰ̽ڵΪ%s\n",taskName); + // + int num;// + tag_t* rows = NULL;// + ITKCALL(AOM_ask_table_rows(reltags[j], "ld6_ChangeTable", &num, &rows)); + printf("ȡ\n"); + for (int b = 0; b < num; b++) { + ITKCALL(AOM_ask_value_string(rows[b], "ld6_ChangeTaskName", &getValue)); + printf("ȡУ%s\n", getValue); + if (strstr(taskName, getValue)!=NULL) { + printf("ȡͬ\n"); + char* flag; + ITKCALL(AOM_ask_value_string(rows[b], "ld6_YNChange", &flag)); + printf("ȡld6_YNChangeΪ%s\n", flag); + if (strcmp(flag, "") == 0) { + printf("޸\n"); + vector pripers; + Split(property, ";", pripers); + vector values; + Split(value, ";", values); + if (pripers.size() == values.size()) { + for (int a = 0; a < pripers.size(); a++) { + AOM_lock(rows[b]); + vector atts; + Split(pripers[a], ".", atts); + if (strcmp(atts[1].c_str(), "date") == 0) { + printf("ȡʱ\n"); + date_t vadate; + if (strcmp(values[a].c_str(), "SysDate") == 0) { + // ȡǰʱ + auto timeNow = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); + // תΪʱ + tm localTime; + localtime_s(&localTime, &timeNow); + // ʼdate_t + vadate.year = localTime.tm_year + 1900; + vadate.month = static_cast(localTime.tm_mon) + 1; + vadate.day = static_cast(localTime.tm_mday); + vadate.hour = static_cast(localTime.tm_hour); + vadate.minute = static_cast(localTime.tm_min); + vadate.second = static_cast(localTime.tm_sec); + } + else { + printf("ʼתʱ\n"); + //ITKCALL(ITK_string_to_date(values[a].c_str(), &vadate)); + /*vector dataList; + Split(values[a].c_str(), "-", dataList);*/ + // tmڴ洢ת + std::tm date = {}; + + // ʹstd::istringstreamַ + std::istringstream iss(values[a].c_str()); + iss >> std::get_time(&date, "%Y-%m-%d %H:%M:%S"); + // Ƿɹ + if (iss.fail()) + { + std::cout << "תʧܣ" << std::endl; + return 1; + } + else { + // ʼdate_t + vadate.year = date.tm_year + 1900; + vadate.month = static_cast(date.tm_mon) + 1; + vadate.day = static_cast(date.tm_mday); + vadate.hour = static_cast(date.tm_hour); + vadate.minute = static_cast(date.tm_min); + vadate.second = static_cast(date.tm_sec); + } + } + printf("%s=%s\n", atts[0].c_str(), values[a].c_str()); + // ӡת + std::cout << "꣺" << vadate.year << std::endl; + std::cout << "£" << static_cast(vadate.month) << std::endl; + std::cout << "գ" << static_cast(vadate.day) << std::endl; + std::cout << "ʱ" << static_cast(vadate.hour) << std::endl; + std::cout << "֣" << static_cast(vadate.minute) << std::endl; + std::cout << "룺" << static_cast(vadate.second) << std::endl; + ITKCALL(AOM_set_value_date(rows[b], atts[0].c_str(), vadate)); + } + else if (strcmp(atts[1].c_str(), "string") == 0) { + printf("ȡַ\n"); + printf("%s=%s\n", atts[0].c_str(), values[a].c_str()); + ITKCALL(AOM_set_value_string(rows[b], atts[0].c_str(), values[a].c_str())); + ITKCALL(AOM_UIF_set_value(rows[b], atts[0].c_str(), values[a].c_str())); + } + AOM_save(rows[b]); + AOM_unlock(rows[b]); + AOM_refresh(rows[b], true); + } + } + else { + char* error = "̲"; + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + } + + break; + } + } + AOM_save(reltags[j]); + AOM_unlock(reltags[j]); + AOM_refresh(reltags[j], true); + } + } + + + } + } + } + //· + POM_AM__set_application_bypass(false); + printf("================================================ִLD_ECN01_SetCICNFormProperty================================================\n"); + return 0; +} + + + +int LD_515_SetCICNFormProperty(EPM_action_message_t msg) { + printf("ʼִ"); + //· + POM_AM__set_application_bypass(true); + int att_cnt = 0; + int doc_num = 0; + tag_t rootTask_tag = NULLTAG; + tag_t getfatag = NULLTAG; + tag_t task = NULLTAG; + tag_t* attachments = NULLTAG; + tag_t* doc_tags = NULLTAG; + string error; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + int arg_cnt = TC_number_of_arguments(msg.arguments); + char* property = NULL, * value = NULL, * type = NULL,* parentwfname = NULL; + task = msg.task; + string erro2 = ""; + string erro = ""; + int send1 = 0; + int send2 = 0; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "parentwfname") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + parentwfname = argvalue; + int doc_num1 = 0; tag_t* doc_tags1 = NULLTAG; + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num1, &doc_tags1)); + if (doc_num1>0) { + int fatagint; tag_t* fatasks; + ITKCALL(AOM_ask_value_tags(doc_tags1[0], "fnd0AllWorkflows", &fatagint,&fatasks)); + int falgnum = 0; + for (int j = 0; j < fatagint;j++) { + char* fataskName; + ITKCALL(AOM_ask_value_string(fatasks[j], "object_name", &fataskName)); + printf("fataskName:%s\n", fataskName); + if (strcmp(fataskName, parentwfname) == 0) { + getfatag = fatasks[j]; + break; + } + else { + falgnum++; + } + } + + if (falgnum == fatagint) { + return 0; + } + } + } + } + if (strcmp(argflag, "property") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + property = argvalue; + + } + } + if (strcmp(argflag, "value") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + value = argvalue; + } + } + } + //ȡĿϵµĶ + printf("ȡĿϵµĶ\n"); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + for (int i = 0; i < doc_num; i++) { + char* objtype = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &objtype)); + if (strcmp("LD6_CNRevision", objtype) == 0) { + int relnum; tag_t* reltags; + + ITKCALL(AOM_ask_value_tags(doc_tags[i], "LD6_WorkFRelation", &relnum, &reltags)); + for (int j = 0; j < relnum; j++) { + //ȡ + printf("ȡ\n"); + char* formtype; + tag_t form = NULL; + ITKCALL(AOM_ask_value_string(reltags[j], "object_type", &formtype)); + if (strcmp(formtype, "LD6_CIForm") == 0 || strcmp(formtype, "LD6_CNForm") == 0) { + printf("ʼ޸ֵ\n"); + //ʼ޸ֵ + AOM_lock(reltags[j]); + //ȡǰ̽ڵ + printf("ȡǰ̽ڵ\n"); + char * getValue; + string taskName = ""; + char* taguid; + ITK__convert_tag_to_uid(rootTask_tag, &taguid); + int fathnum; + printf("ȡǰ̵ĸڵ\n"); + char* testUid; + ITK__convert_tag_to_uid(rootTask_tag, &testUid); + printf("testUid:%s\n", testUid); + + ////ȡrootTask_tagùϵµж + //int *getrenums,referNum; + //tag_t* renum; + //char** retags; + //WSOM_where_referenced(rootTask_tag,1, &referNum,&getrenums, &renum, &retags); + //for (int g = 0; g < referNum;g++) { + // char* faname; + // ITKCALL(AOM_ask_value_string(renum[g], "object_name", &faname)); + // + + // + //} + + + + //ITKCALL(AOM_ask_value_tags(rootTask_tag, "parent_processes", &fathnum, &fathtag)); + //printf("fathnum:%d\n", fathnum); + /*int allstartnum = 0; tag_t* allstart; + printf("ȡڵ\n"); + ITKCALL(AOM_ask_value_tags(getfatag, "fnd0StartedTasks",&allstartnum, &allstart)); + for (int n = 0; n < allstartnum;n++) { + int statesnum; tag_t* statesName; + printf("ȡuid\n"); + ITKCALL(AOM_ask_value_tags(allstart[n], "interprocess_task_dependencies",&statesnum, &statesName)); + for (int m = 0; m < statesnum;m++) { + char* gettaguid; + ITK__convert_tag_to_uid(statesName[m], &gettaguid); + printf("жuid\n"); + printf("anssart:%s%s\n", gettaguid, taguid); + if (strcmp(gettaguid,taguid)==0) { + ITKCALL(AOM_ask_value_string(allstart[n], "object_name", &taskName)); + break; + } + } + }*/ + //ѯݿȡ̶ + //javaѯsqlserverݿ + printf("ʼִcmd"); + char cmd[1024] = ""; + strcpy(cmd, "java -jar D:\\Siemens\\Teamcenter13\\bin\\sapjco3.jar"); + strcat(cmd, " "); + strcat(cmd, " "); + strcat(cmd, "\"SELECT pw.pobject_name from PWORKSPACEOBJECT pw, (SELECT rprimary_objectu from PIMANRELATION where rsecondary_objectu = '?') p WHERE pw.puid = p.rprimary_objectu\""); + strcat(cmd, " "); + strcat(cmd, taguid); + strcat(cmd, " "); + strcat(cmd, "sql"); + printf("\n%s\n", cmd); + system(cmd); + //ȡصresultļSAP + string SAPfile = "D:\\TCSELECT\\sqlresult.txt"; + std::ifstream file(SAPfile); + if (!file.is_open()) { + std::cerr << "Failed to open file!" << std::endl; + char* error = "ݿѯ"; + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + else { + std::stringstream buffer1; + buffer1 << file.rdbuf(); + std::string resultStr = buffer1.str(); + printf("صֵ%s:\n", resultStr.c_str()); + //taskName = (char *)resultStr.c_str(); + taskName.append(resultStr); + printf("taskName%s\n", taskName.c_str()); + } + printf("ǰ̽ڵΪ%s\n", taskName.c_str()); + // + int num;// + tag_t* rows = NULL;// + ITKCALL(AOM_ask_table_rows(reltags[j], "ld6_ChangeTable", &num, &rows)); + printf("ȡ\n"); + for (int b = 0; b < num; b++) { + ITKCALL(AOM_ask_value_string(rows[b], "ld6_ChangeTaskName", &getValue)); + printf("ȡУ%s\n", getValue); + if (strstr(taskName.c_str(), getValue) != NULL) { + printf("ȡͬ\n"); + char* flag; + ITKCALL(AOM_ask_value_string(rows[b], "ld6_YNChange", &flag)); + printf("ȡld6_YNChangeΪ%s\n", flag); + if (strcmp(flag, "") == 0) { + printf("޸\n"); + vector pripers; + Split(property, ";", pripers); + vector values; + Split(value, ";", values); + if (pripers.size() == values.size()) { + for (int a = 0; a < pripers.size(); a++) { + AOM_lock(rows[b]); + vector atts; + Split(pripers[a], ".", atts); + if (strcmp(atts[1].c_str(), "date") == 0) { + printf("ȡʱ\n"); + date_t vadate; + if (strcmp(values[a].c_str(), "SysDate") == 0) { + // ȡǰʱ + auto timeNow = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); + // תΪʱ + tm localTime; + localtime_s(&localTime, &timeNow); + // ʼdate_t + vadate.year = localTime.tm_year + 1900; + vadate.month = static_cast(localTime.tm_mon) + 1; + vadate.day = static_cast(localTime.tm_mday); + vadate.hour = static_cast(localTime.tm_hour); + vadate.minute = static_cast(localTime.tm_min); + vadate.second = static_cast(localTime.tm_sec); + } + else { + printf("ʼתʱ\n"); + //ITKCALL(ITK_string_to_date(values[a].c_str(), &vadate)); + /*vector dataList; + Split(values[a].c_str(), "-", dataList);*/ + // tmڴ洢ת + std::tm date = {}; + + // ʹstd::istringstreamַ + std::istringstream iss(values[a].c_str()); + iss >> std::get_time(&date, "%Y-%m-%d %H:%M:%S"); + // Ƿɹ + if (iss.fail()) + { + std::cout << "תʧܣ" << std::endl; + return 1; + } + else { + // ʼdate_t + vadate.year = date.tm_year + 1900; + vadate.month = static_cast(date.tm_mon) + 1; + vadate.day = static_cast(date.tm_mday); + vadate.hour = static_cast(date.tm_hour); + vadate.minute = static_cast(date.tm_min); + vadate.second = static_cast(date.tm_sec); + } + } + printf("%s=%s\n", atts[0].c_str(), values[a].c_str()); + // ӡת + std::cout << "꣺" << vadate.year << std::endl; + std::cout << "£" << static_cast(vadate.month) << std::endl; + std::cout << "գ" << static_cast(vadate.day) << std::endl; + std::cout << "ʱ" << static_cast(vadate.hour) << std::endl; + std::cout << "֣" << static_cast(vadate.minute) << std::endl; + std::cout << "룺" << static_cast(vadate.second) << std::endl; + ITKCALL(AOM_set_value_date(rows[b], atts[0].c_str(), vadate)); + } + else if (strcmp(atts[1].c_str(), "string") == 0) { + printf("ȡַ\n"); + printf("%s=%s\n", atts[0].c_str(), values[a].c_str()); + ITKCALL(AOM_set_value_string(rows[b], atts[0].c_str(), values[a].c_str())); + ITKCALL(AOM_UIF_set_value(rows[b], atts[0].c_str(), values[a].c_str())); + } + AOM_save(rows[b]); + AOM_unlock(rows[b]); + AOM_refresh(rows[b], true); + } + } + else { + char* error = "̲"; + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + } + + break; + } + } + AOM_save(reltags[j]); + AOM_unlock(reltags[j]); + AOM_refresh(reltags[j], true); + } + } + + + } + } + //· + POM_AM__set_application_bypass(false); + } + + return 0; +} \ No newline at end of file diff --git a/connor_signature/LD_FormAttrToExcel.cpp b/connor_signature/LD_FormAttrToExcel.cpp new file mode 100644 index 0000000..ff4ec4c --- /dev/null +++ b/connor_signature/LD_FormAttrToExcel.cpp @@ -0,0 +1,365 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + + +#define debug true +#define ITK_err 919012 + + + + +string get_value(const map& value_map, const string& key) { + auto iter = value_map.find(key); + if (iter != value_map.end()) { + return iter->second; + } + else { + return ""; + } +} + + + + + + +bool isSubstring(char* str1, char* str2) { + int len1 = strlen(str1); + int len2 = strlen(str2); + int i = 0, j = 0; + while (i < len1 && j < len2) { + if (str1[i] == ',') { + i++; + continue; + } + if (str1[i] == str2[j]) { + i++; + j++; + } + else { + i = i - j + 1; + j = 0; + } + } + if (j == len2) { + return true; + } + else { + return false; + } +} + +int flag = 0; + +void insertDataToExcel2(char temp_file[SS_MAXPATHLEN], map dataList) { + printf("----------------ʼִвݲ---------------------\n"); + //д뱾أʹJava + + string json = "{"; + for (auto it = dataList.begin(); it != dataList.end(); ++it) { + json += "\"" + it->first + "\":\"" + it->second + "\","; + } + json.pop_back(); // ɾһ + json += "}"; + printf("json:%s", json.c_str()); + // JSONʽַдļ + ofstream ofs("D:\\ldexcel\\output.txt"); + ofs << json; + ofs.close(); + printf("ʼִcmd"); + char cmd[1024] = ""; + strcpy(cmd, "java -jar D:\\Siemens\\Teamcenter13\\bin\\writeAsExcel.jar"); + strcat(cmd, " "); + strcat(cmd, temp_file); + strcat(cmd, " "); + strcat(cmd, "D:\\ldexcel\\output.txt"); + printf("\n%s\n", cmd); + system(cmd); + printf("cmdִ"); + for (auto it = dataList.begin(); it != dataList.end(); ++it) { + cout << it->first << ": " << it->second << endl; + } + + + /*libxl::Book* book = xlCreateXMLBook(); + printf("òƷܳ\n"); + book->setKey(L"Halil Kural", L"windows-2723210a07c4e90162b26966a8jcdboe");//Կ + if (book) { + printf("ʼ\n"); + printf("path%s\n", temp_file); + int len = strlen(temp_file); + int size = MultiByteToWideChar(CP_ACP, 0, temp_file, len, NULL, 0); // ȡռС + wstring wstr(size, 0); + MultiByteToWideChar(CP_ACP, 0, temp_file, len, &wstr[0], size); // תΪwchar_t + wprintf(L"path2%s", wstr.c_str()); // ʹwprintf + if (book->load(wstr.c_str())) { + printf("Excelļɹ\n"); + printf("ȡsheetҳ\n"); + libxl::Sheet* sheet = book->getSheet(0); + if (sheet) { + map dataList; // һmap + dataList["A1"] = "Hello"; + dataList["B2"] = "world!"; + for (auto& data : dataList) { // mapе + string cellName = data.first; // ȡԪ + string cellValue = data.second; // ȡԪֵ + int row = sheet->nameToRow(cellName.c_str()); // ȡк + int col = sheet->nameToColumn(cellName.c_str()); // ȡк + sheet->writeStr(row, col, cellValue.c_str(), 0); // ڵԪд + } + } + } + else { + printf("Excelļʧܣ룺%d\n", book->errorMessage()); + } + book->release(); + }*/ +} + +int LD_FormAttrToExcel(EPM_action_message_t msg) { + printf("ʼִ"); + int att_cnt = 0; + int doc_num = 0; + tag_t rootTask_tag = NULLTAG; + tag_t task = NULLTAG; + tag_t *attachments = NULLTAG; + tag_t *doc_tags = NULLTAG; + string error; + char *arg = NULL, *argflag = NULL, *argvalue = NULL; + int arg_cnt = TC_number_of_arguments(msg.arguments); + char *include_type = NULL, *relation = NULL, *formtype = NULL, *option = NULL; + task = msg.task; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "include_type") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + include_type = argvalue; + + } + } + if (strcmp(argflag, "relation") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + relation = argvalue; + } + } + if (strcmp(argflag, "formtype") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + formtype = argvalue; + } + } + if (strcmp(argflag, "Option") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + option = argvalue; + } + } + } + //ȡĿϵµĶ + printf("ȡĿϵµĶ"); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + for (int i = 0; i < doc_num; i++) { + char *type = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &type)); + if (strcmp(type, include_type) == 0) { + //ָϵ + printf("ָϵ"); + int gx_num; tag_t *gx_obj; map rowsvalue; + ITKCALL(AOM_ask_value_tags(doc_tags[i], relation, &gx_num, &gx_obj)); + for (int j = 0; j < gx_num; j++) { + char *form = NULL; + ITKCALL(AOM_ask_value_string(gx_obj[i], "object_type", &form)); + printf("жǷ"); + //жǷ + printf("formtype&s\n", formtype); + printf("form&s\n", form); + if (isSubstring(formtype, form)) { + printf("ȡ"); + //ȡ + int rownum; tag_t *tableRownum = NULL; + ITKCALL(AOM_ask_table_rows(gx_obj[i], "ld6_ChangeTable", &rownum, &tableRownum)); + printf("ȡѡֵ"); + int op_nums; char ** op_values = NULL; + + PREF_ask_char_values(option, &op_nums, &op_values); + printf("ȡ"); + printf("Ϊ%d\n", rownum); + printf("ѡΪ%d\n", op_nums); + for (int z = 0; z < rownum; z++) { + printf("1"); + string new_str; + printf("2"); + for (int a = 0; a < op_nums; a++) { + printf("3"); + char *getVal = op_values[a]; + printf("4"); + int serial_num; tag_t *tableRow = NULL; + printf("5"); + if (a == 0) { + printf("6"); + printf("еԣȡ"); + vector ans; + Split(getVal, ".", ans); + if (ans.size() > 0) { + tag_t rowTag = tableRownum[z]; + char *xuhao; + ITKCALL(AOM_ask_value_string(rowTag, ans[2].c_str(), &xuhao)); + string pattern = "0(\\d)"; + string replacement = "$1"; + new_str = regex_replace(xuhao, regex(pattern), replacement); + } + } + else { + printf("иʽ"); + vector ans; + Split(getVal, ".", ans); + if (ans.size() > 1) { + printf("԰=ָ"); + vector getnas; + Split(ans[2].c_str(), "=", getnas); + tag_t rowTag = tableRownum[z]; + char *value; + if (strstr(getnas[0].c_str(), "Time")) { + date_t getdate; + ITKCALL(AOM_ask_value_date(rowTag, getnas[0].c_str(), &getdate)); + + char fileDate[128] = ""; + sprintf_s(fileDate, "%04d-%02d-%02d 00:00", getdate.year, getdate.month + 1, getdate.day); + value = fileDate; + } + else { + ITKCALL(AOM_ask_value_string(rowTag, getnas[0].c_str(), &value)); + } + + if (value == NULL) { + value = ""; + } + if (strcmp(value, "0000-01-00 00:00") == 0) { + value = ""; + } + string key = getnas[1] + new_str; + std::string valueStr = value; + std::size_t pos = valueStr.find('\n'); + while (pos != std::string::npos) { + valueStr.erase(pos, 1); + pos = valueStr.find('\n', pos); + } + rowsvalue[key.c_str()] = valueStr; + } + else { + //ѭһʱ򣬻ȡϵ + if (z == rownum - 1) { + printf("ȡ"); + vector getnas; + Split(getVal, "=", getnas); + char *value; + ITKCALL(AOM_ask_value_string(gx_obj[i], getnas[0].c_str(), &value)); + if (value == NULL) { + value = ""; + } + std::string valueStr = value; + std::size_t pos = valueStr.find('\n'); + while (pos != std::string::npos) { + valueStr.erase(pos, 1); + pos = valueStr.find('\n', pos); + } + rowsvalue[getnas[1].c_str()] = valueStr; + } + + } + } + } + } + printf("ݻȡϡʼexcel"); + //ݻȡϡʼexcel + printf("ȡ淶ϵµexcelݼ"); + int gf_num; tag_t *gf_obj; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "IMAN_specification", &gf_num, &gf_obj)); + printf("ȡ%dݼ", gf_num); + for (int s = 0; s < gf_num; s++) { + tag_t gettag = gf_obj[s]; char * objtype; char * objname; + ITKCALL(AOM_ask_value_string(gettag, "object_type", &objtype)); + ITKCALL(AOM_ask_value_string(gettag, "object_name", &objname)); + printf("ȡ%s͵ݼ", objtype); + if (strcmp(objtype, "MSExcelX") == 0) { + printf("ȡexcelݼ"); + tag_t ref_object = NULLTAG; + printf("1"); + AE_reference_type_t reference_type; + printf("2"); + char ref_name[WSO_name_size_c + 1] = "excel"; + ITKCALL(AE_ask_dataset_named_ref2(gettag, ref_name, &reference_type, &ref_object)); + printf("3"); + //printf("reference_type%s", reference_type); + if (reference_type == AE_PART_OF) + { + char *pathname = ""; + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + printf("4"); + char *origin_file_name = ""; + ITKCALL(IMF_ask_original_file_name2(ref_object, &origin_file_name)); + printf("5"); + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, "xlsx", 0); + printf("6"); + char *temp_dir = getenv("temp"); + printf("7"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, "D:\\ldexcel"); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + printf("temp_file%s", temp_file); + ITKCALL(IMF_export_file(ref_object, temp_file)); + printf("8"); + printf("ʼ"); + + //string str(temp_file); + insertDataToExcel2(temp_file, rowsvalue); + //ݼ + printf("ݲɣʼݼ"); + ITKCALL(import_dataset_file_binary(gettag, temp_dir, "excel", "xlsx", temp_file, objname)); + printf("ִн"); + } + } + } + } + } + + } + } + } + return 0; +} \ No newline at end of file diff --git a/connor_signature/LD_GYLXFrozen.cpp b/connor_signature/LD_GYLXFrozen.cpp new file mode 100644 index 0000000..8153a76 --- /dev/null +++ b/connor_signature/LD_GYLXFrozen.cpp @@ -0,0 +1,194 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + +#define debug true +#define ITK_err 919012 + +int LD_GYLXFrozen(EPM_action_message_t msg) { + printf("ʼִLD_GYLXFrozen򡷡"); + tag_t rootTask_tag = NULLTAG; + tag_t task = NULLTAG; + + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + int arg_cnt = TC_number_of_arguments(msg.arguments); + //̲ + char* ZBS = NULL; + char* type = NULL; + //Ŀ + int doc_num = 0; + tag_t* doc_tags = NULLTAG; + + task = msg.task; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "ZBS") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + ZBS = argvalue; + } + } + if (strcmp(argflag, "type") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + type = argvalue; + } + } + } + //ȡĿ汾 + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + auto file = std::make_unique("D:\\TCTOSAP\\jsonStr.txt"); + //std::ofstream file("D:\\MESTOTC\\example.txt", std::ios_base::trunc); // ļ + file->is_open(); + for (int i = 0; i < doc_num;i++) { + string jsonStr = ""; + string douhao = ","; + string ate = "@"; + string fenhao = ";"; + char* mbtype; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &mbtype)); + printf("Ϊ%s\n",mbtype); + if (strstr(type,mbtype)!= nullptr) { + printf("ƥ䵽\n"); + char* id; + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &id)); + jsonStr = jsonStr + ZBS + douhao + id + douhao + mbtype + douhao; + printf("JSONStr = %s\n",jsonStr.c_str()); + printf("ʼȡ\n"); + printf("ȡϵ\n"); + //ϵ + int gx_num = 0; + tag_t* gx_tags = NULLTAG; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "LD6_GYLXCompanyFormRelation", &gx_num,&gx_tags)); + printf("ȡ\n"); + for (int j = 0; j < gx_num;j++) { + char* gxtype; + ITKCALL(AOM_ask_value_string(gx_tags[j], "object_type", &gxtype)); + printf("Ϊ%s\n", gxtype); + if (strcmp(gxtype,"LD6_GYLXCompanyForm") == 0) { + printf("ƥ䵽˱\n"); + printf("ȡ\n"); + // + int num;// + tag_t* rows = NULL;// + ITKCALL(AOM_ask_table_rows(gx_tags[j], "ld6_GYLXCompanyTable", &num, &rows)); + printf("ȡ\n"); + for (int a = 0; a < num; a++) { + char* WERKS, * MATNR, * PLNNR, * PLNAL; + ITKCALL(AOM_ask_value_string(rows[a], "ld6_company", &WERKS)); + ITKCALL(AOM_ask_value_string(rows[a], "ld6_partid", &MATNR)); + ITKCALL(AOM_ask_value_string(rows[a], "ld6_groupNum", &PLNNR)); + ITKCALL(AOM_ask_value_string(rows[a], "ld6_groupCounter", &PLNAL)); + if (a == num-1) { + jsonStr = jsonStr + WERKS + ate + MATNR + ate + PLNNR + ate + PLNAL; + } + else { + jsonStr = jsonStr + WERKS + ate + MATNR + ate + PLNNR + ate + PLNAL + fenhao; + } + } + printf("jsonStr = %s\n", jsonStr.c_str()); + //дļ + *file << jsonStr.c_str() << std::endl; + //˳ǰѭ + break; + } + } + } + } + //ִjarSAP + //ȡǰuid + char* flowId; + ITK__convert_tag_to_uid(rootTask_tag, &flowId); + //cmdִjarݴݵMESSAP + char cmd[8192] = ""; + strcpy(cmd, "java -jar D:\\Siemens\\Teamcenter13\\bin\\sapjco3.jar"); + strcat(cmd, " "); + strcat(cmd, "SendSAP"); + strcat(cmd, " "); + strcat(cmd, flowId); + system(cmd); + //ȡصresultļSAP + string fileid = flowId; + string SAPfile = "D:\\TCTOSAP\\" + fileid + "result.txt"; + std::ifstream file1(SAPfile); + if (!file1.is_open()) { + std::cerr << "Failed to open file!" << std::endl; + char* error = "δӦ"; + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + else { + std::stringstream buffer1; + buffer1 << file1.rdbuf(); + std::string resultStr = buffer1.str(); + printf("صֵ%s:\n", resultStr.c_str()); + if (strcmp(resultStr.c_str(), "ɹ") == 0) { + for (int i = 0; i < doc_num; i++) { + char* mbtype; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &mbtype)); + if (strcmp(mbtype, argflag) == 0) { + //޸ֵ + AOM_lock(doc_tags[i]); + ITKCALL(AOM_set_value_string(doc_tags[i], "ld6_gylxiffrozentosap", "ɹ")); + AOM_save(doc_tags[i]); + AOM_unlock(doc_tags[i]); + AOM_refresh(doc_tags[i], true); + } + } + return 0; + } + else { + for (int i = 0; i < doc_num; i++) { + char* mbtype; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &mbtype)); + if (strcmp(mbtype, argflag) == 0) { + //޸ֵ + AOM_lock(doc_tags[i]); + ITKCALL(AOM_set_value_string(doc_tags[i], "ld6_gylxiffrozentosap", "ʧ")); + AOM_save(doc_tags[i]); + AOM_unlock(doc_tags[i]); + AOM_refresh(doc_tags[i], true); + } + } + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", resultStr.c_str()); + + return 1; + } + } + return 1; + } +} \ No newline at end of file diff --git a/connor_signature/LD_PartChange.cpp b/connor_signature/LD_PartChange.cpp new file mode 100644 index 0000000..dabeaa3 --- /dev/null +++ b/connor_signature/LD_PartChange.cpp @@ -0,0 +1,279 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + + +#define debug true +#define ITK_err 919012 + + + + +std::string generateJsonString2(char* MATNR, char* FLAG,char * MATEREV,char * ZXPLC) { + // ƴJSONַ + std::string jsonString = "[\n"; + jsonString += " {\n"; + jsonString += " \"MATNR\":\""; + jsonString += MATNR; + jsonString += "\",\n"; + jsonString += " \"MATEREV\":\""; + jsonString += MATEREV; + jsonString += "\",\n"; + jsonString += " \"ZXPLC\":\""; + jsonString += ZXPLC; + jsonString += "\",\n"; + jsonString += " \"FLAG\":\""; + jsonString += FLAG; + jsonString += "\"\n"; + jsonString += " }\n"; + jsonString += "]"; + // JSONַ + return jsonString; +} +// תjsonַ +void escapeJson1(std::string& str) { + int len = str.length(); + int newLen = len; + for (int i = 0; i < len; i++) { + if (str[i] == '"' || str[i] == '\\') { + newLen++; + } + } + std::string escapedStr; + escapedStr.reserve(newLen); + for (int i = 0; i < len; i++) { + if (str[i] == '"' || str[i] == '\\') { + escapedStr.push_back('\\'); + } + escapedStr.push_back(str[i]); + } + str = escapedStr; +} + + +/** + * + * @handlerName: LD_PartChange + * @Description: ״̬ⶳ\ͬӿڣ1. û̴ͨ״̬ⶳ\״̬ݸMESSAP + * @change ӽӿֶδ MATEREVֶҪȡ-typeָ汾ϵitem_revision_idֵ + ZXPLCֶλȡ-typeָ汾ϵld6_ifNewProduct,δҵԣ򴫵ݡ" + * @changeDate 2024/1/23 + * @author hcj + */ +int LD_PartChange(EPM_action_message_t msg) { + printf("ʼִ"); + int att_cnt = 0; + int doc_num = 0; + tag_t rootTask_tag = NULLTAG; + tag_t task = NULLTAG; + tag_t* attachments = NULLTAG; + tag_t* doc_tags = NULLTAG; + string error; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + int arg_cnt = TC_number_of_arguments(msg.arguments); + char * FLAG = NULL, * type = NULL; + task = msg.task; + string erro2 = ""; + string erro = ""; + int send1 = 0; + int send2 = 0; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "FLAG") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + FLAG = argvalue; + } + } + if (strcmp(argflag, "type") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + type = argvalue; + } + } + } + //ȡĿϵµĶ + printf("ȡĿϵµĶ"); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + for (int i = 0; i < doc_num; i++) { + char* objtype = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &objtype)); + if (strstr(type, objtype) != nullptr) { + //ȡϱ + char* MATNR = NULL; + char* MATEREV = NULL; + char* ZXPLC = ""; + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &MATNR)); + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_revision_id", &MATEREV)); + try { + AOM_ask_value_string(doc_tags[i], "ld6_ifNewProduct", &ZXPLC); + } + catch (const std::exception& e) { + printf("ûлȡֵld6_ifNewProduct\n"); + } + //ȡѡֵ + char* url = NULL; + PREF_ask_char_value("LD_PLM2MES_PartChange_Config", 0, &url); + //ȡҪ͵jsonַ + std::string jsonString = generateJsonString2(MATNR, FLAG, MATEREV, ZXPLC); + printf("jsonString:%s\n", jsonString.c_str()); + std::regex regex("\\s+"); + std::string result = std::regex_replace(jsonString, regex, ""); + // ת崦jsonַ + escapeJson1(result); + //jarӿڷ + printf("ʼִcmd"); + char cmd[1024] = ""; + strcpy(cmd, "java -jar D:\\Siemens\\Teamcenter13\\bin\\sapjco3.jar"); + strcat(cmd, " "); + strcat(cmd, " "); + strcat(cmd, url); + strcat(cmd, " "); + strcat(cmd, result.c_str()); + strcat(cmd, " "); + strcat(cmd, "2"); + printf("\n%s\n", cmd); + system(cmd); + //ȡļȡִн + + //ȡصresultļSAP + string id = MATNR; + string SAPfile = "D:\\TCTOSAP\\" + id + "result.txt"; + std::ifstream file(SAPfile); + if (!file.is_open()) { + std::cerr << "Failed to open file!" << std::endl; + char* error = "SAPδӦ"; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base,error); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + else { + std::stringstream buffer1; + buffer1 << file.rdbuf(); + std::string resultStr = buffer1.str(); + printf("صֵ%s:\n", resultStr.c_str()); + AOM_lock(doc_tags[i]); + if (strcmp(resultStr.c_str(), "ͬɹ") == 0) { + + ITKCALL(AOM_set_value_string(doc_tags[i], "ld6_partiffrozentosap", "ɹ")); + } + else { + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", resultStr.c_str()); + ITKCALL(AOM_set_value_string(doc_tags[i], "ld6_partiffrozentosap", "ʧ")); + erro = erro + resultStr; + } + AOM_save(doc_tags[i]); + AOM_unlock(doc_tags[i]); + AOM_refresh(doc_tags[i], true); + } + //resultļϢ + std::ofstream file8(SAPfile, std::ios::trunc); // ļΪдģʽʹ trunc ģʽļ + if (!file8) { + //ɾresultļC:\TCTOLIMS + remove(SAPfile.c_str()); + } + else { + //ɾresultļC:\TCTOLIMS + remove(SAPfile.c_str()); + file8.close(); // رļ + } + + //ȡصresultļMAS + string MASpath = "D:\\TCTOMAS\\" + id + "result.txt"; + std::ifstream file1(MASpath); + if (!file1.is_open()) { + std::cerr << "Failed to open file!" << std::endl; + char* error = "MESδӦ"; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, error); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + else { + std::stringstream buffer1; + buffer1 << file1.rdbuf(); + std::string resultStr = buffer1.str(); + printf("صֵ%s:\n", resultStr.c_str()); + if (strcmp(resultStr.c_str(), "ɹ") == 0) { + ITKCALL(AOM_set_value_string(doc_tags[i], "ld6_partiffrozentomes", "ɹ")); + } + else{ + erro2 = erro2 + resultStr; + ITKCALL(AOM_set_value_string(doc_tags[i], "ld6_partiffrozentomes", "ʧ")); + send2++; + } + AOM_save(doc_tags[i]); + AOM_unlock(doc_tags[i]); + AOM_refresh(doc_tags[i], true); + //ɾļ + //resultļϢ + std::ofstream file2(MASpath, std::ios::trunc); // ļΪдģʽʹ trunc ģʽļ + if (!file2) { + //ɾresultļC:\TCTOLIMS + remove(MASpath.c_str()); + } + else { + //ɾresultļC:\TCTOLIMS + remove(MASpath.c_str()); + file2.close(); // رļ + } + } + } + } + //ȥһ + if (!strcmp(erro.c_str(), "") == 0) { + size_t lastCommaPos = erro.find_last_of(','); + if (lastCommaPos != std::string::npos) { + erro = erro.substr(0, lastCommaPos); + + } + } + if (send1 > 0 && send2 > 0) { + string senderror = "ϢSAP" + erro + "MES" + erro2; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, senderror.c_str()); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", senderror.c_str()); + return 1; + } + else if (send1 > 0 && send2 == 0) { + string senderror = "ϢSAP" + erro; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, senderror.c_str()); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", senderror.c_str()); + return 1; + } + else if (send1 == 0 && send2 > 0) { + string senderror = "ϢMES" + erro2; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, senderror.c_str()); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", senderror.c_str()); + return 1; + } + } + return 0; +} \ No newline at end of file diff --git a/connor_signature/LD_PartCompFLAG.cpp b/connor_signature/LD_PartCompFLAG.cpp new file mode 100644 index 0000000..90d61a3 --- /dev/null +++ b/connor_signature/LD_PartCompFLAG.cpp @@ -0,0 +1,356 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + + +#define debug true +#define ITK_err 919012 + + +std::string generateJsonString(const char* MATNR, const char* FLAG, const char* WERKS, const char* MATEREV, const char* ZXPLC) { + std::string jsonStr = "[\n"; + jsonStr += " {\n"; + jsonStr += " \"MATNR\":\"" + std::string(MATNR) + "\",\n"; + jsonStr += " \"MATEREV\":\"" + std::string(MATEREV) + "\",\n"; + jsonStr += " \"ZXPLC\":\"" + std::string(ZXPLC) + "\",\n"; + jsonStr += " \"FLAG\":\"" + std::string(FLAG) + "\",\n"; + jsonStr += " \"I_MARC\":\n"; + jsonStr += " [\n"; + std::vector werksVec; + std::string werksStr(WERKS); + size_t pos = werksStr.find(";"); + if (pos != std::string::npos) { + // WERKS contains comma, split it + size_t startPos = 0; + while (pos != std::string::npos) { + std::string werksValue = werksStr.substr(startPos, pos - startPos); + startPos = pos + 1; + pos = werksStr.find(";", startPos); + werksVec.push_back(werksValue); + } + werksVec.push_back(werksStr.substr(startPos)); + } + else { + // WERKS does not contain comma + werksVec.push_back(werksStr); + } + for (size_t i = 0; i < werksVec.size(); ++i) { + jsonStr += " {\n"; + jsonStr += " \"WERKS\":\"" + werksVec[i] + "\"\n"; + jsonStr += (i == werksVec.size() - 1) ? " }\n" : " },\n"; + } + jsonStr += " ]\n"; + jsonStr += " }\n"; + jsonStr += "]\n"; + return jsonStr; +} + +// תjsonַ +void escapeJson(std::string& str) { + int len = str.length(); + int newLen = len; + for (int i = 0; i < len; i++) { + if (str[i] == '"' || str[i] == '\\') { + newLen++; + } + } + std::string escapedStr; + escapedStr.reserve(newLen); + for (int i = 0; i < len; i++) { + if (str[i] == '"' || str[i] == '\\') { + escapedStr.push_back('\\'); + } + escapedStr.push_back(str[i]); + } + str = escapedStr; +} + + + +/** + * + * @handlerName: LD_PartCompFLAG + * @Description: ״̬ͬӿڣݲãͨӿڴݵSAPMESû̴ͨѡijЩͣ + * @change ӽӿֶδ MATEREVֶҪȡ-typeָ汾ϵitem_revision_idֵ + ZXPLCֶλȡ-typeָ汾ϵld6_ifNewProduct,δҵԣ򴫵ݡ" + * @changeDate 2024/1/23 + * @author hcj + */ + +int LD_PartCompFLAG(EPM_action_message_t msg) { + printf("ʼִ"); + int att_cnt = 0; + int doc_num = 0; + tag_t rootTask_tag = NULLTAG; + tag_t task = NULLTAG; + tag_t* attachments = NULLTAG; + tag_t* doc_tags = NULLTAG; + string error; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + int arg_cnt = TC_number_of_arguments(msg.arguments); + char* WERKS = NULL, * FLAG = NULL, * type = NULL; + task = msg.task; + string erro2 = ""; + string erro = ""; + int send1 = 0; + int send2 = 0; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "WERKS") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + WERKS = argvalue; + + } + } + if (strcmp(argflag, "FLAG") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + FLAG = argvalue; + } + } + if (strcmp(argflag, "type") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + type = argvalue; + } + } + } + //ȡĿϵµĶ + printf("ȡĿϵµĶ"); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + for (int i = 0; i < doc_num; i++) { + char* objtype = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &objtype)); + if (strstr(type, objtype) != nullptr) { + //ȡϱ + char* MATNR = NULL; + char* MATEREV = NULL; + char* ZXPLC = ""; + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &MATNR)); + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_revision_id", &MATEREV)); + try { + AOM_ask_value_string(doc_tags[i], "ld6_ifNewProduct", &ZXPLC); + } + catch (const std::exception& e) { + printf("ûлȡֵld6_ifNewProduct\n"); + } + + //ȡѡֵ + char* url = NULL; + PREF_ask_char_value("LD_PLM2MES_PartCompFLAG_Config",0,&url); + printf("url:%s\n", url); + //ȡҪ͵jsonַ + std::string jsonString = generateJsonString(MATNR, FLAG, WERKS,MATEREV,ZXPLC); + printf("jsonString:%s\n", jsonString.c_str()); + std::regex regex("\\s+"); + std::string result = std::regex_replace(jsonString, regex, ""); + // ת崦jsonַ + escapeJson(result); + //jarӿڷ + printf("ʼִcmd"); + char cmd[1024] = ""; + strcpy(cmd, "java -jar D:\\Siemens\\Teamcenter13\\bin\\sapjco3.jar"); + strcat(cmd, " "); + strcat(cmd, url); + strcat(cmd, " "); + strcat(cmd, result.c_str()); + strcat(cmd, " "); + strcat(cmd, "1"); + printf("\n%s\n", cmd); + system(cmd); + //ȡļȡִн + //ȡصresultļSAP + string id = MATNR; + string SAPfile = "D:\\TCTOSAP\\"+ id +"result.txt"; + std::ifstream file(SAPfile); + if (!file.is_open()) { + std::cerr << "Failed to open file!" << std::endl; + char* error = "SAPδӦ"; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, error); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + else { + std::map> resultMap; + std::string line; + while (std::getline(file, line)) { + std::istringstream iss(line); + std::string key; + std::string value; + if (std::getline(iss, key, ':') && std::getline(iss, value)) { + // ȥβĿո + key = key.substr(key.find_first_not_of(' ')); + key = key.substr(0, key.find_last_not_of(' ') + 1); + value = value.substr(value.find_first_not_of(' ')); + value = value.substr(0, value.find_last_not_of(' ') + 1); + // valueַתΪvector + std::vector valueVec; + std::istringstream issValue(value); + std::string singleValue; + while (std::getline(issValue, singleValue, ',')) { + valueVec.push_back(singleValue); + } + resultMap[key] = valueVec; + } + } + file.close(); + //ȡ + int tagnum; tag_t* tags = NULL; + tag_t form = NULL; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "LD6_CompanyFormRelation", &tagnum, &tags)); + if (tagnum>0) { + for (int h = 0; h < tagnum;h++) { + char* type; + ITKCALL(AOM_ask_value_string(tags[h], "object_type", &type)); + if (strcmp(type,"LD6_CompanyForm") == 0) { + form = tags[h]; + break; + } + } + } + else { + printf("LD6_CompanyTableϵ"); + } + //ʼ + for (const auto& entry : resultMap) { + std::cout << "Key: " << entry.first << std::endl; + int num; + tag_t* rows; + ITKCALL(AOM_ask_table_rows(form, "ld6_CompanyTable", &num, &rows)); + int flnum = 0; + for (int a = 0; a < num; a++) { + char* getValue; + ITKCALL(AOM_ask_value_string(rows[a], "ld6_company", &getValue)); + if (strcmp(entry.first.c_str(), getValue) == 0) { + std::vector valueMap = resultMap[entry.first]; + AOM_lock(rows[a]); + printf("FLAG:%s\n", FLAG); + printf("valueMap[0]:%s\n", valueMap[0].c_str()); + ITKCALL(AOM_set_value_string(rows[a], "ld6_partcompifdel", FLAG)); + ITKCALL(AOM_set_value_string(rows[a], "ld6_partstatussyncsap", valueMap[0].c_str())); + AOM_save(rows[a]); + AOM_unlock(rows[a]); + if (strcmp(valueMap[0].c_str(), "E") == 0) { + erro = erro + entry.first + valueMap[1] +","; + send1++; + } + } + } + } + + } + //resultļϢ + std::ofstream file8(SAPfile, std::ios::trunc); // ļΪдģʽʹ trunc ģʽļ + if (!file8) { + //ɾresultļC:\TCTOLIMS + remove(SAPfile.c_str()); + } + else { + //ɾresultļC:\TCTOLIMS + remove(SAPfile.c_str()); + file8.close(); // رļ + } + + //ȡصresultļMAS + string MASpath = "D:\\TCTOMAS\\" + id + "result.txt"; + std::ifstream file1(MASpath); + if (!file1.is_open()) { + std::cerr << "Failed to open file!" << std::endl; + char* error = "MESδӦ"; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, error); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + else { + std::stringstream buffer1; + buffer1 << file1.rdbuf(); + std::string resultStr = buffer1.str(); + printf("صֵ%s:\n", resultStr.c_str()); + AOM_lock(doc_tags[i]); + if (strcmp(resultStr.c_str(),"ɹ") == 0) { + ITKCALL(AOM_set_value_string(doc_tags[i], "ld6_partstatusSyncMES", "ɹ")); + } + else{ + erro2 = erro2 + resultStr; + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", resultStr.c_str()); + ITKCALL(AOM_set_value_string(doc_tags[i], "ld6_partstatusSyncMES", "ʧ")); + send2++; + } + AOM_save(doc_tags[i]); + AOM_unlock(doc_tags[i]); + AOM_refresh(doc_tags[i], true); + } + //ɾļ + //resultļϢ + std::ofstream file2(MASpath, std::ios::trunc); // ļΪдģʽʹ trunc ģʽļ + if (!file2) { + //ɾresultļC:\TCTOLIMS + remove(MASpath.c_str()); + } + else { + //ɾresultļC:\TCTOLIMS + remove(MASpath.c_str()); + file2.close(); // رļ + } + } + } + //ȥһ + if (!strcmp(erro.c_str(), "") == 0) { + size_t lastCommaPos = erro.find_last_of(','); + if (lastCommaPos != std::string::npos) { + erro = erro.substr(0, lastCommaPos); + + } + } + if (send1>0 && send2>0) { + string senderror = "ϢSAP" + erro + "MES" + erro2; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, senderror.c_str()); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", ); + return 1; + }else if(send1 > 0 && send2 == 0) { + string senderror = "ϢSAP" + erro; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, senderror.c_str()); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", senderror.c_str()); + return 1; + } + else if (send1 == 0 && send2 > 0) { + string senderror = "ϢMES" + erro2; + EMH_store_error_s1(EMH_severity_error, EMH_AE_error_base, senderror.c_str()); + //EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", senderror.c_str()); + return 1; + } + } + return 0; +} \ No newline at end of file diff --git a/connor_signature/LD_SendDJJDD_To_MES.cpp b/connor_signature/LD_SendDJJDD_To_MES.cpp new file mode 100644 index 0000000..f00b063 --- /dev/null +++ b/connor_signature/LD_SendDJJDD_To_MES.cpp @@ -0,0 +1,297 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + +#define debug true +#define ITK_err 919012 + + +std::string generateJsonString2(char *folwId, vector id, vector version, vector fileName) { + std::string jsonStr = "{\n"; + jsonStr += " \"flowId\":\"" + std::string(folwId) + "\",\n"; + jsonStr += " \"file\":\n"; + jsonStr += " [\n"; + for (int i = 0; i < id.size();i++) { + jsonStr += " {\n"; + if (i == id.size()-1) { + jsonStr += " \"id\":\"" + std::string(id[i]) + "\",\n"; + jsonStr += " \"version\":\"" + std::string(version[i]) + "\",\n"; + jsonStr += " \"url\":\"" + std::string(fileName[i]) + "\"\n"; + jsonStr += " }\n"; + break; + } + jsonStr += " \"id\":\"" + std::string(id[i]) + "\",\n"; + jsonStr += " \"version\":\"" + std::string(version[i]) + "\",\n"; + jsonStr += " \"type\":\"" + std::string(fileName[i]) + "\"\n"; + jsonStr += " },\n"; + } + + jsonStr += " ]\n"; + jsonStr += " }\n"; + return jsonStr; +} + +// תjsonַ +void escapeJson2(std::string& str) { + int len = str.length(); + int newLen = len; + for (int i = 0; i < len; i++) { + if (str[i] == '"' || str[i] == '\\') { + newLen++; + } + } + std::string escapedStr; + escapedStr.reserve(newLen); + for (int i = 0; i < len; i++) { + if (str[i] == '"' || str[i] == '\\') { + escapedStr.push_back('\\'); + } + escapedStr.push_back(str[i]); + } + str = escapedStr; +} + +bool copyFileToFolder(const std::string& filePath, const std::string& folderPath) { + // Դļ + std::ifstream sourceFile(filePath, std::ios::binary); + if (!sourceFile) { + std::cout << "ļڻ޷" << std::endl; + return false; + } + + // ȡļ + size_t lastSlashIndex = filePath.find_last_of("/\\"); + std::string fileName = filePath.substr(lastSlashIndex + 1); + + // Ŀ· + std::string destinationPath = folderPath + "/" + fileName; + + // Ŀļ + std::ofstream destinationFile(destinationPath, std::ios::binary); + if (!destinationFile) { + std::cout << "޷Ŀļ" << std::endl; + return false; + } + + // ļ + destinationFile << sourceFile.rdbuf(); + + // رļ + sourceFile.close(); + destinationFile.close(); + + std::cout << "ļѳɹƵĿļ" << std::endl; + return true; +} + + +int LD_SendDJJDD_To_MES(EPM_action_message_t msg) { + printf("ʼִ"); + int att_cnt = 0; + int doc_num = 0; + tag_t rootTask_tag = NULLTAG; + tag_t task = NULLTAG; + tag_t* doc_tags = NULLTAG; + string error; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + int arg_cnt = TC_number_of_arguments(msg.arguments); + char* types = NULL; + string erro2 = ""; + string erro = ""; + int send1 = 0; + int send2 = 0; + task = msg.task; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "type") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + types = argvalue; + + } + } + } + + printf("ȡUID"); + char* flowId; + ITK__convert_tag_to_uid(rootTask_tag, &flowId); + printf("%s\n", flowId); + //ȡĿϵµĶ + printf("8888888888888888888888888888888888888888888\n"); + printf("ȡĿϵµĶ\n"); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + printf("ʼѭȡĿ%d\n", doc_num); + vectorids; + vector revisions; + vector fileNames; + //ȡѡֵ + printf("ȡѡֵ\n"); + char* url = NULL, *sendfilepath = NULL,*fileURL = NULL; + PREF_ask_char_value("LD_PLM2MES_DJJDD_Config", 0, &url); + PREF_ask_char_value("LD_PLM2MES_DJJDD_Config", 1, &sendfilepath); + PREF_ask_char_value("LD_PLM2MES_DJJDD_Config", 2, &fileURL); + printf("url:%s\n", url); + printf("sendfilepath:%s\n", sendfilepath); + printf("fileURL:%s\n", fileURL); + + for (int i = 0; i < doc_num; i++) { + char* objtype = NULL; + printf("ȡ\n"); + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &objtype)); + vector ans; + Split(types, ";", ans); + for (int n = 0; n < ans.size(); n++) { + string gettype = ans[n]; + printf("̲typeԱ%s=%s\n",gettype.c_str(), objtype); + if (strcmp(gettype.c_str(), objtype) == 0) { + //ȡid + printf("ȡid\n"); + char* id = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &id)); + ids.push_back(id); + //ȡrevision + printf("ȡrevision\n"); + char* version = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_revision_id", &version)); + revisions.push_back(version); + //ȡݼļ + printf("ȡݼļ\n"); + int das_num = 0; + tag_t* das_tags; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "IMAN_specification", &das_num, &das_tags)); + string files; + for (int m = 0; m < das_num;m++) { + char* fileName = NULL; + ITKCALL(AOM_ask_value_string(das_tags[m], "object_name", &fileName)); + time_t nowtime; + time(&nowtime); //ȡ197011000뵽ھ + tm p; + localtime_s(&p, &nowtime); //תΪʱ,1900,Ҫ+1900,Ϊ0-11,Ҫ+1 + char fileDate[128] = ""; + char buffer[80]; + sprintf_s(buffer, "%04d%d%02d%02d%02d%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday,p.tm_hour,p.tm_min,p.tm_sec); + printf("ȡʱ䣺%s\n",buffer); + char sendname[SS_MAXPATHLEN] = ""; + strcat(sendname, buffer); + strcat(sendname, "-"); + strcat(sendname, fileName); + printf("ϲַ % s\n", sendname); + printf("ʼļfileռ\n"); + tag_t ref_object = NULLTAG; + printf("1"); + AE_reference_type_t reference_type; + printf("2"); + char ref_name[WSO_name_size_c + 1] = "excel"; + ITKCALL(AE_ask_dataset_named_ref2(das_tags[m], ref_name, &reference_type, &ref_object)); + printf("3"); + if (reference_type == AE_PART_OF) + { + printf("7"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, sendfilepath); + strcat(temp_file, "\\"); + strcat(temp_file, sendname); + printf("temp_file%s", temp_file); + ITKCALL(IMF_export_file(ref_object, temp_file)); + } + char temp_fileurl[SS_MAXPATHLEN] = ""; + strcpy(temp_fileurl, fileURL); + strcat(temp_fileurl, sendname); + files = files + temp_fileurl + ","; + } + if (!files.empty()) { + files = files.substr(0, files.length() - 1); + fileNames.push_back(files); + } + else { + fileNames.push_back(""); + } + + } + } + } + + printf("ȡҪ͵jsonַ\n"); + printf("flowId:%s\n", flowId); + + //ȡҪ͵jsonַ + std::string jsonString = generateJsonString2(flowId, ids, revisions,fileNames); + printf("jsonString:%s\n", jsonString.c_str()); + std::regex regex("\\s+"); + std::string result = std::regex_replace(jsonString, regex, ""); + // ת崦jsonַ + printf("ת崦jsonַ\n"); + escapeJson2(result); + printf("jsonString:%s\n", result.c_str()); + //jarӿڷ + printf("ʼִcmd"); + char cmd[1024] = ""; + strcpy(cmd, "java -jar D:\\Siemens\\Teamcenter13\\bin\\sapjco3.jar"); + strcat(cmd, " "); + strcat(cmd, url); + strcat(cmd, " "); + strcat(cmd, result.c_str()); + strcat(cmd, " "); + strcat(cmd, "3"); + printf("\n%s\n", cmd); + system(cmd); + //ȡļȡִн + //ȡصresultļSAP + string fileid = flowId; + string MESfile = "D:\\TCTOMES\\" + fileid + "result.txt"; + std::ifstream file(MESfile); + if (!file.is_open()) { + std::cerr << "Failed to open file!" << std::endl; + char* error = "MESδӦ"; + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + else { + std::stringstream buffer1; + buffer1 << file.rdbuf(); + std::string resultStr = buffer1.str(); + printf("صֵ%s:\n", resultStr.c_str()); + if (strcmp(resultStr.c_str(), "ɹ") == 0) { + return 0; + } + else { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", resultStr.c_str()); + return 1; + } + } + return 0; + } +} \ No newline at end of file diff --git a/connor_signature/LD_SendECRECN_ToSAPMES.cpp b/connor_signature/LD_SendECRECN_ToSAPMES.cpp new file mode 100644 index 0000000..907f609 --- /dev/null +++ b/connor_signature/LD_SendECRECN_ToSAPMES.cpp @@ -0,0 +1,839 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + +#define debug true +#define ITK_err 919012 + + + +// һд +void writeDataToFile(const std::string& fileName, const std::string& data) { + // һļ + std::ofstream outputFile(fileName); + + // ļǷɹ + if (outputFile.is_open()) { + // д + outputFile << data; + + // رļ + outputFile.close(); + std::cout << "Data written to file successfully." << std::endl; + } + else { + std::cerr << "Unable to open file for writing: " << fileName << std::endl; + } +} + +// UUID +char* generateRandomEightDigitNumberAsCharArray() { + GUID guid; + if (S_OK == CoCreateGuid(&guid)) { + // ̬㹻ڴ洢GUIDַ'\0' + char* guidStr = new char[37]; + + sprintf(guidStr, "%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX", + guid.Data1, guid.Data2, guid.Data3, + guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], + guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); + + std::cout << "Generated GUID: " << guidStr << std::endl; + + // ָ´ַָ + return guidStr; + } + else { + std::cerr << "Failed to create a GUID." << std::endl; + return nullptr; // ʱnullptr + } +} + + + + + + +int LD_SendECRECN_ToSAPMES(EPM_action_message_t msg) { + printf("ʼִLD_SendECRECN_ToSAPMES򡷡"); + tag_t rootTask_tag = NULLTAG; + tag_t task = NULLTAG; + + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + int arg_cnt = TC_number_of_arguments(msg.arguments); + //̲ + char* type = NULL; + char* relation = NULL; + char* secondarytype = NULL; + //Ŀ + int doc_num = 0; + tag_t* doc_tags = NULLTAG; + //Ϣ + string erro2 = ""; + string erro = ""; + //Ϣ + int send1 = 0; + int send2 = 0; + task = msg.task; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "primarytype") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + type = argvalue; + + } + } + if (strcmp(argflag, "relation") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + relation = argvalue; + + } + } + if (strcmp(argflag, "secondarytype") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:\n", argvalue); + secondarytype = argvalue; + + } + } + } + if (strcmp(type, "") == 0 || strcmp(relation, "") == 0 || strcmp(secondarytype, "") == 0) { + //Ϣʾ + char* error = "̲ǷΪջδ"; + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + //ȡMESĴݵַ + char* url; + PREF_ask_char_value("LD_PLM2MES_ECRECN_Config", 0, &url); + //ȡļַ + char* sendfilepath, *fileURL; + + PREF_ask_char_value("LD_SendECRECN_FileURL", 0, &sendfilepath); + PREF_ask_char_value("LD_SendECRECN_FileURL", 1, &fileURL); + //ȡĿ汾 + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + char* flowId = ""; + //ȡǰʱ + time_t nowtime; + time(&nowtime); //ȡ197011000뵽ھ + tm p; + localtime_s(&p, &nowtime); //תΪʱ,1900,Ҫ+1900,Ϊ0-11,Ҫ+1 + char buffer[80]; + //sprintf_s(buffer, "%04d%d%02d%02d%02d%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min, p.tm_sec); + sprintf_s(buffer, "%04d-%02d-%02d %02d:%02d:%2d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min,p.tm_sec); + printf("ȡʱ䣺%s\n", buffer); + if (doc_num>0) { + //ʼѭȡ󴫵 + std::stringstream jsonStr; + jsonStr << "["; + for (int i = 0; i < doc_num;i++) { + char* objtype = NULL; + printf("ȡ\n"); + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &objtype)); + printf("Ƚ%s%sǷͬ\n",type, objtype); + if (strcmp(type, objtype) == 0) { + printf("ȡƥ"); + //ж-primarytypeֵĶͣ汾ϵld6_ifeffectProdsֵǷӰ족ݴ + char* isbaohan; + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &flowId)); + ITKCALL(AOM_ask_value_string(doc_tags[i], "ld6_ifeffectProd", &isbaohan)); + if (strstr(isbaohan,"Ӱ")!=NULL) { + printf("ǰƥͰӰ죬ö"); + continue; + } + //ȡָϵµĶ + int das_num = 0; + tag_t* das_tags; + ITKCALL(AOM_ask_value_tags(doc_tags[i], relation, &das_num, &das_tags)); + + if (das_num>0) { + //ȡƥζ + char* cdxtype = NULL; + for (int j = 0; j < das_num;j++) { + //ʼƴַjson + char* MATNR = "", * ZVERSION = "", * ECNDOCU = "", * ECNSTATE = "", * ECRDOCU = "", * ECRSTATE = "", * ZSFYXSC = "", * ZDATE = "", * URLADD = " "; + ITKCALL(AOM_ask_value_string(das_tags[j], "object_type", &cdxtype)); + if (strstr(secondarytype, cdxtype) != NULL) { + //ȡMATNRϺ + printf("ȡMATNRϺ\n"); + ITKCALL(AOM_ask_value_string(das_tags[j], "item_id", &MATNR)); + printf("ȡZVERSION汾\n"); + ITKCALL(AOM_ask_value_string(das_tags[j], "ld6_clientPartRev", &ZVERSION)); + //ȡECNDOCU + /* + * LD6_ECRRevisionʱȡĿLD6_ECRRevisionitem_id + * LD6_ECNRevisionʱȡĿLD6_ECNRevisionitem_id + */ + if (strcmp(type, "LD6_CNRevision") == 0) { + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &ECNDOCU)); + date_t time1; + ITKCALL(AOM_ask_value_date(doc_tags[i], "date_released", &time1)); + if (time1.year == 0) { + //Ϊ + ECNSTATE = "δر"; + } + else { + //ڲΪ + ECNSTATE = "ѹر"; + } + int gx = 0; + tag_t* gxtag; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "CMImplements", &gx, &gxtag)); + if (gx > 0) + { + for (int b = 0; b < gx; b++) { + char* ty; + ITKCALL(AOM_ask_value_string(gxtag[b], "object_type", &ty)); + if (strcmp("LD6_CRRevision", ty) == 0) { + ITKCALL(AOM_ask_value_string(gxtag[b], "item_id", &ECRDOCU)); + date_t time; + ITKCALL(AOM_ask_value_date(gxtag[b], "date_released", &time)); + if (time.year == 0) { + //Ϊ + ECRSTATE = "δر"; + } + else { + //ڲΪ + ECRSTATE = "ѹر"; + } + } + //ȡZSFYXSC + ITKCALL(AOM_ask_value_string(doc_tags[i], "ld6_ifeffectProd", &ZSFYXSC)); + //ȡʱZDATE + ZDATE = buffer; + //ȡURLADD 淶ϵIMAN_specificationݼݵftpУURLַ + int gfnum = 0; + tag_t* gftag = NULL; + printf("ʼȡ淶ϵļ\n"); + ITKCALL(AOM_ask_value_tags(doc_tags[i], "IMAN_specification", &gfnum, &gftag)); + //ȡݼö + string files = ""; + + for (int a = 0; a < gfnum; a++) { + printf("ȡ˹淶ϵļʼ\n"); + char* fileName = NULL; + ITKCALL(AOM_ask_value_string(gftag[a], "object_name", &fileName)); + time_t nowtime; + time(&nowtime); //ȡ197011000뵽ھ + tm p; + localtime_s(&p, &nowtime); //תΪʱ,1900,Ҫ+1900,Ϊ0-11,Ҫ+1 + char fileDate[128] = ""; + char getbuffer[80]; + sprintf_s(getbuffer, "%04d%d%02d%02d%02d%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min, p.tm_sec); + //sprintf_s(getbuffer, "%04d%d%02d %02d:%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min); + printf("ȡʱ䣺%s\n", getbuffer); + char sendname[SS_MAXPATHLEN] = ""; + strcat(sendname, getbuffer); + strcat(sendname, "-"); + char* random = generateRandomEightDigitNumberAsCharArray(); + strcat(sendname, random); + strcat(sendname, "-"); + strcat(sendname, fileName); + printf("ϲַ % s\n", sendname); + printf("ʼļfileռ\n"); + + tag_t ref_object = NULLTAG; + printf("1"); + AE_reference_type_t reference_type; + printf("2"); + char ref_name[WSO_name_size_c + 1] = "excel"; + ITKCALL(AE_ask_dataset_named_ref2(gftag[a], ref_name, &reference_type, &ref_object)); + printf("3"); + if (reference_type == AE_PART_OF) + { + printf("7"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, sendfilepath); + strcat(temp_file, "\\"); + strcat(temp_file, sendname); + printf("temp_file%s", temp_file); + ITKCALL(IMF_export_file(ref_object, temp_file)); + } + char temp_fileurl[SS_MAXPATHLEN] = ""; + strcpy(temp_fileurl, fileURL); + strcat(temp_fileurl, sendname); + files = files + temp_fileurl + ","; + + } + if (!files.empty()) { + files = files.substr(0, files.length() - 1); + } + URLADD = const_cast(files.c_str()); + //ʼƴַMATNR,ZVERSION,ECNDOCU,ECNSTATE,ECRDOCU,ECRSTATE,ZSFYXSC,DATE,URLADD; + jsonStr << "{"; + jsonStr << "\"matnr\":\"" << MATNR << "\","; + jsonStr << "\"zversion\":\"" << ZVERSION << "\","; + jsonStr << "\"ecndocu\":\"" << ECNDOCU << "\","; + jsonStr << "\"ecnstate\":\"" << ECNSTATE << "\","; + jsonStr << "\"ecrdocu\":\"" << ECRDOCU << "\","; + jsonStr << "\"ecrstate\":\"" << ECRSTATE << "\","; + jsonStr << "\"zsfyxsc\":\"" << ZSFYXSC << "\","; + jsonStr << "\"zdate\":\"" << ZDATE << "\","; + jsonStr << "\"urladd\":\"" << URLADD << "\"},"; + + } + } + else + { + //ȡZSFYXSC + ITKCALL(AOM_ask_value_string(doc_tags[i], "ld6_ifeffectProd", &ZSFYXSC)); + //ȡʱZDATE + ZDATE = buffer; + //ȡURLADD 淶ϵIMAN_specificationݼݵftpУURLַ + int gfnum = 0; + tag_t* gftag = NULL; + printf("ʼȡ淶ϵļ\n"); + ITKCALL(AOM_ask_value_tags(doc_tags[i], "IMAN_specification", &gfnum, &gftag)); + //ȡݼö + string files = ""; + + for (int a = 0; a < gfnum; a++) { + printf("ȡ˹淶ϵļʼ\n"); + char* fileName = NULL; + ITKCALL(AOM_ask_value_string(gftag[a], "object_name", &fileName)); + time_t nowtime; + time(&nowtime); //ȡ197011000뵽ھ + tm p; + localtime_s(&p, &nowtime); //תΪʱ,1900,Ҫ+1900,Ϊ0-11,Ҫ+1 + char fileDate[128] = ""; + char getbuffer[80]; + sprintf_s(getbuffer, "%04d%d%02d%02d%02d%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min, p.tm_sec); + //sprintf_s(getbuffer, "%04d%d%02d %02d:%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min); + printf("ȡʱ䣺%s\n", getbuffer); + char sendname[SS_MAXPATHLEN] = ""; + strcat(sendname, getbuffer); + strcat(sendname, "-"); + char* random = generateRandomEightDigitNumberAsCharArray(); + strcat(sendname, random); + strcat(sendname, "-"); + strcat(sendname, fileName); + printf("ϲַ % s\n", sendname); + printf("ʼļfileռ\n"); + + tag_t ref_object = NULLTAG; + printf("1"); + AE_reference_type_t reference_type; + printf("2"); + char ref_name[WSO_name_size_c + 1] = "excel"; + ITKCALL(AE_ask_dataset_named_ref2(gftag[a], ref_name, &reference_type, &ref_object)); + printf("3"); + if (reference_type == AE_PART_OF) + { + printf("7"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, sendfilepath); + strcat(temp_file, "\\"); + strcat(temp_file, sendname); + printf("temp_file%s", temp_file); + ITKCALL(IMF_export_file(ref_object, temp_file)); + } + char temp_fileurl[SS_MAXPATHLEN] = ""; + strcpy(temp_fileurl, fileURL); + strcat(temp_fileurl, sendname); + files = files + temp_fileurl + ","; + + } + if (!files.empty()) { + files = files.substr(0, files.length() - 1); + } + URLADD = const_cast(files.c_str()); + //ʼƴַMATNR,ZVERSION,ECNDOCU,ECNSTATE,ECRDOCU,ECRSTATE,ZSFYXSC,DATE,URLADD; + jsonStr << "{"; + jsonStr << "\"matnr\":\"" << MATNR << "\","; + jsonStr << "\"zversion\":\"" << ZVERSION << "\","; + jsonStr << "\"ecndocu\":\"" << ECNDOCU << "\","; + jsonStr << "\"ecnstate\":\"" << ECNSTATE << "\","; + jsonStr << "\"ecrdocu\":\"" << ECRDOCU << "\","; + jsonStr << "\"ecrstate\":\"" << ECRSTATE << "\","; + jsonStr << "\"zsfyxsc\":\"" << ZSFYXSC << "\","; + jsonStr << "\"zdate\":\"" << ZDATE << "\","; + jsonStr << "\"urladd\":\"" << URLADD << "\"},"; + + } + + } + else if (strcmp(type, "LD6_CRRevision") == 0) { + int gx = 0; + tag_t *gxtag; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "CMImplementedBy", &gx, &gxtag)); + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &ECRDOCU)); + date_t time1; + ITKCALL(AOM_ask_value_date(doc_tags[i], "date_released", &time1)); + if (time1.year == 0) { + //Ϊ + ECRSTATE = "δر"; + } + else { + //ڲΪ + ECRSTATE = "ѹر"; + } + for (int b = 0; b < gx;b++) { + char* ty; + ITKCALL(AOM_ask_value_string(gxtag[b], "object_type", &ty)); + if (strcmp("LD6_CNRevision",ty) == 0) { + ITKCALL(AOM_ask_value_string(gxtag[b], "item_id", &ECNDOCU)); + date_t time; + ITKCALL(AOM_ask_value_date(gxtag[b], "date_released", &time)); + if (time.year == 0) { + //Ϊ + ECNSTATE = "δر"; + } + else { + //ڲΪ + ECNSTATE = "ѹر"; + } + } + + //ȡZSFYXSC + ITKCALL(AOM_ask_value_string(doc_tags[i], "ld6_ifeffectProd", &ZSFYXSC)); + //ȡʱZDATE + ZDATE = buffer; + //ȡURLADD 淶ϵIMAN_specificationݼݵftpУURLַ + int gfnum = 0; + tag_t* gftag = NULL; + printf("ʼȡ淶ϵļ\n"); + ITKCALL(AOM_ask_value_tags(doc_tags[i], "IMAN_specification", &gfnum, &gftag)); + //ȡݼö + string files = ""; + for (int a = 0; a < gfnum; a++) { + printf("ȡ˹淶ϵļʼ\n"); + char* fileName = NULL; + ITKCALL(AOM_ask_value_string(gftag[a], "object_name", &fileName)); + time_t nowtime; + time(&nowtime); //ȡ197011000뵽ھ + tm p; + localtime_s(&p, &nowtime); //תΪʱ,1900,Ҫ+1900,Ϊ0-11,Ҫ+1 + char fileDate[128] = ""; + char getbuffer[80]; + sprintf_s(getbuffer, "%04d%d%02d%02d%02d%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min, p.tm_sec); + //sprintf_s(getbuffer, "%04d%d%02d %02d:%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min); + printf("ȡʱ䣺%s\n", getbuffer); + char sendname[SS_MAXPATHLEN] = ""; + strcat(sendname, getbuffer); + strcat(sendname, "-"); + char* random = generateRandomEightDigitNumberAsCharArray(); + strcat(sendname, random); + strcat(sendname, "-"); + strcat(sendname, fileName); + printf("ϲַ % s\n", sendname); + printf("ʼļfileռ\n"); + + tag_t ref_object = NULLTAG; + printf("1"); + AE_reference_type_t reference_type; + printf("2"); + char ref_name[WSO_name_size_c + 1] = "excel"; + ITKCALL(AE_ask_dataset_named_ref2(gftag[a], ref_name, &reference_type, &ref_object)); + printf("3"); + if (reference_type == AE_PART_OF) + { + printf("7"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, sendfilepath); + strcat(temp_file, "\\"); + strcat(temp_file, sendname); + printf("temp_file%s", temp_file); + ITKCALL(IMF_export_file(ref_object, temp_file)); + } + char temp_fileurl[SS_MAXPATHLEN] = ""; + strcpy(temp_fileurl, fileURL); + strcat(temp_fileurl, sendname); + files = files + temp_fileurl + ","; + + } + if (!files.empty()) { + files = files.substr(0, files.length() - 1); + } + URLADD = const_cast(files.c_str()); + //ʼƴַMATNR,ZVERSION,ECNDOCU,ECNSTATE,ECRDOCU,ECRSTATE,ZSFYXSC,DATE,URLADD; + jsonStr << "{"; + jsonStr << "\"matnr\":\"" << MATNR << "\","; + jsonStr << "\"zversion\":\"" << ZVERSION << "\","; + jsonStr << "\"ecndocu\":\"" << ECNDOCU << "\","; + jsonStr << "\"ecnstate\":\"" << ECNSTATE << "\","; + jsonStr << "\"ecrdocu\":\"" << ECRDOCU << "\","; + jsonStr << "\"ecrstate\":\"" << ECRSTATE << "\","; + jsonStr << "\"zsfyxsc\":\"" << ZSFYXSC << "\","; + jsonStr << "\"zdate\":\"" << ZDATE << "\","; + jsonStr << "\"urladd\":\"" << URLADD << "\"},"; + } + + } + + + } + + } + + } + else { + /* + * -primarytypeΪLD6_CNRevision,LD6_CNRevision-relationָĹϵΪգ + ȡLD6_CNRevisionCMImplementsϵµLD6_CRRevision-relationָĹϵ + -secondarytypeָ + */ + if (strcmp(type,"LD6_CNRevision") == 0) { + int das_num2 = 0; + tag_t* das_tags2; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "CMImplements", &das_num2, &das_tags2)); + if (das_num2 > 0) { + //ȡƥζ + char* cdxtype = NULL; + for (int j = 0; j < das_num2; j++) { + //ʼƴַjson + char* MATNR = "", * ZVERSION = "", * ECNDOCU = "", * ECNSTATE = "", * ECRDOCU = "", * ECRSTATE = "", * ZSFYXSC = "", * ZDATE = "", * URLADD = " "; + ITKCALL(AOM_ask_value_string(das_tags2[j], "object_type", &cdxtype)); + if (strstr(secondarytype, cdxtype) != NULL) { + //ȡMATNRϺ + printf("ȡMATNRϺ\n"); + ITKCALL(AOM_ask_value_string(das_tags2[j], "item_id", &MATNR)); + printf("ȡZVERSION汾\n"); + ITKCALL(AOM_ask_value_string(das_tags2[j], "ld6_clientPartRev", &ZVERSION)); + //ȡECNDOCU + /* + * LD6_ECRRevisionʱȡĿLD6_ECRRevisionitem_id + * LD6_ECNRevisionʱȡĿLD6_ECNRevisionitem_id + */ + if (strcmp(type, "LD6_CNRevision") == 0) { + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &ECNDOCU)); + date_t time; + ITKCALL(AOM_ask_value_date(doc_tags[i], "date_released", &time)); + if (time.year == 0) { + //Ϊ + ECNSTATE = "δر"; + } + else { + //ڲΪ + ECNSTATE = "ѹر"; + } + } + else if (strcmp(type, "LD6_CRRevision") == 0) { + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &ECRDOCU)); + date_t time; + ITKCALL(AOM_ask_value_date(doc_tags[i], "date_released", &time)); + if (time.year == 0) { + //Ϊ + ECRSTATE = "δر"; + } + else { + //ڲΪ + ECRSTATE = "ѹر"; + } + } + //ȡZSFYXSC + ITKCALL(AOM_ask_value_string(doc_tags[i], "ld6_ifeffectProd", &ZSFYXSC)); + //ȡʱZDATE + ZDATE = buffer; + //ȡURLADD 淶ϵIMAN_specificationݼݵftpУURLַ + int gfnum = 0; + tag_t* gftag; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "IMAN_specification", &gfnum, &gftag)); + //ȡݼö + string files = ""; + for (int a = 0; a < gfnum; a++) { + char* fileName = NULL; + ITKCALL(AOM_ask_value_string(gftag[a], "object_name", &fileName)); + time_t nowtime; + time(&nowtime); //ȡ197011000뵽ھ + tm p; + localtime_s(&p, &nowtime); //תΪʱ,1900,Ҫ+1900,Ϊ0-11,Ҫ+1 + char fileDate[128] = ""; + char getbuffer[80]; + sprintf_s(getbuffer, "%04d%02d%02d%02d%02d%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min, p.tm_sec); + printf("ȡʱ䣺%s\n", getbuffer); + char sendname[SS_MAXPATHLEN] = ""; + strcat(sendname, getbuffer); + strcat(sendname, "-"); + char* random = generateRandomEightDigitNumberAsCharArray(); + strcat(sendname, random); + strcat(sendname, "-"); + strcat(sendname, fileName); + printf("ϲַ % s\n", sendname); + printf("ʼļfileռ\n"); + tag_t ref_object = NULLTAG; + printf("1"); + AE_reference_type_t reference_type; + printf("2"); + char ref_name[WSO_name_size_c + 1] = "excel"; + ITKCALL(AE_ask_dataset_named_ref2(gftag[a], ref_name, &reference_type, &ref_object)); + printf("3"); + if (reference_type == AE_PART_OF) + { + printf("7"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, sendfilepath); + strcat(temp_file, "\\"); + strcat(temp_file, sendname); + printf("temp_file%s", temp_file); + ITKCALL(IMF_export_file(ref_object, temp_file)); + } + char temp_fileurl[SS_MAXPATHLEN] = ""; + strcpy(temp_fileurl, fileURL); + strcat(temp_fileurl, sendname); + files = files + temp_fileurl + ","; + + } + if (!files.empty()) { + files = files.substr(0, files.length() - 1); + } + URLADD = const_cast(files.c_str()); + //ʼƴַMATNR,ZVERSION,ECNDOCU,ECNSTATE,ECRDOCU,ECRSTATE,ZSFYXSC,DATE,URLADD; + jsonStr << "{"; + jsonStr << "\"matnr\":\"" << MATNR << "\","; + jsonStr << "\"zversion\":\"" << ZVERSION << "\","; + jsonStr << "\"ecndocu\":\"" << ECNDOCU << "\","; + jsonStr << "\"ecnstate\":\"" << ECNSTATE << "\","; + jsonStr << "\"ecrdocu\":\"" << ECRDOCU << "\","; + jsonStr << "\"ecrstate\":\"" << ECRSTATE << "\","; + jsonStr << "\"zsfyxsc\":\"" << ZSFYXSC << "\","; + jsonStr << "\"zdate\":\"" << ZDATE << "\","; + jsonStr << "\"urladd\":\"" << URLADD << "\"},"; + + } + } + + } + } + else { + char* MATNR = "", * ZVERSION = "", * ECNDOCU = "", * ECNSTATE = "", * ECRDOCU = "", * ECRSTATE = "", * ZSFYXSC = "", * ZDATE = "", * URLADD = " "; + //ȡMATNRϺ + printf("ȡMATNRϺ\n"); + MATNR = " "; + printf("ȡZVERSION汾\n"); + ZVERSION = " "; + //ȡECNDOCU + /* + * LD6_ECRRevisionʱȡĿLD6_ECRRevisionitem_id + * LD6_ECNRevisionʱȡĿLD6_ECNRevisionitem_id + */ + if (strcmp(type, "LD6_CNRevision") == 0) { + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &ECNDOCU)); + date_t time; + ITKCALL(AOM_ask_value_date(doc_tags[i], "date_released", &time)); + if (time.year == 0) { + //Ϊ + ECNSTATE = "δر"; + } + else { + //ڲΪ + ECNSTATE = "ѹر"; + } + } + else if (strcmp(type, "LD6_CRRevision") == 0) { + ITKCALL(AOM_ask_value_string(doc_tags[i], "item_id", &ECRDOCU)); + date_t time; + ITKCALL(AOM_ask_value_date(doc_tags[i], "date_released", &time)); + if (time.year == 0) { + //Ϊ + ECRSTATE = "δر"; + } + else { + //ڲΪ + ECRSTATE = "ѹر"; + } + } + //ȡZSFYXSC + ITKCALL(AOM_ask_value_string(doc_tags[i], "ld6_ifeffectProd", &ZSFYXSC)); + //ȡʱZDATE + ZDATE = buffer; + //ȡURLADD 淶ϵIMAN_specificationݼݵftpУURLַ + int gfnum = 0; + tag_t* gftag; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "IMAN_specification", &gfnum, &gftag)); + //ȡݼö + string files = ""; + if (gfnum>0) + { + for (int a = 0; a < gfnum; a++) { + char* fileName = NULL; + ITKCALL(AOM_ask_value_string(gftag[a], "object_name", &fileName)); + time_t nowtime; + time(&nowtime); //ȡ197011000뵽ھ + tm p; + localtime_s(&p, &nowtime); //תΪʱ,1900,Ҫ+1900,Ϊ0-11,Ҫ+1 + char fileDate[128] = ""; + char getbuffer[80]; + sprintf_s(getbuffer, "%04d%02d%02d%02d%02d%02d", 1900 + p.tm_year, p.tm_mon + 1, p.tm_mday, p.tm_hour, p.tm_min, p.tm_sec); + printf("ȡʱ䣺%s\n", getbuffer); + char sendname[SS_MAXPATHLEN] = ""; + strcat(sendname, getbuffer); + strcat(sendname, "-"); + char* random = generateRandomEightDigitNumberAsCharArray(); + strcat(sendname, random); + strcat(sendname, "-"); + strcat(sendname, fileName); + printf("ϲַ % s\n", sendname); + printf("ʼļfileռ\n"); + tag_t ref_object = NULLTAG; + printf("1"); + AE_reference_type_t reference_type; + printf("2"); + char ref_name[WSO_name_size_c + 1] = "excel"; + ITKCALL(AE_ask_dataset_named_ref2(gftag[a], ref_name, &reference_type, &ref_object)); + printf("3"); + if (reference_type == AE_PART_OF) + { + printf("7"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, sendfilepath); + strcat(temp_file, "\\"); + strcat(temp_file, sendname); + printf("temp_file%s", temp_file); + ITKCALL(IMF_export_file(ref_object, temp_file)); + } + char temp_fileurl[SS_MAXPATHLEN] = ""; + strcpy(temp_fileurl, fileURL); + strcat(temp_fileurl, sendname); + files = files + temp_fileurl + ","; + + } + } + if (!files.empty()) { + files = files.substr(0, files.length() - 1); + } + URLADD = const_cast(files.c_str()); + //ʼƴַMATNR,ZVERSION,ECNDOCU,ECNSTATE,ECRDOCU,ECRSTATE,ZSFYXSC,DATE,URLADD; + jsonStr << "{"; + jsonStr << "\"matnr\":\"" << MATNR << "\","; + jsonStr << "\"zversion\":\"" << ZVERSION << "\","; + jsonStr << "\"ecndocu\":\"" << ECNDOCU << "\","; + jsonStr << "\"ecnstate\":\"" << ECNSTATE << "\","; + jsonStr << "\"ecrdocu\":\"" << ECRDOCU << "\","; + jsonStr << "\"ecrstate\":\"" << ECRSTATE << "\","; + jsonStr << "\"zsfyxsc\":\"" << ZSFYXSC << "\","; + jsonStr << "\"zdate\":\"" << ZDATE << "\","; + jsonStr << "\"urladd\":\"" << URLADD << "\"},"; + + } + } + break; + } + } + + //ɾһλ + // ȡǰַ + std::string str = jsonStr.str(); + + // 鲢ƳβĶţڣ + if (!str.empty() && str.back() == ',') { + str.pop_back(); + } + + // ַĩβһ + str += "]"; + + printf("ȡֵ飺%s\n", str.c_str()); + + if (strcmp(str.c_str(),"[]") == 0) { + //ûлȡ + return 0; + } + + char* taguid; + ITK__convert_tag_to_uid(rootTask_tag, &taguid); + string taguidstring = taguid; + string inputFile = "D:\\TCTOMAS\\" + taguidstring + "input.txt"; + + //ֵд뱾 + writeDataToFile(inputFile, str.c_str()); + + + //cmdִjarݴݵMESSAP + char cmd[4196] = ""; + strcpy(cmd, "java -jar D:\\Siemens\\Teamcenter13\\bin\\sapjco3.jar"); + printf("\n1%s\n", cmd); + strcat(cmd, " "); + printf("\n2%s\n", cmd); + strcat(cmd, url); + printf("\n3%s\n", cmd); + strcat(cmd, " "); + printf("\n4%s\n", cmd); + strcat(cmd, taguid); + printf("\n5%s\n", cmd); + strcat(cmd, " "); + printf("\n6%s\n", cmd); + strcat(cmd, "ECNECR"); + printf("\n7%s\n", cmd); + strcat(cmd, " "); + printf("\n8%s\n", cmd); + strcat(cmd, flowId); + printf("\n9%s\n", cmd); + system(cmd); + + //ȡļȡִн + //ȡصresultļSAP + string fileid = flowId; + string MESfile = "D:\\TCTOMAS\\" + fileid + "result.txt"; + std::ifstream file(MESfile); + if (!file.is_open()) { + std::cerr << "Failed to open file!" << std::endl; + char* error = "δӦ"; + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } + else { + std::stringstream buffer1; + buffer1 << file.rdbuf(); + std::string resultStr = buffer1.str(); + printf("صֵ%s:\n", resultStr.c_str()); + if (strcmp(resultStr.c_str(), "SAP:ɹ,MES:ɹ") == 0) { + return 0; + } + else { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", resultStr.c_str()); + return 1; + } + } + return 0; + } + } + else { + //Ϣʾ + char* error = "Ŀûж"; + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); + return 1; + } +} \ No newline at end of file diff --git a/connor_signature/LD_TaskAssignmentDate.cpp b/connor_signature/LD_TaskAssignmentDate.cpp new file mode 100644 index 0000000..f3deb99 --- /dev/null +++ b/connor_signature/LD_TaskAssignmentDate.cpp @@ -0,0 +1,125 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "ado.h" +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + +#define debug true +#define ITK_err 919012 + +int LD_TaskAssignmentDate(EPM_action_message_t msg) { + printf("=========================ʼ===================\n"); + int cnt = 0; + char** vals = NULL; + //ȡѡֵ + PREF_ask_char_values("LD_dbinfo2", &cnt, &vals); + //ȡǰʱ + time_t now = time(0); + tm* p = localtime(&now); + char dateNow[128] = ""; + sprintf_s(dateNow, "%04d%02d%02d%02d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + string dateString = dateNow; + + int ifail = ITK_ok; + int attachments_num = 0; + tag_t rootTask = NULLTAG, * attachments = NULLTAG; + //ȡ + EPM_ask_root_task(msg.task, &rootTask); + //ȡĿ + EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments); + + + for (int r = 0; r < attachments_num; r++) { + char* itemObjId; + char* objectType; + char* revision_id; + AOM_ask_value_string(attachments[r], "object_type", &objectType); + printf("objectType===%s\n", objectType); + if (strcmp(objectType, "LD6_CusProdFolder") == 0) { + + //ȡǰconditionڵֵ + tag_t* fnd0ActuatedInteractiveTsks_val; + int fnd0ActuatedInteractiveTsks_num = 0; + AOM_ask_value_tags(attachments[r], "fnd0ActuatedInteractiveTsks", &fnd0ActuatedInteractiveTsks_num, &fnd0ActuatedInteractiveTsks_val); + if (fnd0ActuatedInteractiveTsks_num > 0) { + + for (int i = 0; i < fnd0ActuatedInteractiveTsks_num; i++) + { + char* task_type; + AOM_ask_value_string(fnd0ActuatedInteractiveTsks_val[i], "task_type", &task_type); + printf("task_type===%s\n", task_type); + if (strcmp(task_type, "EPMConditionTask") == 0) { + + char* task_result; + AOM_ask_value_string(fnd0ActuatedInteractiveTsks_val[i], "task_result", &task_result); + printf("task_result===%s\n", task_result); + + //ݿⱣ浱ǰƵݿ + char* folder_uid; + ITK__convert_tag_to_uid(attachments[r], &folder_uid);//ȡļuid + + if (open("infodba", "infodba", vals[1], vals[0])) { + printf("=========================ʧ===================\n"); + } + else { + //ȡǰʱ + auto now = std::chrono::system_clock::now(); + std::time_t time = std::chrono::system_clock::to_time_t(now); + std::tm* ptm = std::localtime(&time); + char buf[128]; + strftime(buf, sizeof(buf), "%Y-%m-%d", ptm); + printf("time===%s\n", buf); + //update + char sql[200] = ""; + sprintf(sql, "UPDATE LD6_NewProdForm_VALUES SET TaskAssignmentDate = '%s' WHERE ClientProductFolderPUID = '%s' AND NewProductTaskItem = '%s'", buf, folder_uid, task_result); + printf("sql===%s\n", sql); + if (ExecuteSQLNoInputParam(sql) == 0) + { + printf("=========================޸ijɹ===================\n"); + } + else + { + printf("=========================޸ʧ===================\n"); + } + } + break; + } + + } + + + + } + } + } + + printf("============================================\n"); + return 0; + } + + diff --git a/connor_signature/ReadMe.txt b/connor_signature/ReadMe.txt new file mode 100644 index 0000000..c0f552d --- /dev/null +++ b/connor_signature/ReadMe.txt @@ -0,0 +1,30 @@ +======================================================================== + 动态链接库:connor_signature 项目概述 +======================================================================== + +表单签名 + +action handler: CONNOR_AVIC_Signature_master +参数 +-node_type: 配置要提取签名信息的节点名称 +-node_type_clear: 配置要清空签名信息的节点名称(因为无法确定已储存签名是从哪个节点提取的,清空指定节点信息实现困难,需要配置重新签名) +-date_format: 日期格式,默认%Y-%m-%d +首选项 +Connor_AVIC_Signature_master: 详见规格书 +Connor_AVIC_Department: 详见规格书 + + +CATIA签名 + +action handler: Connor_AVIC_CATIASign +参数 +-ModelSignMod: 配置后运行3D反签 +-DrwSignMod: 配置后运行二维反签 +-bypass: 配置后 +执行 +-TempPath: 配置下载路径 +-SignInfo: 反签信息,格式“标识名=属性位置.属性名称”,属性位置包含:ITEM, REV, ITEMMASTER, REVMASTER,注意大写 +-donotdeletefile: 不删除签名中间文件 +首选项 +Connor_AVIC_ModelSignMod: 单值,站点。配置3D反签命令,即批处理文件内容,并将临时文件路径替换为“%s” +Connor_AVIC_DrwSignMod: 单值,站点。配置二维反签命令,即批处理文件内容,并将临时文件路径替换为“%s” \ No newline at end of file diff --git a/connor_signature/SH_PLM_Email.cpp b/connor_signature/SH_PLM_Email.cpp new file mode 100644 index 0000000..bc135e5 --- /dev/null +++ b/connor_signature/SH_PLM_Email.cpp @@ -0,0 +1,143 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include + +extern "C" int POM_AM__set_application_bypass(logical bypass); + + +int SH_PLM_Email(EPM_action_message_t msg) { + bool debug = false; + int ifail = ITK_ok, arg_cnt = 0, att_cnt = 0, task_count = 0, user_cnt = 0; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + char* user_name = NULL, * job_name = NULL, * object_string,*username = ""; + tag_t owning_user = NULL; + tag_t task_tag = NULLTAG, rootTask_tag = NULLTAG, user_tag = NULLTAG; + tag_t* attachments = NULL, * task_tags = NULL; + arg_cnt = TC_number_of_arguments(msg.arguments); + vector all_user_tags; + vector mail_addrs; + + + char* outPersonMailAddress = NULL; + char* content = NULL; + ITKCALL(POM_get_user(&user_name, &user_tag)); + printf("=============================================================\n"); + printf("ʼִУSH_PLM_Email\n"); + printf("=============================================================\n"); + printf("Ȩ\n"); + POM_AM__set_application_bypass(true); + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "recipient") == 0) { + outPersonMailAddress = argvalue; + printf("outPersonMailAddress:%s\n",outPersonMailAddress); + } + + if (strcmp(argflag, "content") == 0) { + content = argvalue; + printf("content:%s\n", content); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + ITKCALL(ifail = EPM_ask_root_task(task_tag, &rootTask_tag)); + ITKCALL(ifail = AOM_ask_value_string(rootTask_tag, "job_name", &job_name)); + ITKCALL(ifail = AOM_ask_value_tag(rootTask_tag, "owning_user", &owning_user)); + ITKCALL(ifail = AOM_ask_value_string(owning_user, "user_name", &username)); + ITKCALL(ifail = AOM_ask_value_string(rootTask_tag, "object_string", &object_string)); + printf("ƣ%s\n", job_name); + printf("ˣ%s\n", user_name); + + + //ⲿԱַ + if (outPersonMailAddress != NULL) { + vector mailaddressVector; + Split(outPersonMailAddress, ";", mailaddressVector); + for (int i = 0; i < mailaddressVector.size(); i++) { + mail_addrs.push_back(mailaddressVector[i]); + } + } + + user_cnt = mail_addrs.size(); + printf("ʼ%d\n", user_cnt); + printf("ʼԱ%s\n", mail_addrs[0].c_str()); + + char zt[128] = ""; + strcat(zt, "TeamCenter-"); + strcat(zt, object_string); + + printf("ʼ⣺%s\n", zt); + + char nr[512] = ""; + strcat(nr, "յ"); + strcat(nr, username); + strcat(nr, ""); + strcat(nr, job_name); + strcat(nr, ""); + strcat(nr, content); + printf("ʼݣ%s\n", nr); + + char jarfile[512] = ""; + sprintf(jarfile, "%s\\bin\\EMailSender.jar", getenv("TC_ROOT")); + for (int i = 0; i < user_cnt; i++) { + char cmd[1024] = ""; + + string mail_addr = mail_addrs[i]; + strcpy(cmd, "java -jar "); + strcat(cmd, jarfile); + strcat(cmd, " \""); + strcat(cmd, mail_addr.c_str()); + strcat(cmd, "\" \""); + strcat(cmd, zt); + strcat(cmd, "\" \""); + strcat(cmd, nr); + strcat(cmd, "\""); + printf("CMD%s", cmd); + system(cmd); + printf("ִ"); + } + printf("سȨ\n"); + POM_AM__set_application_bypass(false); +end: + DOFREE(job_name); + DOFREE(attachments); + all_user_tags.clear(); + printf("=============================================================\n"); + printf("ִнSH_PLM_Email\n"); + printf("=============================================================\n"); + return ITK_ok; +} \ No newline at end of file diff --git a/connor_signature/Send_Sap_Bom.cpp b/connor_signature/Send_Sap_Bom.cpp new file mode 100644 index 0000000..ff09ca0 --- /dev/null +++ b/connor_signature/Send_Sap_Bom.cpp @@ -0,0 +1,1417 @@ +#include"kutil.h" + +#define debug true +#define ITK_err 919012 +#define RAYCUS_PLM_TO_SAP_Bom "Raycus_Plm_To_Sap_Bom" +#define RAYCUS_CONFIG_BOM_FIELDS "Raycus_Config_Bom_Fields" + +#define RAYCUS_PLM_TO_SAP_Bom_REVISE "Raycus_Plm_To_Sap_Bom_Revise" +#define RAYCUS_CONFIG_BOM_FIELDS_REVISE "Raycus_Config_Bom_Fields_Revise" + +#define RAYCUS_PLM_TO_SAP_FBBom "Raycus_Plm_To_Sap_Fbbom" +#define RAYCUS_CONFIG_FBBOM_FIELDS "Raycus_Config_Fbbom_Fields" +#define RAYCUS_MBOM_Check_BOMLINE "MBOM_Check_BOMLINE" +#define RAYCUS_CONFIG_BZGX_FIELDS "Raycus_Config_Bzgx_Fields" +#define RAYCUS_PLM_TO_SAP_BZGX "Raycus_Plm_To_Sap_Bzgx" +typedef struct { + string send_name; + string type; + string title; + string prop_type; + string prop_name; + string default; +} Config; + +typedef struct { + tag_t rev_tag; //汾 + tag_t bom_tag; //bom + string id; //id + string sequence;//ұ + string revision_id;//汾 + string rev_type; // + string flag; //ǣA,޸ģUɾ:D +} BomlineType; + +tag_t getBomProp(tag_t rev, vector& lines); +boolean compareProps(BomlineType lines1, BomlineType lines2, vector checkBomPorps); +int parseConfigs(vector pref_values, vector& son_configs, vector& title_configs); +string read_data(tag_t bomline_tag, vector configs,tag_t parentline_tag); + +//BOMSAP +int PLM_MBOM_TO_SAP_NEW(EPM_action_message_t msg) { + int ifail = ITK_ok, arg_cnt = 0, att_cnt= 0, bvr_count = 0,count = 0; + char* arg = NULL,* argflag = NULL, *argvalue = NULL, toJar[1000] = ""; + tag_t* attachments = NULLTAG,task_tag = NULLTAG, rootTask_tag,* bvr_list = NULLTAG, bom_window_tag, top_line; + string type, jsonStr; + vector types, urlPrefs, fieldPrefs,return_vector; + vector son_configs,title_configs; + + time_t now = time(0); + tm* p = localtime(&now); + char date[128] = "", fileDate[128] = ""; + char* tc_root_file = getenv("tc_root"); //C:\Siemens\Teamcenter11 + char data_file[SS_MAXPATHLEN] = "" , data_file_return[SS_MAXPATHLEN] = "",data_file_error[SS_MAXPATHLEN] = ""; + ofstream file; + + WriteLog(debug, "ʼִУBOMSAP (PLM_MBOM_TO_SAP_NEW) ..."); + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "type") == 0) { + type.assign(argvalue); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + else { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲"); + ifail = 1; + goto end; + } + { + Split(type, ",", types); + if (types.size() == 0) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-type"); + goto end; + } + } + //õǰڵ + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + ITKCALL(ifail = EPM_ask_root_task(task_tag, &rootTask_tag)); + //ȡĿж + ITKCALL(ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt == 0) { + goto end; + } + + //ѡ + { + getPrefStrings(RAYCUS_PLM_TO_SAP_Bom, TC_preference_site, urlPrefs); + if (urlPrefs.size() != 3) + { + WriteLog(debug, "ѡô"); + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ѡô", + RAYCUS_PLM_TO_SAP_Bom); + ifail = ITK_err; + goto end; + } + getPrefStrings(RAYCUS_CONFIG_BOM_FIELDS, TC_preference_site, fieldPrefs); + parseConfigs(fieldPrefs, son_configs,title_configs); + if (son_configs.size() == 0 && title_configs.size() == 0) + { + WriteLog(debug, "ѡô"); + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ѡô", + RAYCUS_CONFIG_BOM_FIELDS); + ifail = ITK_err; + goto end; + } + } + + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + for each (string type in types) + { + if (!isTypeOf(attachment, type.c_str())) + { + continue; + } + char* ifSend; + tag_t item = NULLTAG, * revisions; + int rev_count = 0; + //жֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪY·ֵΪNҰ汾Ϊ1ȡӿֶ + AOM_ask_value_string(attachment,"r9_ISTOSAP_MBOM1",&ifSend); + if (strstr(ifSend, "Y") != NULL) { + continue; + } + ITEM_ask_item_of_rev(attachment, &item); + ITEM_find_revisions(item, "*", &rev_count, &revisions); + printf("汾Ϊ:%d\n", rev_count); + printf("Ƿ·ֵΪ%s\n", ifSend); + if (strstr(ifSend, "Y") == NULL && rev_count == 1) { + ITEM_rev_list_bom_view_revs(attachments[i], &bvr_count, &bvr_list); + BOM_create_window(&bom_window_tag); + BOM_set_window_top_line_bvr(bom_window_tag, bvr_list[bvr_count - 1], &top_line); + char* cglx,*tscglx = NULL; + AOM_ask_value_string(attachment,"r9_CGLX",&cglx); + AOM_ask_value_string(attachment, "r9_TXCGLX", &tscglx); + printf("ɹ͵ֵΪ%s\n", cglx); + if (cglx != NULL && strstr(cglx,"F") != NULL && (tscglx == NULL || strlen(tscglx) == 0)) { + break; + } + printf("ʼõ\n"); + jsonStr.append("{\"esbInfo\":{\"requestTime\":\""); + //ȡǰʱ + sprintf_s(date, "%04d-%02d-%02d %02d:%02d:%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + jsonStr.append(date).append("\",\"instId\": \"\",\"attr2\": \"\",\"attr1\": \"\",\"attr3\":\"\"},\"requestInfo\": {\"ITEM\": ["); + tag_t* children_line = NULLTAG; + BOM_line_ask_all_child_lines(top_line, &count, &children_line); + printf("BOMΪ%d",count); + for (int ii = 0; ii < count; ii++) { + jsonStr.append("{"); + string son_value = read_data(children_line[ii], son_configs, top_line); + jsonStr.append(son_value); + //ɾposʼnַerase(0,1)ɾһַ + jsonStr.erase(jsonStr.size() - 1, 1); + jsonStr.append("},"); + } + printf("ʼtitle"); + jsonStr.erase(jsonStr.size() - 1, 1); + jsonStr.append("],"); + //̧ͷ + jsonStr.append("\"header\":[{"); + string title_value = read_data(top_line, title_configs,NULL); + jsonStr.append(title_value); + jsonStr.erase(jsonStr.size() - 1, 1); + jsonStr.append("}]}}@@"); + } + } + } + printf("λ%s", jsonStr.c_str()); + if (jsonStr.empty()) { + goto end; + } + //дļ + strcat(data_file, "C:\\PLM\\bomtoSapData"); + strcat(data_file, "\\"); + sprintf_s(fileDate, "%04d-%02d-%02d=%02d-%02d-%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + strcat(data_file, fileDate); + strcat(data_file, ".txt"); + + strcat(data_file_return, "C:\\PLM\\bomtoSapData"); + strcat(data_file_return, "\\"); + sprintf_s(fileDate, "%04d-%02d-%02d=%02d-%02d-%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + strcat(data_file_return, fileDate); + strcat(data_file_return, "return.txt"); + + strcat(data_file_error, "C:\\PLM\\bomtoSapData"); + strcat(data_file_error, "\\"); + strcat(data_file_error, fileDate); + strcat(data_file_error, "error.xlsx"); + + file.open(data_file); + file << jsonStr << endl; // ʹcoutͬķʽд + file.close(); + //-------------------------------------------- + strcat(toJar, "java -jar C:\\PLM\\bomtoSap.jar "); + strcat(toJar, data_file);//jsonļĵַ + strcat(toJar, " "); + strcat(toJar, urlPrefs[0].c_str());//ӿڵַ + strcat(toJar, " "); + strcat(toJar, urlPrefs[1].c_str());//http basic֤û + strcat(toJar, " "); + strcat(toJar, urlPrefs[2].c_str());//http basic֤ + + char buf[8000] = { 0 }; + FILE* pf = NULL; + if ((pf = _popen(toJar, "r")) == NULL) { + printf("ӿڷ:\n%s", "1"); + } + /* + 1.SAPֵΪɹʱ TCֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪY + 2. SAPֵΪʧʱ TCֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪNʧԭ롰ʧԭֶΣ*/ + char* return_data; + return_data = getfileall(data_file_return); + if (return_data == NULL) { + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + POM_AM__set_application_bypass(true); + AOM_lock(attachment); + AOM_set_value_string(attachment, "r9_ISTOSAP_MBOM1", "Y"); + AOM_save(attachment); + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + } + goto end; + } + Split(return_data, "@@", return_vector); + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + char* item_id; + AOM_ask_value_string(attachment, "item_id", &item_id); + for each (string type in types) + { + int istosap = 0; + if (!isTypeOf(attachment, type.c_str())) + { + continue; + } + for each (string id in return_vector) + { + if (strstr(id.c_str(),item_id) != NULL) { + //İ汾Ƿ·Ϊǡ + POM_AM__set_application_bypass(true); + //lock + AOM_lock(attachment); + //set + AOM_set_value_string(attachment, "r9_FailReason", id.c_str()); + AOM_set_value_string(attachment, "r9_ISTOSAP_MBOM1", "N"); + //save + AOM_save(attachment); + //unlock + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + istosap = 1; + break; + } + } + if (istosap == 0) { + POM_AM__set_application_bypass(true); + AOM_lock(attachment); + AOM_set_value_string(attachment, "r9_ISTOSAP_MBOM1", "Y"); + AOM_save(attachment); + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + } + } + DOFREE(item_id); + } + + //data_file_error +end: + DOFREE(attachments); + types.clear(); + WriteLog(debug, "ִнBOMSAP (PLM_MBOM_TO_SAP_NEW)..."); + return ifail; +} + +int PLM_MBOM_TO_SAP_Revise(EPM_action_message_t msg) { + int ifail = ITK_ok,arg_cnt = 0,att_cnt = 0; + char* arg = NULL,* argflag = NULL,* argvalue = NULL, * object_type = NULL, toJar[1000] = ""; + string type,jsonStr; + vector types, urlPrefs, fieldPrefs, checkBomPorps; + vector son_configs, title_configs; vector return_vector; + tag_t* attachments = NULLTAG, task_tag = NULLTAG, rootTask_tag = NULLTAG, + relation_type2 = NULLTAG, relation_type1 = NULLTAG,relation_type3 = NULLTAG; + time_t now = time(0); + tm* p = localtime(&now); + char date[128] = "", fileDate[128] = ""; + char data_file[SS_MAXPATHLEN] = "", data_file_return[SS_MAXPATHLEN] = ""; + ofstream file; + + WriteLog(debug, "ʼִУBOMSAP޸ (PLM_MBOM_TO_SAP_Revise) ...\n"); + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "type") == 0) { + type.assign(argvalue); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + else { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲"); + ifail = 1; + goto end; + } + { + Split(type, ",", types); + if (types.size() == 0) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-type"); + goto end; + } + } + + //õǰڵ + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + ITKCALL(ifail = EPM_ask_root_task(task_tag, &rootTask_tag)); + //ȡĿж + ITKCALL(ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt == 0) { + goto end; + } + //ѡ + { + getPrefStrings(RAYCUS_PLM_TO_SAP_Bom_REVISE, TC_preference_site, urlPrefs); + if (urlPrefs.size() != 3) + { + WriteLog(debug, "ѡô"); + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ѡô", + RAYCUS_PLM_TO_SAP_Bom_REVISE); + ifail = ITK_err; + goto end; + } + getPrefStrings(RAYCUS_CONFIG_BOM_FIELDS_REVISE, TC_preference_site, fieldPrefs); + parseConfigs(fieldPrefs, son_configs, title_configs); + if (son_configs.size() == 0 || title_configs.size() == 0) + { + WriteLog(debug, "ѡô"); + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ѡô", + RAYCUS_CONFIG_BOM_FIELDS_REVISE); + ifail = ITK_err; + goto end; + } + getPrefStrings(RAYCUS_MBOM_Check_BOMLINE, TC_preference_site, checkBomPorps); + if (checkBomPorps.size() < 1) { + WriteLog(debug, "ѡô"); + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ѡô", + RAYCUS_MBOM_Check_BOMLINE); + ifail = ITK_err; + goto end; + } + } + + //Ѱҹϵ + ITKCALL(ifail = GRM_find_relation_type("R9_ProblemItem", &relation_type1)); + if (relation_type1 == NULLTAG) { + WriteLog(debug, "δҹϵR9_ProblemItem"); + EMH_store_error_s1(EMH_severity_error, ITK_err, "δҹϵR9_ProblemItem"); + goto end; + } + ITKCALL(ifail = GRM_find_relation_type("R9_ProblemSolutionItem", &relation_type2)); + if (relation_type2 == NULLTAG) { + WriteLog(debug, "δҹϵR9_ProblemSolutionItem"); + EMH_store_error_s1(EMH_severity_error, ITK_err, "δҹϵR9_ProblemSolutionItem"); + goto end; + } + ITKCALL(ifail = GRM_find_relation_type("IMAN_reference", &relation_type3)); + if (relation_type3 == NULLTAG) { + WriteLog(debug, "δҹϵIMAN_reference"); + EMH_store_error_s1(EMH_severity_error, ITK_err, "δҹϵIMAN_reference"); + goto end; + } + + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i], *relation1_tag,*relation2_tag; + int relation_type1_count = 0, relation_type2_count = 0; + char* item_id1, * item_id2, * item_rev1, * item_rev2,*item_type1,* item_type2; + vector itemRevs2; vector itemRevs1; vector revs; + //жǷΪR9_ECNRevision + if (isTypeOf(attachment, "R9_ECNRevision")) { + GRM_list_secondary_objects_only(attachment, relation_type1, &relation_type1_count, &relation1_tag); + GRM_list_secondary_objects_only(attachment, relation_type2, &relation_type2_count, &relation2_tag); + //ͽļǷϺͬ汾ͬBOMݰ汾(ϵ·ŵǶ汾) + for (int m = 0; m < relation_type1_count;m++) { + AOM_ask_value_string(relation1_tag[m],"item_id", &item_id1); + AOM_ask_value_string(relation1_tag[m], "item_revision_id", &item_rev1); + AOM_ask_value_string(relation1_tag[m], "object_type", &item_type1); + for (int n = 0; n < relation_type2_count; n++) { + AOM_ask_value_string(relation2_tag[n], "item_id", &item_id2); + AOM_ask_value_string(relation2_tag[n], "item_revision_id", &item_rev2); + AOM_ask_value_string(relation2_tag[n], "object_type", &item_type2); + if (strcmp(item_id1, item_id2) == 0 && strcmp(item_rev1, item_rev2) != 0 && strcmp(item_type1, item_type2) == 0) { + //idͬ汾ͬͬ¼°汾 + itemRevs2.push_back(relation2_tag[n]); + itemRevs1.push_back(relation1_tag[m]); + BomlineType rev; + rev.rev_tag = relation2_tag[n]; + rev.id = item_id2; + revs.push_back(rev); + } + } + } + //ԱBOMIJ + for (int i = 0; i < itemRevs1.size(); i++) { + tag_t rev1 = itemRevs1[i]; + tag_t rev2 = itemRevs2[i]; + for each (string type in types) + { + if (isTypeOf(rev2, type.c_str()) && isTypeOf(rev1, type.c_str())) + { + /*жBOM㼶ǷѾݹSAPֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪtrue· + ֵΪfalseҰ汾2ȡӿֶԣJSONʽݸSAP*/ + char* ifSend; + tag_t item, * revisions; + int rev_count = 0; + AOM_ask_value_string(rev2, "r9_ISTOSAP_MBOM1", &ifSend); + ITEM_ask_item_of_rev(rev2, &item); + ITEM_find_revisions(item, "*", &rev_count, &revisions); + if (strstr(ifSend, "Y") == NULL && rev_count > 1) { + int relation_type3_count = 0,snapshot_count = 0; + tag_t *relation3_tag = NULLTAG,*snapshot_tags = NULLTAG; + vector lines1; + //vector lines1_compare; + vector lines2; + vector sendDatas; + vector waitCompare; + getBomProp(rev1, lines1); + tag_t top_line = getBomProp(rev2, lines2); + char* cglx = NULL, * tscglx = NULL; + AOM_ask_value_string(attachment, "r9_CGLX", &cglx); + AOM_ask_value_string(attachment, "r9_TXCGLX", &tscglx); + printf("ɹ͵ֵΪ%s\n", cglx); + if (cglx != NULL && strstr(cglx, "F") != NULL && (tscglx == NULL || strlen(tscglx) == 0)) { + break; + } + GRM_list_secondary_objects_only(rev1, relation_type3, &relation_type3_count, &relation3_tag); + for (int j = 0; j < relation_type3_count; j++) + { + char* object_name; + AOM_ask_value_string(relation3_tag[j], "object_name", &object_name); + if (strcmp("MySnapshot",object_name) == 0) { + AOM_ask_value_tags(relation3_tag[j], "contents", &snapshot_count, &snapshot_tags); + break; + } + } + //for each (BomlineType line in lines1_compare) + //{ + // map maps; + // for (int j = 0; j < snapshot_count; j++) + // { + // char *item_id = NULL,*rev_id = NULL; + // AOM_ask_value_string(snapshot_tags[j], "item_id", &item_id); + // AOM_ask_value_string(snapshot_tags[j], "item_revision_id", &rev_id); + // maps.insert(pair(item_id, rev_id)); + // } + // map::iterator it = maps.find(line.id); + // if (it != maps.end()) { + // //line.revision_id = it->second; + // line.revision_id.assign(it->second); + // printf("汾Ϊ%s\n", line.revision_id.c_str()); + // lines1.push_back(line); + // } + //} + for (int h = 0; h < lines1.size(); h++) + { + map maps; + for (int j = 0; j < snapshot_count; j++) + { + char *item_id = NULL,*rev_id = NULL; + AOM_ask_value_string(snapshot_tags[j], "item_id", &item_id); + AOM_ask_value_string(snapshot_tags[j], "item_revision_id", &rev_id); + maps.insert(pair(item_id, rev_id)); + } + map::iterator it = maps.find(lines1[h].id); + if (it != maps.end()) { + //line.revision_id = it->second; + lines1[h].revision_id = it->second; + } + } + //Ƚɾ + for each (BomlineType line1 in lines1) + { + int count = 0; + for each (BomlineType line2 in lines2) + { + if (strcmp(line1.id.c_str(),line2.id.c_str()) == 0 + //&& strcmp(line1.revision_id.c_str(), line2.revision_id.c_str()) == 0 + && strcmp(line1.sequence.c_str(), line2.sequence.c_str()) == 0) { + break; + } + else { + count++; + } + } + if (count == lines2.size()) { + //ɾ + line1.flag = "D"; + sendDatas.push_back(line1); + } + } + //Ƚ޸ + for each (BomlineType line2 in lines2) + { + int count = 0; + for each (BomlineType line1 in lines1) + { + if (strcmp(line1.id.c_str(), line2.id.c_str()) == 0 + && strcmp(line1.sequence.c_str(), line2.sequence.c_str()) == 0) { + printf("IDͬݣ%s\n", line2.id.c_str()); + printf("汾Ϊ%s---%s\n", line1.revision_id.c_str(), line2.revision_id.c_str()); + if (strcmp(line1.revision_id.c_str(), line2.revision_id.c_str()) == 0) { + //ȽԵ + waitCompare.push_back(line2); + break; + } + else { + printf("Ǹı汾ݣ%s\n", line2.id.c_str()); + //޸ĵ + line2.flag = "U"; + sendDatas.push_back(line2); + break; + } + } + else { + count++; + } + } + if (count == lines1.size()) { + // + line2.flag = "A"; + sendDatas.push_back(line2); + } + } + //ȽBOM + for each (BomlineType com in waitCompare) + { + for each (BomlineType line1 in lines1) + { + if (strcmp(line1.id.c_str(), com.id.c_str()) == 0 + && strcmp(line1.revision_id.c_str(), com.revision_id.c_str()) == 0 + && strcmp(line1.sequence.c_str(), com.sequence.c_str()) == 0) { + boolean compare = compareProps(line1, com, checkBomPorps); + if (compare) { + com.flag = "U"; + sendDatas.push_back(com); + } + break; + } + } + } + //תjson + jsonStr.append("{\"esbInfo\":{\"requestTime\":\""); + //ȡǰʱ + sprintf_s(date, "%04d-%02d-%02d %02d:%02d:%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + jsonStr.append(date).append("\",\"instId\": \"\",\"attr2\": \"\",\"attr1\": \"\",\"attr3\":\"\"},\"requestInfo\": {\"ITEM\": ["); + for each (BomlineType send in sendDatas) + { + jsonStr.append("{"); + string son_value = read_data(send.bom_tag, son_configs, top_line); + jsonStr.append(son_value); + //ɾposʼnַerase(0,1)ɾһַ + jsonStr.append("\"i_flag\": \""); + jsonStr.append(send.flag); + jsonStr.append("\"},"); + //jsonStr.erase(jsonStr.size() - 1, 1); + //jsonStr.append("},"); + } + jsonStr.erase(jsonStr.size() - 1, 1); + jsonStr.append("],"); + //̧ͷ + jsonStr.append("\"header\":[{"); + string title_value = read_data(top_line, title_configs,NULL); + jsonStr.append(title_value); + jsonStr.erase(jsonStr.size() - 1, 1); + jsonStr.append("}]}}@@"); + } + } + } + } + } + } + if (jsonStr.empty()) { + goto end; + } + //дļ + strcat(data_file, "C:\\PLM\\bomtoSapData"); + strcat(data_file, "\\"); + sprintf_s(fileDate, "%04d-%02d-%02d=%02d-%02d-%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + strcat(data_file, fileDate); + strcat(data_file, ".txt"); + + strcat(data_file_return, "C:\\PLM\\bomtoSapData"); + strcat(data_file_return, "\\"); + sprintf_s(fileDate, "%04d-%02d-%02d=%02d-%02d-%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + strcat(data_file_return, fileDate); + strcat(data_file_return, "return.txt"); + + file.open(data_file); + file << jsonStr << endl; // ʹcoutͬķʽд + file.close(); + //-------------------------------------------- + strcat(toJar, "java -jar C:\\PLM\\bomtoSap.jar "); + strcat(toJar, data_file);//jsonļĵַ + strcat(toJar, " "); + strcat(toJar, urlPrefs[0].c_str());//ӿڵַ + strcat(toJar, " "); + strcat(toJar, urlPrefs[1].c_str());//http basic֤û + strcat(toJar, " "); + strcat(toJar, urlPrefs[2].c_str());//http basic֤ + + char buf[8000] = { 0 }; + FILE* pf = NULL; + if ((pf = _popen(toJar, "r")) == NULL) { + printf("ӿڷ:\n%s", "1"); + } + //ݣ־ŵǰûnewstuff + /* + 1.SAPֵΪɹʱ TCֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪY + 2. SAPֵΪʧʱ TCֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪNʧԭ롰ʧԭֶΣ*/ + char* return_data; + return_data = getfileall(data_file_return); + if (return_data == NULL) { + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + POM_AM__set_application_bypass(true); + AOM_lock(attachment); + AOM_set_value_string(attachment, "r9_ISTOSAP_MBOM1", "Y"); + AOM_save(attachment); + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + } + goto end; + } + Split(return_data, "@@", return_vector); + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + char* item_id; + AOM_ask_value_string(attachment, "item_id", &item_id); + for each (string type in types) + { + int istosap = 0; + if (!isTypeOf(attachment, type.c_str())) + { + continue; + } + for each (string id in return_vector) + { + if (strstr(id.c_str(), item_id) != NULL) { + //İ汾Ƿ·Ϊǡ + POM_AM__set_application_bypass(true); + //lock + AOM_lock(attachment); + //set + AOM_set_value_string(attachment, "r9_FailReason", id.c_str()); + AOM_set_value_string(attachment, "r9_ISTOSAP_MBOM1", "N"); + //save + AOM_save(attachment); + //unlock + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + istosap = 1; + break; + } + } + if (istosap == 0) { + POM_AM__set_application_bypass(true); + AOM_lock(attachment); + AOM_set_value_string(attachment, "r9_ISTOSAP_MBOM1", "Y"); + AOM_save(attachment); + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + } + } + DOFREE(item_id); + } + +end: + DOFREE(attachments); + DOFREE(object_type); + types.clear(); + WriteLog(debug, "ִнBOMSAP޸ (PLM_MBOM_TO_SAP_Revise)..."); + return ifail; +} + +int PLM_FBMBOM_TO_SAP(EPM_action_message_t msg) { + int ifail = ITK_ok, arg_cnt = 0, att_cnt = 0, bvr_count = 0, count = 0; + char* arg = NULL, * argflag = NULL, * argvalue = NULL, toJar[1000] = ""; + tag_t* attachments = NULLTAG, task_tag = NULLTAG, rootTask_tag, * bvr_list = NULLTAG, bom_window_tag, top_line; + string type, jsonStr; + vector types, urlPrefs, fieldPrefs, return_vector; + vector son_configs, title_configs; + + time_t now = time(0); + tm* p = localtime(&now); + char date[128] = "", fileDate[128] = ""; + char* tc_root_file = getenv("tc_root"); //C:\Siemens\Teamcenter11 + char data_file[SS_MAXPATHLEN] = "", data_file_return[SS_MAXPATHLEN] = ""; + ofstream file; + + WriteLog(debug, "ʼִУBOMSAP (PLM_FBMBOM_TO_SAP) ..."); + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "type") == 0) { + type.assign(argvalue); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + else { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲"); + ifail = 1; + goto end; + } + { + Split(type, ",", types); + if (types.size() == 0) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-type"); + goto end; + } + } + //õǰڵ + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + ITKCALL(ifail = EPM_ask_root_task(task_tag, &rootTask_tag)); + //ȡĿж + ITKCALL(ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt == 0) { + goto end; + } + + //ѡ + { + getPrefStrings(RAYCUS_PLM_TO_SAP_FBBom, TC_preference_site, urlPrefs); + if (urlPrefs.size() != 3) + { + WriteLog(debug, "ѡô"); + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ѡô", + RAYCUS_PLM_TO_SAP_FBBom); + ifail = ITK_err; + goto end; + } + getPrefStrings(RAYCUS_CONFIG_FBBOM_FIELDS, TC_preference_site, fieldPrefs); + parseConfigs(fieldPrefs, son_configs, title_configs); + if (son_configs.size() == 0 || title_configs.size() == 0) + { + WriteLog(debug, "ѡô"); + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ѡô", + RAYCUS_CONFIG_FBBOM_FIELDS); + ifail = ITK_err; + goto end; + } + } + + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + for each (string type in types) + { + if (!isTypeOf(attachment, type.c_str())) + { + continue; + } + char* ifSend; + tag_t item = NULLTAG, * revisions; + int rev_count = 0; + //жֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪY·ֵΪNҰ汾Ϊ1ȡӿֶ + AOM_ask_value_string(attachment, "r9_ISTOSAP_MBOM1", &ifSend); + if (strstr(ifSend, "Y") != NULL) { + continue; + } + char* cglx, * tscglx = NULL; + AOM_ask_value_string(attachment, "r9_CGLX", &cglx); + AOM_ask_value_string(attachment, "r9_TXCGLX", &tscglx); + printf("ɹ͵ֵΪ%s\n", cglx); + if (cglx != NULL && strstr(cglx, "F") != NULL && (tscglx == NULL || strlen(tscglx) == 0)) { + break; + } + ITEM_rev_list_bom_view_revs(attachments[i], &bvr_count, &bvr_list); + BOM_create_window(&bom_window_tag); + BOM_set_window_top_line_bvr(bom_window_tag, bvr_list[bvr_count - 1], &top_line); + + jsonStr.append("{\"esbInfo\":{\"requestTime\":\""); + //ȡǰʱ + sprintf_s(date, "%04d-%02d-%02d %02d:%02d:%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + jsonStr.append(date).append("\",\"instId\": \"\",\"attr2\": \"\",\"attr1\": \"\",\"attr3\":\"\"},\"requestInfo\": {\"ITEM\": ["); + tag_t* children_line = NULLTAG; + BOM_line_ask_all_child_lines(top_line, &count, &children_line); + for (int ii = 0; ii < count; ii++) { + jsonStr.append("{"); + string son_value = read_data(children_line[ii], son_configs, top_line); + jsonStr.append(son_value); + //ɾposʼnַerase(0,1)ɾһַ + jsonStr.erase(jsonStr.size() - 1, 1); + jsonStr.append("},"); + } + jsonStr.erase(jsonStr.size() - 1, 1); + jsonStr.append("],"); + //̧ͷ + string title_value = read_data(top_line, title_configs, NULL); + jsonStr.append(title_value); + jsonStr.erase(jsonStr.size() - 1, 1); + jsonStr.append("}}@@"); + + } + } + if (jsonStr.empty()) { + goto end; + } + //дļ + strcat(data_file, "C:\\PLM\\bomtoSapData"); + strcat(data_file, "\\"); + sprintf_s(fileDate, "%04d-%02d-%02d=%02d-%02d-%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + strcat(data_file, fileDate); + strcat(data_file, ".txt"); + + strcat(data_file_return, "C:\\PLM\\bomtoSapData"); + strcat(data_file_return, "\\"); + sprintf_s(fileDate, "%04d-%02d-%02d=%02d-%02d-%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + strcat(data_file_return, fileDate); + strcat(data_file_return, "return.txt"); + + file.open(data_file); + file << jsonStr << endl; // ʹcoutͬķʽд + file.close(); + //-------------------------------------------- + strcat(toJar, "java -jar C:\\PLM\\bomtoSap.jar "); + strcat(toJar, data_file);//jsonļĵַ + strcat(toJar, " "); + strcat(toJar, urlPrefs[0].c_str());//ӿڵַ + strcat(toJar, " "); + strcat(toJar, urlPrefs[1].c_str());//http basic֤û + strcat(toJar, " "); + strcat(toJar, urlPrefs[2].c_str());//http basic֤ + + char buf[8000] = { 0 }; + FILE* pf = NULL; + if ((pf = _popen(toJar, "r")) == NULL) { + printf("ӿڷ:\n%s", "1"); + } + /* + 1.SAPֵΪɹʱ TCֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪY + 2. SAPֵΪʧʱ TCֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪNʧԭ롰ʧԭֶΣ*/ + char* return_data; + return_data = getfileall(data_file_return); + if (return_data == NULL) { + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + POM_AM__set_application_bypass(true); + AOM_lock(attachment); + AOM_set_value_string(attachment, "r9_ISTOSAP_MBOM", "Y"); + AOM_save(attachment); + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + } + goto end; + } + Split(return_data, "@@", return_vector); + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + char* item_id; + AOM_ask_value_string(attachment, "item_id", &item_id); + for each (string type in types) + { + int istosap = 0; + if (!isTypeOf(attachment, type.c_str())) + { + continue; + } + for each (string id in return_vector) + { + if (strstr(id.c_str(), item_id) != NULL) { + //İ汾Ƿ·Ϊǡ + POM_AM__set_application_bypass(true); + //lock + AOM_lock(attachment); + //set + AOM_set_value_string(attachment, "r9_FailReason", id.c_str()); + AOM_set_value_string(attachment, "r9_ISTOSAP_MBOM", "N"); + //save + AOM_save(attachment); + //unlock + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + istosap = 1; + break; + } + } + if (istosap == 0) { + POM_AM__set_application_bypass(true); + AOM_lock(attachment); + AOM_set_value_string(attachment, "r9_ISTOSAP_MBOM", "Y"); + AOM_save(attachment); + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + } + } + DOFREE(item_id); + } + +end: + DOFREE(attachments); + types.clear(); + WriteLog(debug, "ִнBOMSAP (PLM_FBMBOM_TO_SAP)..."); + return ifail; +} + +int PLM_BZGX_TO_SAP(EPM_action_message_t msg) { + int ifail = ITK_ok, arg_cnt = 0, att_cnt = 0, bvr_count = 0, count = 0; + char* arg = NULL, * argflag = NULL, * argvalue = NULL, toJar[1000] = ""; + tag_t* attachments = NULLTAG, task_tag = NULLTAG, rootTask_tag, * bvr_list = NULLTAG, bom_window_tag, top_line = NULLTAG; + string type, jsonStr; + vector types, urlPrefs, fieldPrefs, return_vector; + vector son_configs, title_configs; + + time_t now = time(0); + tm* p = localtime(&now); + char date[128] = "", fileDate[128] = ""; + char* tc_root_file = getenv("tc_root"); //C:\Siemens\Teamcenter11 + char data_file[SS_MAXPATHLEN] = "", data_file_return[SS_MAXPATHLEN] = ""; + ofstream file; + + WriteLog(debug, "ʼִУݱ׼SAP (PLM_BZGX_TO_SAP) ..."); + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "type") == 0) { + type.assign(argvalue); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + else { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲"); + ifail = 1; + goto end; + } + { + Split(type, ",", types); + if (types.size() == 0) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-type"); + goto end; + } + } + //õǰڵ + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + ITKCALL(ifail = EPM_ask_root_task(task_tag, &rootTask_tag)); + //ȡĿж + ITKCALL(ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt == 0) { + goto end; + } + + //ѡ + { + getPrefStrings(RAYCUS_PLM_TO_SAP_BZGX, TC_preference_site, urlPrefs); + if (urlPrefs.size() != 3) + { + WriteLog(debug, "ѡô"); + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ѡô", + RAYCUS_PLM_TO_SAP_BZGX); + ifail = ITK_err; + goto end; + } + getPrefStrings(RAYCUS_CONFIG_BZGX_FIELDS, TC_preference_site, fieldPrefs); + parseConfigs(fieldPrefs, son_configs, title_configs); + if (son_configs.size() == 0 && title_configs.size() == 0) + { + WriteLog(debug, "ѡô"); + EMH_store_error_s2(EMH_severity_error, + ITK_err, + "ѡô", + RAYCUS_CONFIG_BZGX_FIELDS); + ifail = ITK_err; + goto end; + } + } + + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + for each (string type in types) + { + if (!isTypeOf(attachment, type.c_str())) + { + continue; + } + char* ifSend; + tag_t item = NULLTAG, * revisions; + int rev_count = 0; + AOM_ask_value_string(attachment, "r9_ISTOSAP_BZGX", &ifSend); + if (strstr(ifSend, "Y") != NULL) { + continue; + } + ITEM_ask_item_of_rev(attachment, &item); + ITEM_find_revisions(item, "*", &rev_count, &revisions); + printf("汾Ϊ:%d\n", rev_count); + if (strstr(ifSend, "Y") == NULL && rev_count == 1) { + jsonStr.append("{\"esbInfo\":{\"requestTime\":\""); + //ȡǰʱ + sprintf_s(date, "%04d-%02d-%02d %02d:%02d:%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + jsonStr.append(date).append("\",\"instId\": \"\",\"attr2\": \"\",\"attr1\": \"\",\"attr3\":\"\"},\"requestInfo\": {"); + //̧ͷ + for (int i = 0; i < title_configs.size(); i++) + { + tag_t data_tag = NULLTAG; + char *prop_value; + Config config = title_configs[i]; + jsonStr.append("\"").append(config.send_name).append("\":\""); + if (strcmp(config.prop_type.c_str(), "item") == 0) { + data_tag = item; + } + else if (strcmp(config.prop_type.c_str(), "rev") == 0) { + data_tag = attachment; + } + ITKCALL(ifail = AOM_ask_value_string(data_tag, config.prop_name.c_str(), &prop_value)); + jsonStr.append(prop_value); + jsonStr.append("\","); + } + jsonStr.erase(jsonStr.size() - 1, 1); + jsonStr.append("}}@@"); + } + } + } + if (jsonStr.empty()) { + goto end; + } + //дļ + strcat(data_file, "C:\\PLM\\bomtoSapData"); + strcat(data_file, "\\"); + sprintf_s(fileDate, "%04d-%02d-%02d=%02d-%02d-%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + strcat(data_file, fileDate); + strcat(data_file, ".txt"); + + strcat(data_file_return, "C:\\PLM\\bomtoSapData"); + strcat(data_file_return, "\\"); + sprintf_s(fileDate, "%04d-%02d-%02d=%02d-%02d-%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + strcat(data_file_return, fileDate); + strcat(data_file_return, "return.txt"); + + file.open(data_file); + file << jsonStr << endl; // ʹcoutͬķʽд + file.close(); + //-------------------------------------------- + strcat(toJar, "java -jar C:\\PLM\\bomtoSap.jar "); + strcat(toJar, data_file);//jsonļĵַ + strcat(toJar, " "); + strcat(toJar, urlPrefs[0].c_str());//ӿڵַ + strcat(toJar, " "); + strcat(toJar, urlPrefs[1].c_str());//http basic֤û + strcat(toJar, " "); + strcat(toJar, urlPrefs[2].c_str());//http basic֤ + strcat(toJar, " ׼"); + + char buf[8000] = { 0 }; + FILE* pf = NULL; + if ((pf = _popen(toJar, "r")) == NULL) { + printf("ӿڷ:\n%s", "1"); + } + /* + 1.SAPֵΪɹʱ TCֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪY + 2. SAPֵΪʧʱ TCֶΡMBOMѴ(r9_ISTOSAP_MBOM)ֵΪNʧԭ롰ʧԭֶΣ*/ + char* return_data; + return_data = getfileall(data_file_return); + if (return_data == NULL) { + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + POM_AM__set_application_bypass(true); + AOM_lock(attachment); + AOM_set_value_string(attachment, "r9_ISTOSAP_BZGX", "Y"); + AOM_save(attachment); + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + } + goto end; + } + Split(return_data, "@@", return_vector); + for (int i = 0; i < att_cnt; i++) + { + tag_t attachment = attachments[i]; + char* item_id; + AOM_ask_value_string(attachment, "item_id", &item_id); + for each (string type in types) + { + int istosap = 0; + if (!isTypeOf(attachment, type.c_str())) + { + continue; + } + for each (string id in return_vector) + { + if (strstr(id.c_str(), item_id) != NULL) { + //İ汾Ƿ·Ϊǡ + POM_AM__set_application_bypass(true); + //lock + AOM_lock(attachment); + //set + AOM_set_value_string(attachment, "r9_FailReason", id.c_str()); + AOM_set_value_string(attachment, "r9_ISTOSAP_BZGX", "N"); + //save + AOM_save(attachment); + //unlock + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + istosap = 1; + break; + } + } + if (istosap == 0) { + POM_AM__set_application_bypass(true); + AOM_lock(attachment); + AOM_set_value_string(attachment, "r9_ISTOSAP_BZGX", "Y"); + AOM_save(attachment); + AOM_unlock(attachment); + AOM_refresh(attachment, FALSE); + POM_AM__set_application_bypass(false); + } + } + DOFREE(item_id); + } + +end: + DOFREE(attachments); + types.clear(); + WriteLog(debug, "ִнݱ׼SAP (PLM_BZGX_TO_SAP)..."); + return ifail; +} + +boolean compareProps(BomlineType lines1, BomlineType lines2, vector checkBomPorps) { + for each (string var in checkBomPorps) + { + char* value1 = NULL,*value2 = NULL; + AOM_ask_value_string(lines1.bom_tag,var.c_str(),&value1); + AOM_ask_value_string(lines2.bom_tag, var.c_str(), &value2); + if (strcmp(value1,value2) != 0) { + return true; + } + } + return false; +} + +tag_t getBomProp(tag_t rev,vector& lines) { + int viewNum = 0; + tag_t* viewTag = NULL_TAG, rev_tag = NULLTAG; + BomlineType son_line; + char* item_id = NULL, *bl_sequence = NULL,*item_revision_id = NULL; + + //жǷBOMͼ + AOM_ask_value_tags(rev, "structure_revisions", &viewNum, &viewTag); + if (viewNum <= 0) + { + DOFREE(viewTag); + } + //BOMWindow + tag_t top_line = NULLTAG, window = NULLTAG; + BOM_create_window(&window); + //öBOM + BOM_set_window_top_line(window, NULLTAG, rev, NULLTAG, &top_line); + int count; + tag_t* children_line = NULLTAG; + BOM_line_ask_all_child_lines(top_line, &count, &children_line); + for (int i = 0; i < count; i++) + { + AOM_ask_value_tag(children_line[i], "bl_line_object", &rev_tag); + AOM_ask_value_string(children_line[i], "bl_item_item_id", &item_id); + AOM_ask_value_string(children_line[i], "bl_sequence_no", &bl_sequence); + AOM_ask_value_string(rev_tag, "item_revision_id", &item_revision_id); + son_line.rev_tag = rev_tag; + son_line.id = item_id; + son_line.sequence = bl_sequence; + son_line.revision_id = item_revision_id; + son_line.bom_tag = children_line[i]; + lines.push_back(son_line); + } + return top_line; +} + +int parseConfigs(vector pref_values, vector& son_configs, vector& title_configs) +{ + for (int i = 0; i < pref_values.size(); i++) + { + string prop_config; + vector prop_configs; + vector defaults; + string send_name; + string type; + string title; + string prop_type; + string prop_name; + string default; + prop_config.assign(pref_values[i]); + int ind = prop_config.find_first_of(';'); + //Ĭֵʱ + if (ind != string::npos) + { + Split(prop_config.substr(0, ind), "=", prop_configs); + Split(prop_config.substr(ind + 1), "=", defaults); + if (defaults.size() != 2) + { + WriteLog(debug, "ѡ%s", pref_values[i].c_str()); + continue; + } + default = defaults[1]; + + } + //ûĬֵʱ + else + { + Split(prop_config, "=", prop_configs); + } + if (prop_configs.size() != 5 && prop_configs.size() != 3) { + WriteLog(debug, "ѡ%s", pref_values[i].c_str()); + continue; + } + send_name = prop_configs[0]; + type = prop_configs[1]; + title = prop_configs[2]; + if (prop_configs.size() == 5) { + prop_type = prop_configs[3]; + prop_name = prop_configs[4]; + } + Config config; + config.send_name = send_name; + config.type = type; + config.title = title; + config.prop_name = prop_name; + config.prop_type = prop_type; + config.default = default; + if (strcmp(title.c_str(), "son") == 0) + { + son_configs.push_back(config); + } + else if (strcmp(title.c_str(), "title") == 0) { + title_configs.push_back(config); + } + else { + WriteLog(debug, "ѡ%s", pref_values[i].c_str()); + continue; + } + } + return ITK_ok; +} + +string read_data(tag_t bomline_tag, vector configs, tag_t parentline_tag ) +{ + int ifail = ITK_ok; + tag_t owning_user = NULLTAG, rev_tag, item_tag, data_tag = NULLTAG; + char* object_string = NULL, * creation_date = NULL, * prop_value = NULL, ** values = NULL, * localization_statuses; + int int_value; + double double_value; + logical master; + string jsonStr; + for (int i = 0; i < configs.size(); i++) + { + Config config = configs[i]; + string value; + int num = 0; + jsonStr.append("\"").append(config.send_name).append("\":\""); + if (strcmp(config.default.c_str(), "") != 0) + { + if (strcmp(config.default.c_str(), "") != 0) { + jsonStr.append(config.default); + } + } + else + { + AOM_ask_value_tag(bomline_tag, "bl_line_object", &rev_tag); + ITEM_ask_item_of_rev(rev_tag, &item_tag); + if (strcmp(config.prop_type.c_str(), "item") == 0) { + data_tag = item_tag; + } + else if (strcmp(config.prop_type.c_str(), "rev") == 0) { + data_tag = rev_tag; + } + else if (strcmp(config.prop_type.c_str(), "bom") == 0) { + data_tag = bomline_tag; + } + printf("ҪֶΪ%s\n", config.send_name.c_str()); + if (strcmp(config.type.c_str(), "string") == 0) + { + if (strcmp(config.send_name.c_str(), "menge") == 0 && parentline_tag != NULL) { + float two = 1; char* quantity, strff[21]; + AOM_ask_value_string(bomline_tag, "bl_quantity", &quantity); + if (quantity != NULL && strlen(quantity) != 0) { + two = atof(quantity); + } + tag_t parRev_tag; + AOM_ask_value_tag(parentline_tag, "bl_line_object", &parRev_tag); + ITKCALL(ifail = AOM_ask_value_int(parRev_tag, "r9_bmeng", &int_value)); + if (int_value == 0) { + sprintf(strff, "%.2f", two); + value.append(strff); + } + else { + float sum; + //float one = atof(prop_value); + float one = (float)int_value; + sum = one * two; + sprintf(strff, "%.2f", sum); + value.append(strff); + } + } + else { + ITKCALL(ifail = AOM_ask_value_string(data_tag, config.prop_name.c_str(), &prop_value)); + if (strcmp("ÿ", prop_value) == 0 && strcmp("bl_item_uom_tag", config.prop_name.c_str()) == 0) { + value.append("PC"); + } + else if (strcmp("stlal", config.send_name.c_str()) == 0) { + int center; + center = atoi(prop_value); + if (center > 0 && center < 10) { + value.append("0"); + } + value.append(prop_value); + } + else if (strcmp("bl_sequence_no", config.prop_name.c_str()) == 0) { + int center; + center = atoi(prop_value); + if (center > 9 && center < 100) { + value.append("00"); + } + else if (center > 99 && center < 1000) { + value.append("0"); + } + value.append(prop_value); + } + else{ + value.append(prop_value); + } + + } + } + else if (strcmp(config.type.c_str(), "lov") == 0) + { + ITKCALL(ifail = AOM_UIF_ask_localized_value_strings(data_tag, config.prop_name.c_str(), "zh_CN", &num, &values, &localization_statuses, &master)); + WriteLog(debug, "ʱlovʾֵ%s", values[0]); + value.append(values[0]); + } + else if (strcmp(config.type.c_str(), "int") == 0) { + printf("Ϊ%s==Ϊ%s\n",config.prop_type.c_str(), config.prop_name.c_str()); + int center; + ITKCALL(ifail = AOM_ask_value_int(data_tag, config.prop_name.c_str(), ¢er)); + char strDst[256] = { 0 }; + _itoa(center, strDst, 10); + value.append(strDst); + } + else if (strcmp(config.type.c_str(), "double") == 0) { + ITKCALL(ifail = AOM_ask_value_double(data_tag, config.prop_name.c_str(), &double_value)); + char dstr[20]; + sprintf(dstr, "%.2lf", double_value);//d 2λСֵdstr + value.append(dstr); + } + jsonStr.append(value); + } + jsonStr.append("\","); + } + return jsonStr; +} + diff --git a/connor_signature/Send_Sap_material.cpp.cpp b/connor_signature/Send_Sap_material.cpp.cpp new file mode 100644 index 0000000..dc39244 --- /dev/null +++ b/connor_signature/Send_Sap_material.cpp.cpp @@ -0,0 +1,482 @@ + +#include"kutil.h" +#include + + +int PLM_TO_SAP_NEW(EPM_action_message_t msg) { + int ifail = ITK_ok; + int attachments_num = 0; + int valueNum = 0; + tag_t rootTask = NULLTAG; + tag_t* attachments = NULLTAG; + char* object_type; + char* tc_root_file = getenv("tc_root"); //C:\Siemens\Teamcenter12 + char* parameters = (char*)malloc(1000000 * sizeof(char)); //ŷ͵SAP + memset(parameters, 0, sizeof(char)); + char** server_address; + char* item_rev_value = NULL; + + //ȡ + EPM_ask_root_task(msg.task, &rootTask); + //ȡĿ + EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments); + + + for (int i = 0; i < attachments_num; i++) + { + //ȡtopline + ITKCALL(AOM_ask_value_string(attachments[i], "object_type", &object_type)); + printf("object_type=%s \n", object_type); + //˵ǰ汾Ķ + if ((strstr(object_type, "Revision") == NULL) || (strstr(object_type, "Master") != NULL) + || (strstr(object_type, "master") != NULL) || (strstr(object_type, "BOM") != NULL) || (strstr(object_type, "bom") != NULL) || (strstr(object_type, "Bom") != NULL)) + { + continue; + } + //õǷѾ·sap· + char* if_Send_Sap = NULL; + AOM_ask_value_string(attachments[i], "r9_ISTOSAP", &if_Send_Sap); + if (strstr(object_type, "") != NULL) { + continue; + } + + ITKCALL(PREF_ask_char_values("RK_SendSapMasterData", &valueNum, &server_address)); //ѡ + //ȡϵpuid + char* puid = NULL; + ITK__convert_tag_to_uid(attachments[i], &puid); + strcat(parameters, "getMasterDataPropertys}}"); + strcat(parameters, puid); + strcat(parameters, "}}"); + char* revbuf[32] = { 0 }; //ŷַָ + //õѡõ + for (int ii = 0; ii < valueNum; ii++) + { + int num = 0;//ַָĸ + //split(server_address[ii], "=", revbuf, &num); + strcat(parameters, revbuf[0] == NULL || strlen(revbuf[0]) == 0 ? "" : revbuf[0]); + strcat(parameters, "="); + AOM_ask_value_string(attachments[i], revbuf[1], &item_rev_value); + strcat(parameters, item_rev_value); + strcat(parameters, ""); + } + //ԣõԻ߶ԣ + strcat(parameters, "BERID=1000_01"); + strcat(parameters, "@@"); + MEM_free(object_type); + object_type = NULL; + MEM_free(puid); + puid = NULL; + } + //дļ + char data_file[SS_MAXPATHLEN] = ""; + strcat(data_file, tc_root_file); + strcat(data_file, "\\data.txt"); + FILE* fptr; + fptr = fopen(data_file, "w"); + fprintf(fptr, "%s", parameters); + fclose(fptr); + + //cmdָ + string strResult; + char cmd[256] = ""; + strcpy(cmd, "java -jar \""); + //strcat(cmd, jar_file); + strcat(cmd, tc_root_file); + strcat(cmd, "\\portal\\plugins\\"); + strcat(cmd, "callSap.jar"); + // + strcat(cmd, data_file); + printf("·:\n%s\n", cmd); + char buf[8000] = { 0 }; + FILE* pf = NULL; + if ((pf = _popen(cmd, "r")) == NULL) { + printf("ӿڷ:\n%s", "1"); + } + + while (pf != NULL && fgets(buf, sizeof buf, pf)) { + strResult += buf; + } + _pclose(pf); + + if (strlen(parameters) == 0) { + POM_AM__set_application_bypass(true); + //ȡҵ + tag_t job = NULLTAG; + EPM_ask_job(rootTask, &job); + //ֵ + //lock + AOM_lock(job); + //set + AOM_set_value_string(job, "object_desc", "·SAPϢʧܣûҪ·"); + //save + AOM_save(job); + //unlock + AOM_unlock(job); + AOM_refresh(job, FALSE); + //AOM_refresh( rootTask,FALSE ); + POM_AM__set_application_bypass(false); + } + + unsigned int iSize = strResult.size(); + if (iSize > 0 && strResult[iSize - 1] == '\n' && strlen(parameters) > 0) + { + strResult = strResult.substr(0, iSize - 1); + printf("·ʧ\n"); + printf("Ϣ%s\n", strResult); + printf("Ŀ%d\n", attachments_num); + for (int i = 0; i < attachments_num; i++) + { + //ȡobject_type + AOM_ask_value_string(attachments[i], "object_type", &object_type); + printf("object_type=%s \n", object_type); + if ((strstr(object_type, "Revision") == NULL) || (strstr(object_type, "Master") != NULL) + || (strstr(object_type, "master") != NULL) || (strstr(object_type, "BOM") != NULL) || (strstr(object_type, "bom") != NULL) || (strstr(object_type, "Bom") != NULL)) + { + continue; + } + char* item_id_value = NULL; + //ȡitem_id + AOM_ask_value_string(attachments[i], "item_id", &item_id_value); + + strcat(item_id_value, ""); + + if (strstr(strResult.c_str(), item_id_value) == NULL) + { + //İ汾Ƿ·Ϊǡ + POM_AM__set_application_bypass(true); + //lock + AOM_lock(attachments[i]); + //set + AOM_set_value_string(attachments[i], "r9_ISTOSAP", ""); + //save + AOM_save(attachments[i]); + //unlock + AOM_unlock(attachments[i]); + AOM_refresh(attachments[i], FALSE); + + POM_AM__set_application_bypass(false); + } + } + + printf("ʼ\n"); + POM_AM__set_application_bypass(true); + //ȡҵ + tag_t job = NULLTAG; + EPM_ask_job(rootTask, &job); + //ֵ + //lock + AOM_lock(job); + //set + AOM_set_value_string(job, "object_desc", "SAPϢʧܣʧԭ鿴־"); + //save + AOM_save(job); + //unlock + AOM_unlock(job); + AOM_refresh(job, FALSE); + //AOM_refresh( rootTask,FALSE ); + POM_AM__set_application_bypass(false); + + //EMH_store_error_s1( EMH_severity_user_error, EMH_USER_error_base,strResult.c_str()); + //ifail = 1; + } + else + { + printf("ɹ·sap"); + for (int i = 0; i < attachments_num; i++) + { + //ȡobject_type + AOM_ask_value_string(attachments[i], "object_type", &object_type); + printf("object_type=%s \n", object_type); + + if ((strstr(object_type, "Revision") == NULL) || (strstr(object_type, "Master") != NULL) + || (strstr(object_type, "master") != NULL) || (strstr(object_type, "BOM") != NULL) || (strstr(object_type, "bom") != NULL) || (strstr(object_type, "Bom") != NULL)) + { + continue; + } + + //İ汾Ƿ·Ϊǡ + POM_AM__set_application_bypass(true); + //lock + AOM_lock(attachments[i]); + //set + AOM_set_value_string(attachments[i], "r9_ISTOSAP", ""); + //save + AOM_save(attachments[i]); + //unlock + AOM_unlock(attachments[i]); + AOM_refresh(attachments[i], FALSE); + + POM_AM__set_application_bypass(false); + + MEM_free(object_type); + object_type = NULL; + + } + POM_AM__set_application_bypass(true); + //ȡҵ + tag_t job = NULLTAG; + EPM_ask_job(rootTask, &job); + //ֵ + //lock + AOM_lock(job); + //set + AOM_set_value_string(job, "object_desc", "ɹ·"); + //save + AOM_save(job); + //unlock + AOM_unlock(job); + AOM_refresh(job, FALSE); + //AOM_refresh( rootTask,FALSE ); + POM_AM__set_application_bypass(false); + } + + //ͷڴ + tc_root_file = NULL; + MEM_free(item_rev_value); + item_rev_value = NULL; + return ifail; +} +int PLM_TO_SAP_Revise(EPM_action_message_t msg) { + int ifail = ITK_ok; + int attachments_num = 0; + int valueNum = 0; + tag_t rootTask = NULLTAG; + tag_t* attachments = NULLTAG; + char* object_type; + char* tc_root_file = getenv("tc_root"); //C:\Siemens\Teamcenter12 + char* parameters = (char*)malloc(1000000 * sizeof(char)); //ŸµSAP + memset(parameters, 0, sizeof(char)); + char** server_address; + char* item_rev_value = NULL; + + //ȡ + EPM_ask_root_task(msg.task, &rootTask); + //ȡĿ + EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments); + + + for (int i = 0; i < attachments_num; i++) + { + //ȡtopline + ITKCALL(AOM_ask_value_string(attachments[i], "object_type", &object_type)); + printf("object_type=%s \n", object_type); + //˵ǰ汾Ķ + if ((strstr(object_type, "Revision") == NULL) || (strstr(object_type, "Master") != NULL) + || (strstr(object_type, "master") != NULL) || (strstr(object_type, "BOM") != NULL) || (strstr(object_type, "bom") != NULL) || (strstr(object_type, "Bom") != NULL)) + { + continue; + } + //õǷѾ·sap򲻸 + char* if_Send_Sap = NULL; + AOM_ask_value_string(attachments[i], "", &if_Send_Sap); + //õöİ汾 + tag_t item = NULLTAG, * revisions; + ITEM_ask_item_of_rev(attachments[i], &item); + int rev_count = 0; + ITEM_find_revisions(item, "*", &rev_count, &revisions); + printf("汾Ϊ:%d", rev_count); + if (strstr(object_type, "") != NULL || rev_count < 2) { + continue; + } + + ITKCALL(PREF_ask_char_values("RK_SendSapMasterData", &valueNum, &server_address)); //ѡ + //ȡϵpuid + char* puid = NULL; + ITK__convert_tag_to_uid(attachments[i], &puid); + strcat(parameters, "getMasterDataPropertys}}"); + strcat(parameters, puid); + strcat(parameters, "}}"); + char* revbuf[32] = { 0 }; //ŷַָ + //õѡõ + for (int ii = 0; ii < valueNum; ii++) + { + int num = 0;//ַָĸ + //split(server_address[ii], "=", revbuf, &num); + strcat(parameters, revbuf[0] == NULL || strlen(revbuf[0]) == 0 ? "" : revbuf[0]); + strcat(parameters, "="); + AOM_ask_value_string(attachments[i], revbuf[1], &item_rev_value); + strcat(parameters, item_rev_value); + strcat(parameters, ""); + } + //ԣõԻ߶ԣ + //strcat(parameters, "BERID=\"\"DEL_FLAG=\"\""); + strcat(parameters, "@@"); + MEM_free(object_type); + object_type = NULL; + MEM_free(puid); + puid = NULL; + } + //дļ + char data_file[SS_MAXPATHLEN] = ""; + strcat(data_file, tc_root_file); + strcat(data_file, "\\data.txt"); + FILE* fptr; + fptr = fopen(data_file, "w"); + fprintf(fptr, "%s", parameters); + fclose(fptr); + + //cmdָ + string strResult; + char cmd[256] = ""; + strcpy(cmd, "java -jar \""); + //strcat(cmd, jar_file); + strcat(cmd, tc_root_file); + strcat(cmd, "\\portal\\plugins\\"); + strcat(cmd, "callSap.jar"); + // + strcat(cmd, data_file); + printf("·:\n%s\n", cmd); + char buf[8000] = { 0 }; + FILE* pf = NULL; + if ((pf = _popen(cmd, "r")) == NULL) { + printf("ӿڷ:\n%s", "1"); + } + + while (pf != NULL && fgets(buf, sizeof buf, pf)) { + strResult += buf; + } + _pclose(pf); + + if (strlen(parameters) == 0) { + POM_AM__set_application_bypass(true); + //ȡҵ + tag_t job = NULLTAG; + EPM_ask_job(rootTask, &job); + //ֵ + //lock + AOM_lock(job); + //set + AOM_set_value_string(job, "object_desc", "SAPϢʧܣûҪ·"); + //save + AOM_save(job); + //unlock + AOM_unlock(job); + AOM_refresh(job, FALSE); + //AOM_refresh( rootTask,FALSE ); + POM_AM__set_application_bypass(false); + } + + unsigned int iSize = strResult.size(); + if (iSize > 0 && strResult[iSize - 1] == '\n' && strlen(parameters) > 0) + { + strResult = strResult.substr(0, iSize - 1); + printf("ʧ\n"); + printf("Ϣ%s\n", strResult); + printf("Ŀ%d\n", attachments_num); + for (int i = 0; i < attachments_num; i++) + { + //ȡobject_type + AOM_ask_value_string(attachments[i], "object_type", &object_type); + printf("object_type=%s \n", object_type); + if ((strstr(object_type, "Revision") == NULL) || (strstr(object_type, "Master") != NULL) + || (strstr(object_type, "master") != NULL) || (strstr(object_type, "BOM") != NULL) || (strstr(object_type, "bom") != NULL) || (strstr(object_type, "Bom") != NULL)) + { + continue; + } + char* item_id_value = NULL; + //ȡitem_id + AOM_ask_value_string(attachments[i], "item_id", &item_id_value); + + strcat(item_id_value, ""); + + if (strstr(strResult.c_str(), item_id_value) == NULL) + { + //İ汾Ƿ·Ϊǡ + POM_AM__set_application_bypass(true); + //lock + AOM_lock(attachments[i]); + //set + AOM_set_value_string(attachments[i], "r9_ISTOSAP", ""); + //save + AOM_save(attachments[i]); + //unlock + AOM_unlock(attachments[i]); + AOM_refresh(attachments[i], FALSE); + + POM_AM__set_application_bypass(false); + } + } + + printf("ʼ\n"); + POM_AM__set_application_bypass(true); + //ȡҵ + tag_t job = NULLTAG; + EPM_ask_job(rootTask, &job); + //ֵ + //lock + AOM_lock(job); + //set + AOM_set_value_string(job, "object_desc", "SAPϢʧܣʧԭ鿴־"); + //save + AOM_save(job); + //unlock + AOM_unlock(job); + AOM_refresh(job, FALSE); + //AOM_refresh( rootTask,FALSE ); + POM_AM__set_application_bypass(false); + + //EMH_store_error_s1( EMH_severity_user_error, EMH_USER_error_base,strResult.c_str()); + //ifail = 1; + } + else + { + printf("ɹsap"); + for (int i = 0; i < attachments_num; i++) + { + //ȡobject_type + AOM_ask_value_string(attachments[i], "object_type", &object_type); + printf("object_type=%s \n", object_type); + + if ((strstr(object_type, "Revision") == NULL) || (strstr(object_type, "Master") != NULL) + || (strstr(object_type, "master") != NULL) || (strstr(object_type, "BOM") != NULL) || (strstr(object_type, "bom") != NULL) || (strstr(object_type, "Bom") != NULL)) + { + continue; + } + + //İ汾Ƿ·Ϊǡ + POM_AM__set_application_bypass(true); + //lock + AOM_lock(attachments[i]); + //set + AOM_set_value_string(attachments[i], "r9_ISTOSAP", ""); + //save + AOM_save(attachments[i]); + //unlock + AOM_unlock(attachments[i]); + AOM_refresh(attachments[i], FALSE); + + POM_AM__set_application_bypass(false); + + MEM_free(object_type); + object_type = NULL; + + } + POM_AM__set_application_bypass(true); + //ȡҵ + tag_t job = NULLTAG; + EPM_ask_job(rootTask, &job); + //ֵ + //lock + AOM_lock(job); + //set + AOM_set_value_string(job, "object_desc", "ɹ£"); + //save + AOM_save(job); + //unlock + AOM_unlock(job); + AOM_refresh(job, FALSE); + //AOM_refresh( rootTask,FALSE ); + POM_AM__set_application_bypass(false); + } + + //ͷڴ + tc_root_file = NULL; + MEM_free(item_rev_value); + item_rev_value = NULL; + return ifail; +} +int PLM_TO_SAP_Disuse(EPM_action_message_t msg) { + int ifail = ITK_ok; + + return ifail; +} diff --git a/connor_signature/TEST.cpp b/connor_signature/TEST.cpp new file mode 100644 index 0000000..5b473e7 --- /dev/null +++ b/connor_signature/TEST.cpp @@ -0,0 +1,177 @@ +#include"kutil.h" +#include +#define ITK_err 919012 + +void sendTCMail(char* title, int ifail, string contents, tag_t rootTask_tag) { + //TCʼ + tag_t envelope, owning_user, envelope2, user2; + char* userId; + AOM_ask_owner(rootTask_tag, &owning_user); + AOM_ask_value_string(owning_user, "user_id", &userId); + ITKCALL(ifail = MAIL_create_envelope(title, contents.c_str(), &envelope)); + ITKCALL(ifail = MAIL_initialize_envelope2(envelope, title, contents.c_str())); + ITKCALL(ifail = MAIL_add_envelope_receiver(envelope, owning_user)); + ITKCALL(ifail = MAIL_send_envelope(envelope)); + // + SA_find_user2("two", &user2); + ITKCALL(ifail = MAIL_create_envelope(title, contents.c_str(), &envelope2)); + ITKCALL(ifail = MAIL_initialize_envelope2(envelope2, title, contents.c_str())); + ITKCALL(ifail = MAIL_add_envelope_receiver(envelope2, user2)); + ITKCALL(ifail = MAIL_send_envelope(envelope2)); + printf("tcʼķͳɹ"); +} + + + +int TEST(EPM_action_message_t msg) { + int ifail = ITK_ok, task_count = 0; + int attachments_num = 0, * attach_type; + tag_t rootTask = NULLTAG, cur_perform_task, memberTag; + tag_t* attachments = NULLTAG, *task_tags = NULLTAG; + + //ȡ + EPM_ask_root_task(msg.task, &rootTask); + //ȡĿ + //EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments); + char* puid = NULL; + ITK__convert_tag_to_uid(rootTask, &puid); + + printf("ǰڵpuidΪ%s\n", puid); + EPM_ask_sub_tasks(rootTask, &task_count, &task_tags); + for (int i = 0; i < task_count; i++) { + char* task_type = NULL; + WSOM_ask_object_type2(task_tags[i], &task_type); + printf("ǰڵΪ:%s\n", task_type); + if (strcmp("EPMReviewTask", task_type) == 0 || strcmp("EPMAcknowledgeTask", task_type) == 0) { + EPM_ask_sub_task(task_tags[i], "select-signoff-team", &cur_perform_task); + EPM_ask_all_attachments(cur_perform_task, &attachments_num, &attachments, &attach_type); + if (attachments > 0) { + for (int j = 0; j < attachments_num; j++) { + char* comment = NULL; + date_t decision_date_temp; + tag_t aUserTag = NULLTAG; + EPM_signoff_decision_t dec; + SIGNOFF_TYPE_t memberType; + ITKCALL(EPM_ask_signoff_decision(attachments[j], &dec, &comment, &decision_date_temp)); + ITKCALL(EPM_ask_signoff_member(attachments[j], &memberTag, &memberType)); + printf("ûǩΪ:%d\n", memberTag); + ITKCALL(SA_ask_groupmember_user(memberTag, &aUserTag)); + char* name; + ITKCALL(SA_ask_user_person_name2(aUserTag, &name)); + printf("ûΪ:%s\n", name); + } + } + } + } + + + //sendTCMail("Ŀ...", ifail, "ceshi", rootTask); + + return ifail; +} + +int TEST3(EPM_action_message_t msg) { + int ifail = ITK_ok, att_cnt = 0, arg_cnt = 0; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + tag_t* attachments = NULLTAG, task_tag = NULLTAG, rootTask_tag; + string type,grant_value; + vector types; + + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "type") == 0) { + type.assign(argvalue); + printf("%s\n", argvalue); + } + else if (strcmp(argflag, "grant") == 0) { + grant_value.assign(argvalue); + printf("%s\n", argvalue); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + else { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲"); + ifail = 1; + goto end; + } + { + if (grant_value.empty()) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-grant"); + ifail = 1; + goto end; + } + Split(type, ";", types); + if (types.size() == 0) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δ̲-type"); + ifail = 1; + goto end; + } + } + +end: + DOFREE(attachments); + return ifail; +} + +int TEST2(EPM_action_message_t msg) { + int ifail = ITK_ok; + int attachments_num = 0; + tag_t rootTask = NULLTAG; + tag_t* attachments = NULLTAG; + + //ȡ + EPM_ask_root_task(msg.task, &rootTask); + //ȡĿ + EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments); + + + for (int i = 0; i < attachments_num; i++) { + //½pdfݼ + tag_t item = NULLTAG,rev = attachments[i], spec_relation; + const char name[AE_datasettype_name_size_c + 1] = "Text"; + char ref_name[WSO_name_size_c + 1] = "Text"; + tag_t datasetType = NULLTAG, tool = NULLTAG; + tag_t newDatasetTag = NULLTAG; //ݼtag + tag_t relation = NULLTAG; + AE_find_datasettype2(name, &datasetType); + AE_create_dataset_with_id(datasetType, "ݼƤ", "ݼ", "", "", &newDatasetTag); + AOM_lock(newDatasetTag); + AE_ask_datasettype_def_tool(datasetType, &tool); + AE_set_dataset_tool(newDatasetTag, tool); + AE_set_dataset_format2(newDatasetTag, name); + AOM_save(newDatasetTag); + AOM_unlock(newDatasetTag); + AOM_refresh(newDatasetTag, TRUE); + //ITEM_attach_rev_object2(rev, newDatasetTag, ITEM_specification_atth); + GRM_find_relation_type("IMAN_specification", &spec_relation); //ظ + GRM_create_relation(rev, newDatasetTag, spec_relation, NULLTAG,&relation); + GRM_save_relation(relation); + // + import_dataset_file(newDatasetTag,ref_name,"txt", "C:\\Users\\Administrator\\Desktop\\½ļ\\2.txt", ""); + + + //tag_t new_file_tag = NULLTAG; + //IMF_file_t file_descriptor; + //char new_ds_name[WSO_name_size_c + 1] = ""; + //char* new_file_name = USER_new_file_name(new_ds_name, ref_name, "txt", 0);//Ϊݼļ + //IMF_import_file("C:\\Users\\Administrator\\Desktop\\½ļ\\2.txt", new_file_name, SS_TEXT, &new_file_tag, &file_descriptor); + //AOM_lock(new_file_tag); + //IMF_set_original_file_name2(new_file_tag, ""); + //IMF_close_file(file_descriptor); + //AOM_save(new_file_tag); + //AOM_unlock(new_file_tag); + //AOM_refresh(new_file_tag, TRUE); + //AOM_lock(newDatasetTag); + //AE_add_dataset_named_ref2(newDatasetTag, ref_name, AE_PART_OF, new_file_tag); + //AE_save_myself(newDatasetTag); + //AOM_unlock(newDatasetTag); + //AOM_refresh(newDatasetTag, TRUE); + } + + return ifail; +} \ No newline at end of file diff --git a/connor_signature/UpgradeTask.cpp b/connor_signature/UpgradeTask.cpp new file mode 100644 index 0000000..52fcef4 --- /dev/null +++ b/connor_signature/UpgradeTask.cpp @@ -0,0 +1,77 @@ +#include"kutil.h" +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libxl.h" +#include +#include +#include +#include +#include +#include + +using namespace libxl; +using namespace std::chrono_literals; +using namespace std; + +#define debug true +#define ITK_err 919012 + + + + +int UpgradeTask(EPM_action_message_t msg) { + printf("++++++++++++++++++ʼ̽ڵ++++++++++++++++++++\n"); + POM_AM__set_application_bypass(true); + int ifail = ITK_ok, att_cnt = 0, i = 0, arg_cnt = 0; + tag_t task_tag = NULL_TAG, rootTask_tag = NULL_TAG; + task_tag = msg.task; + if (task_tag == NULLTAG) + { + return -1; + } + ITKCALL(EPM_ask_root_task(task_tag, &rootTask_tag)); + char* uid; + ITK__convert_tag_to_uid(rootTask_tag, &uid); + printf("uid:%s\n", uid); + int allstartnum = 0; tag_t* allstart; + ITKCALL(AOM_ask_value_tags(rootTask_tag, "child_tasks", &allstartnum, &allstart)); + for (int i = 0; i < allstartnum;i++) { + char* taskName; + ITKCALL(AOM_ask_value_string(allstart[i], "object_name", &taskName)); + printf("%d:%s\n",i,taskName); + } + char* taskname = NULL, * type = NULL; + ITKCALL(EPM_ask_name2(task_tag, &taskname)); + ITKCALL(AOM_ask_value_string(task_tag, "object_type", &type)); + printf("name=%s\n", taskname); + printf("type=%s\n", type); + if (strcmp(type, "EPMDoTask") == 0) + { + EPM_remove_task_hold(task_tag); + printf("ʼڵ\n"); + ITKCALL(EPM_promote_task(task_tag, "")); + printf("ڵ\n"); + + + } + DOFREE(taskname); + DOFREE(type); + POM_AM__set_application_bypass(false); + + printf("++++++++++++++++++̽ڵ++++++++++++++++++++\n"); + return ITK_ok; +} \ No newline at end of file diff --git a/connor_signature/a.cpp b/connor_signature/a.cpp new file mode 100644 index 0000000..7eebb15 --- /dev/null +++ b/connor_signature/a.cpp @@ -0,0 +1,223 @@ +//#include "kutil.h" +// +////Զָ +//int HS2_AutoAssign(EPM_action_message_t msg) { +// +// printf("===================================\n"); +// printf("Զָ ʼ\n"); +// printf("===================================\n"); +// int ifail = ITK_ok; +// printf("Ȩ\n"); +// POM_AM__set_application_bypass(true); +// int att_cnt = 0; +// tag_t task_tag = NULL_TAG, +// root_task_tag = NULLTAG, +// * attachments; +// char* argflag = NULL, * argvalue = NULL, * arg = NULL; +// int arg_cnt = 0; +// char task_name[1024] = ""; +// vector vec; +// char* message; +// //ȡhandlerIJĸ +// arg_cnt = TC_number_of_arguments(msg.arguments); +// ECHO("Ϊ%d\n", arg_cnt); +// +// if (arg_cnt > 0) +// { +// for (int i = 0; i < arg_cnt; i++) +// { +// //ȡһ0ʼ +// arg = TC_next_argument(msg.arguments); +// //ȡƺֵ +// ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue); +// if (strcmp(argflag, "task") == 0) +// { +// if (argvalue != NULL) +// { +// strcpy(task_name, argvalue); +// } +// } +// +// } +// MEM_free(argflag); +// MEM_free(argvalue); +// } +// task_tag = msg.task; +// EPM_ask_root_task(task_tag, &root_task_tag); +// int cnt_task = 0; tag_t* tasks = NULLTAG; +// EPM_ask_sub_tasks(root_task_tag, &cnt_task, &tasks); +// //ITKCALL(EPM_ask_tasks(root_task_tag, EPM_started, &cnt_task, &tasks)); +// EPM_ask_attachments(root_task_tag, EPM_target_attachment, &att_cnt, &attachments); +// if (att_cnt > 0) { +// for (int i = 0; i < att_cnt; i++) +// { +// tag_t rev_tag = attachments[i]; +// char* tag_type; +// ITKCALL(AOM_ask_value_string(rev_tag, "object_type", &tag_type)); +// +// if (strcmp("HS2_ChangeTaskRevision", tag_type) == 0) { +// int doc_num = 0; +// tag_t* doc_tags = NULL; +// tag_t* pathFile = NULLTAG; +// int Num = 0; +// char* excel_path; +// ITKCALL(AOM_ask_value_tags(rev_tag, "IMAN_specification", &doc_num, &doc_tags)); +// char user[1024] = "\0"; +// for (int j = 0; j < cnt_task; j++) +// { +// tag_t subtask = tasks[j]; +// char* sub_task_object_type = NULL; +// char* sub_task_object_name = NULL; +// ITKCALL(AOM_ask_value_string(subtask, "object_name", &sub_task_object_name)); +// cout << "--------" << sub_task_object_name << endl; +// ITKCALL(AOM_ask_value_string(subtask, "object_type", &sub_task_object_type)); +// cout << "--------" << sub_task_object_type << endl; +// if (strcmp(task_name, sub_task_object_name) == 0) +// { +// cout << "bingo0" << endl; +// // ITKCALL( SA_find_user( "0120160006", &user_tag )); +// // ITKCALL( EPM_assign_responsible_party( task, user_tag));//ñƽڵη +// tag_t tmp_select_signoff_task = NULLTAG; +// ITKCALL(EPM_ask_sub_task(subtask, EPM_select_signoff_team_task, &tmp_select_signoff_task)); +// for (int k = 0; k < vec.size(); k++) +// { +// // +// tag_t* results; +// const char query_name_product[1][QRY_name_size_c + 1] = { " - ԱϢ" }; +// tag_t query_tag1 = NULLTAG; +// int entry_count1 = 0; +// char** entries1; +// char** values1; +// char* other_values1[1]; +// char* other_entrys1[1]; +// other_values1[0] = (char*)calloc(48, sizeof(char)); +// other_entrys1[0] = (char*)calloc(48, sizeof(char)); +// int num_found1 = 0; +// ITKCALL(QRY_find2(query_name_product[0], &query_tag1)); +// if (query_tag1 == NULLTAG) +// { +// WriteLog("query_tag=NULLTAG,ûҵ [%s]ѯ\n", query_name_product[0]); +// ITK_exit_module(1); +// return 0; +// } +// else +// { +// WriteLog("ҵѯ\n"); +// } +// +// ITKCALL(QRY_find_user_entries(query_tag1, &entry_count1, &entries1, &values1));//entries1ѯʽvalues1ѯֵMEM_freeͷţ +// if (entry_count1 == 0) +// { +// WriteLog("entry_count1=0,ѯûòѯ\n"); +// //ITK_exit_module(1); +// if (entries1 != NULL) { +// MEM_free(entries1); +// entries1 = NULL; +// } +// if (values1 != NULL) { +// MEM_free(values1); +// values1 = NULL; +// } +// return 0; +// } +// +// //date_tag.second = p->tm_sec ; +// +// for (int n = 0; n < entry_count1; n++) +// { +// printf("entries1[%d]=%s\n", n, entries1[n]); +// if (tc_strcmp(entries1[n], "Ա") == 0) { +// //strcpy(values[n],nowtime1); +// tc_strcpy(other_entrys1[0], "Ա"); +// tc_strcpy(other_values1[0], vec[k].c_str());//* 2012-05 NBJF16025 Test001 NBJF16046 16C104 +// printf("other_values1[0] %s\n", other_values1[0]); +// +// } +// +// printf("values[%d]=%s\n", n, values1[n]); +// +// } +// +// ITKCALL(ifail = QRY_execute(query_tag1, 1, other_entrys1, other_values1, &num_found1, &results)); +// +// if (ifail != ITK_ok) { +// EMH_ask_error_text(ifail, &message); +// WriteLog("쳣 : \"%d\",\"%s\"\n", ifail, message); +// MEM_free(message); +// if (entries1 != NULL) { +// MEM_free(entries1); +// entries1 = NULL; +// } +// if (values1 != NULL) { +// MEM_free(values1); +// values1 = NULL; +// } +// return 0; +// } +// if (num_found1 == 0) +// { +// printf("num_found=0,ѯûҵݣ\n"); +// //ITK_exit_module(1); +// if (entries1 != NULL) { +// MEM_free(entries1); +// entries1 = NULL; +// } +// if (values1 != NULL) { +// MEM_free(values1); +// values1 = NULL; +// } +// } +// //ʼȡƷϢ +// printf("ѯõITEMnum_found1: \"%d\" \n", num_found1); +// +// if (num_found1 != 0) { +// tag_t login_group = NULLTAG; +// printf("111\n"); +// tag_t user = results[0]; +// /* char* user_id; +// tag_t user_tag = NULLTAG; +// printf("222\n"); +// int mem_cnt = 0; +// tag_t* members = NULL;*/ +// int signoff_cnt = 0; +// tag_t* signoffs = NULL; +// /* ITKCALL(AOM_ask_value_string(user, "user_id", &user_id)); +// printf("user_id=%s\n", user_id); +// ITKCALL(SA_find_user2(user_id, &user_tag)); +// ITKCALL(SA_ask_user_login_group(user_tag, &login_group)); +// printf("333\n"); +// ITKCALL(SA_find_groupmembers(user_tag, login_group, &mem_cnt, &members)); +// printf("mem_cnt=%d\n", mem_cnt); +// printf("444\n"); +// ITKCALL(EPM_create_adhoc_signoff(tmp_select_signoff_task, members[0], &signoff_cnt, &signoffs));*/ +// ITKCALL(EPM_create_adhoc_signoff(tmp_select_signoff_task, user, &signoff_cnt, &signoffs)); +// printf("555\n"); +// ITKCALL(EPM_set_adhoc_signoff_selection_done(tmp_select_signoff_task, true)); +// printf("666\n"); +// if (signoffs) +// { +// MEM_free(signoffs); +// signoffs = NULL; +// } +// } +// +// } +// +// // ITKCALL(EPM_trigger_action(tmp_select_signoff_task,EPM_complete_action, "")); +// break; +// } +// //} +// //} +// } +// } +// } +// +// } +// +// printf("سȨ\n"); +// POM_AM__set_application_bypass(false); +// printf("===================================\n"); +// printf("Զָ \n"); +// printf("===================================\n"); +// return ifail; +//} \ No newline at end of file diff --git a/connor_signature/addLb.cpp b/connor_signature/addLb.cpp new file mode 100644 index 0000000..64f5aef --- /dev/null +++ b/connor_signature/addLb.cpp @@ -0,0 +1,244 @@ +#include "handler.h" + +#define ARGS_LENGTH 200 +#define MAX_PRINTLINE_LENGTH 2000 +#define MAX_PATH_LENGTH 2000 +#define MAX_ARGUMENT_LENGTH 400 +#define MAX_PARAMNAME_LENGTH 50 +#define MAX_FILE_EXT_LENGTH 10 +#define TRUE_FLAG 1 +#define FALSE_FLAG 0 +#define DETAILLOG 1 +#define DOFREE(obj) \ +{ \ + if(obj) \ + { \ + MEM_free(obj); \ + obj = NULL; \ + } \ +} + +int delete_release_status(EPM_action_message_t msg) { + int ifail = ITK_ok, att_cnt = 0, rel_cnt = 0; + EPM_target_attachment; + tag_t task = NULLTAG, rootTask_tag = NULLTAG, *attchments = NULL, *releases = NULL, release_status = NULL; + + ITKCALL(EPM_ask_root_task(msg.task, &rootTask_tag)); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attchments)); + POM_AM__set_application_bypass(true); + for (int i = 0; i < att_cnt; i++) + { + ITKCALL(AOM_ask_value_tags(attchments[i], "release_status_list", &rel_cnt, &releases)); + for (int j = rel_cnt - 1; j > -1; j--) + { + EPM_remove_status_from_targets(releases[j], rootTask_tag); + } + } + POM_AM__set_application_bypass(false); + return ifail; +} + +// +int set_release_status(tag_t item, char release_name[]) { + int ifail = ITK_ok; + tag_t release_status = NULL; + + ITKCALL(ifail = RELSTAT_create_release_status(release_name, &release_status)); + ITKCALL(ifail = RELSTAT_add_release_status(release_status, 1, &item, TRUE)); + + return ifail; +} + +int reviseDesignPost(METHOD_message_t* msg, va_list va) +{ + + + int ifail = ITK_ok, rev_cnt = 0; + tag_t new_rev = va_arg(va, tag_t); + tag_t item = NULLTAG; + tag_t *rev_list; + + POM_AM__set_application_bypass(true); + + printf("ͼֽ\n"); + ITKCALL(ITEM_ask_item_of_rev(new_rev, &item)); + ITKCALL(AOM_ask_value_tags(item, "revision_list", &rev_cnt, &rev_list)); + if (rev_cnt > 1) + { + int wl_cnt = 0; + tag_t *wl_list; + tag_t pre_rev = rev_list[rev_cnt - 2],wlobj,newwlrev; + char * revtype,* wltype; + + int wlcount = 0; tag_t *wltags; + ITKCALL(AOM_ask_value_string(pre_rev, "object_type", &revtype)); + if (strcmp("LD6_2DdesignRevision", revtype)==0) { + printf("2D\n"); + ITKCALL(AOM_ask_value_tags(pre_rev, "LD6_ProductInfo", &wlcount, &wltags)); + for (int i = 0; i < wlcount;i++) { + ITKCALL(AOM_ask_value_string(wltags[i], "object_type", &wltype)); + if (strcmp("LD6_ProductRevision", wltype)==0 || strcmp("LD6_MachinesPRevision", wltype) == 0) { + ITKCALL(ITEM_ask_item_of_rev(wltags[i], &wlobj)); + if (wlobj!=NULL) { + int status = ITEM_ask_latest_rev(wlobj, &newwlrev); + if (status == ITK_ok) + { + printf("start ʼɾϵ\n"); + tag_t gx_gx_type = NULLTAG; tag_t gx_relation = NULLTAG; + ITKCALL(GRM_find_relation_type("LD6_ProductInfo", &gx_gx_type)); + GRM_find_relation(new_rev, wltags[i], gx_gx_type, &gx_relation); + GRM_delete_relation(gx_relation); + printf("end ɾϵ\n"); + printf("start ʼӹϵ\n"); + tag_t relation = NULLTAG; + ITKCALL(GRM_create_relation(new_rev, newwlrev, gx_gx_type, NULLTAG, &relation)); + ITKCALL(GRM_save_relation(relation)); + printf("end ӹϵ\n"); + //ITKCALL(AOM_set_value_tag(new_rev, "LD6_ProductInfo",newwlrev)); + } + } + } + } + } + else if (strcmp("LD6_MEProcessCrRevision", revtype) == 0 || strcmp("LD6_LSMEProcessRevision", revtype) == 0) { + printf("·\n"); + ITKCALL(AOM_ask_value_tags(pre_rev, "IMAN_METarget", &wlcount, &wltags)); + for (int i = 0; i < wlcount; i++) { + ITKCALL(AOM_ask_value_string(wltags[i], "object_type", &wltype)); + if (strcmp("LD6_ProductRevision", wltype) == 0 || strcmp("LD6_MachinesPRevision", wltype) == 0) { + ITKCALL(ITEM_ask_item_of_rev(wltags[i], &wlobj)); + if (wlobj != NULL) { + int status = ITEM_ask_latest_rev(wlobj, &newwlrev); + if (status == ITK_ok) + { + printf("start ʼɾϵ\n"); + tag_t gx_gx_type = NULLTAG; tag_t gx_relation = NULLTAG; + ITKCALL(GRM_find_relation_type("IMAN_METarget", &gx_gx_type)); + GRM_find_relation(new_rev, wltags[i], gx_gx_type, &gx_relation); + GRM_delete_relation(gx_relation); + printf("end ɾϵ\n"); + printf("start ʼӹϵ\n"); + tag_t relation = NULLTAG; + ITKCALL(GRM_create_relation(new_rev, newwlrev, gx_gx_type, NULLTAG, &relation)); + ITKCALL(GRM_save_relation(relation)); + printf("end ӹϵ\n"); + //ITKCALL(AOM_set_value_tag(new_rev, "IMAN_METarget", newwlrev)); + } + } + //޸ + printf("ʼ޸\n"); + + char *getnum, *part; + ITKCALL(AOM_ask_value_string(newwlrev, "ld6_clientPartNum",&getnum)); + ITKCALL(AOM_ask_value_string(newwlrev, "ld6_clientPartRev", &part)); + AOM_lock(new_rev); + + ITKCALL(AOM_set_value_string(new_rev, "ld6_clientPartNum", getnum)); + ITKCALL(AOM_set_value_string(new_rev, "ld6_clientPartRev", part)); + AOM_save(new_rev); + AOM_unlock(new_rev); + AOM_refresh(new_rev,true); + } + } + } + else if (strcmp("LD6_TecDOCRevision", revtype) == 0) { + printf("ĵ\n"); + ITKCALL(AOM_ask_value_tags(pre_rev, "LD6_ProductInfo", &wlcount, &wltags)); + for (int i = 0; i < wlcount; i++) { + ITKCALL(AOM_ask_value_string(wltags[i], "object_type", &wltype)); + if (strcmp("LD6_ProductRevision", wltype) == 0 || strcmp("LD6_MachinesPRevision", wltype) == 0) { + ITKCALL(ITEM_ask_item_of_rev(wltags[i], &wlobj)); + if (wlobj != NULL) { + int status = ITEM_ask_latest_rev(wlobj, &newwlrev); + if (status == ITK_ok) + { + printf("start ʼɾϵ\n"); + tag_t gx_gx_type = NULLTAG; tag_t gx_relation = NULLTAG; + ITKCALL(GRM_find_relation_type("LD6_ProductInfo", &gx_gx_type)); + GRM_find_relation(new_rev, wltags[i], gx_gx_type, &gx_relation); + GRM_delete_relation(gx_relation); + printf("end ɾϵ\n"); + printf("start ʼӹϵ\n"); + tag_t relation = NULLTAG; + ITKCALL(GRM_create_relation(new_rev, newwlrev, gx_gx_type, NULLTAG, &relation)); + ITKCALL(GRM_save_relation(relation)); + printf("end ӹϵ\n"); + //ITKCALL(AOM_set_value_tag(new_rev, "LD6_ProductInfo", newwlrev)); + } + } + } + } + } + else if (strcmp("LD6_3DdesignRevision", revtype)==0) { + ITKCALL(AOM_ask_value_tags(pre_rev, "representation_for", &wl_cnt, &wl_list)); + map wl_map; + for (int i = 0; i < wl_cnt; i++) + { + char *wl_id; + ITKCALL(AOM_ask_value_string(wl_list[i], "item_id", &wl_id)); + wl_map.find(wl_id); + if (wl_map.find(wl_id) == wl_map.end()) + { + tag_t wl_item; + ITKCALL(ITEM_ask_item_of_rev(wl_list[i], &wl_item)); + wl_map[wl_id] = wl_item; + } + } + list wl_add; + map::iterator it; + for (map::iterator it = wl_map.begin(); it != wl_map.end(); it++) + { + tag_t wl_item = it->second; + //int wl_rev_cnt = 0; + //tag_t *wl_rev_list; + tag_t wl_rev; + //ITKCALL(AOM_ask_value_tags(wl_item, "revision_list", &wl_rev_cnt, &wl_rev_list)); + int status = ITEM_ask_latest_rev(wl_item, &wl_rev); + if (status == ITK_ok) + { + // ȡ°汾ɹʹ revision к + wl_add.push_back(wl_rev); + + } + //if (wl_rev_cnt > 0) + //{ + // wl_add.push_back(wl_rev_list[wl_rev_cnt - 1]); + //} + } + for (list::iterator it = wl_add.begin(); it != wl_add.end(); it++) + { + char *obj_str; + tag_t relation_type = NULLTAG, relation = NULLTAG; + ITKCALL(AOM_ask_value_string(*it, "object_string", &obj_str)); + printf("object_string = %s\n", obj_str); + + ITKCALL(AOM_lock(*it)); + GRM_find_relation_type("TC_Is_Represented_By", &relation_type); + if (relation_type != NULLTAG) + { + GRM_create_relation(*it, new_rev, relation_type, NULLTAG, &relation); + GRM_save_relation(relation); + } + ITKCALL(AOM_save(*it)); + ITKCALL(AOM_unlock(*it)); + ITKCALL(AOM_refresh(*it, true)); + } + /*int n = 0; + tag_t *value = (tag_t*)MEM_alloc(sizeof(tag_t)*(wl_add.size())); + for (list::iterator it = wl_add.begin(); it != wl_add.end(); it++) + { + char *obj_str; + ITKCALL(AOM_ask_value_string(*it, "object_string", &obj_str)); + printf("object_string = %s\n", obj_str); + value[n] = *it; + n++; + } + ITKCALL(AOM_set_value_tags(new_rev, "representation_for", wl_add.size(), value));*/ + } + + + } + + POM_AM__set_application_bypass(false); + return ifail; +} \ No newline at end of file diff --git a/connor_signature/ado.cxx b/connor_signature/ado.cxx new file mode 100644 index 0000000..b00c015 --- /dev/null +++ b/connor_signature/ado.cxx @@ -0,0 +1,107 @@ + +#include "ado.h" + +_ConnectionPtr m_pConnection; +_RecordsetPtr m_pRecordset; +HRESULT hr; + +bool open(char* username, char* password, char* dbname, char* ip) +{ + try + { + ::CoInitialize(NULL); //ʼCOM + m_pConnection.CreateInstance(__uuidof(Connection)); //Ӷ + char connStr[200] = ""; + sprintf(connStr, "Provider=SQLOLEDB;Data Source=%s;Initial Catalog=%s;", ip, dbname); + hr = m_pConnection->Open(connStr, username, password, -1); + if (hr != S_OK) + return true; + } + catch (_com_error e) + { + return true; + } + return false; +} + +// IJѯ +int QuerySQL(char *SQL, int inputValueCount, int * outputColumn, int * outputValueCount, char **** outputValue) +{ + + Fields * fields = NULL; + long ColCount = 0; + + *outputColumn = 0; + *outputValueCount = 0; + m_pRecordset.CreateInstance(__uuidof(Recordset)); + + m_pRecordset->Open(SQL, m_pConnection.GetInterfacePtr(), adOpenStatic, adLockOptimistic, adCmdText); + hr = m_pRecordset->get_Fields(&fields); //õ¼ֶμ + if (SUCCEEDED(hr)) + { + fields->get_Count(&ColCount); + *outputValueCount = (int)ColCount; + } + if (*outputValueCount == 0) + return 0; + int index = 0; + // ʼڴ沢Ҵ洢 + *outputValue = (char ***)calloc((*outputValueCount) + 1, sizeof(char**)); + while (!m_pRecordset->adoEOF) + { + (*outputValue)[index] = (char **)calloc((*outputColumn) + 1, sizeof(char *)); + for (long i = 0; i < ColCount; i++) + { + BSTR bstrColName=NULL; + fields->Item[i]->get_Name(&bstrColName); + (*outputValue)[index][i] = (char *)calloc(1000, sizeof(char)); + _variant_t taskStyle = NULL; + taskStyle = m_pRecordset->GetCollect(bstrColName); + const char* str; + _bstr_t bst_t = (_bstr_t)taskStyle; + str = (const char*)bst_t; + strcpy((*outputValue)[index][i], str); + } + m_pRecordset->MoveNext();///Ƶһ¼ + index++; + } + return 0; +} + +// ִвѯ +int QuerySQLNoInputParam(char *SQL, int * outputColumn, int * outputValueCount, char **** outputValue) +{ + return QuerySQL(SQL, 0, outputColumn, outputValueCount, outputValue); +} + +// ִɾ +int ExecuteSQLNoInputParam(char *SQL) +{ + return ExecuteSQL(SQL, 0, NULL); +} + +int ExecuteSQL(char *SQL, int valueCount, char **value) +{ + try + { + m_pConnection->Execute(_bstr_t(SQL), 0, adCmdText); + } + catch (_com_error e) + { + printf("ʧ\n"); + printf(e.Description()); + return -1; + } + + return 0; +} + +void close(void) +{ + if (m_pRecordset != NULL) { + //m_pRecordset->MoveFirst(); + m_pRecordset->Close(); + m_pConnection->Close(); + } + ::CoUninitialize(); //ͷŻ +} \ No newline at end of file diff --git a/connor_signature/ado.h b/connor_signature/ado.h new file mode 100644 index 0000000..0947ae9 --- /dev/null +++ b/connor_signature/ado.h @@ -0,0 +1,35 @@ +#import "C:/Program Files/Common Files/System/ado/msado15.dll" no_namespace rename("EOF", "adoEOF") + +bool open(char* username, char* password, char* dbname, char* ip); +_RecordsetPtr& execute(_bstr_t SQL); +/** +* IJѯSQL. +* @param SQL - SQL +* @param inputValueCount - +* @param inputValue - ֵ +* @param outputColumn - е +* @param outputValueCount - е +* @param outputValue - +* @return - OCI_OK or error code +* +* ORACLE ݿװ +*/ +int QuerySQL(char *SQL, int inputValueCount, char ** inputValue, int * outputColumn, int * outputValueCount, char **** outputValue); + +int QuerySQLNoInputParam(char *SQL, int * outputColumn, int * outputValueCount, char **** outputValue); +// ִ +int ExecuteSQL(char *SQL, int valueCount, char **value); +/** +* ִSQL. +* @param SQL - SQL +* @return - OCI_OK or error code +* +* ORACLE ݿװ +*/ +int ExecuteSQLNoInputParam(char *SQL); +/** +* Ͽݿ. +* +* ORACLE ݿװ +*/ +void close(); \ No newline at end of file diff --git a/connor_signature/autolink.h b/connor_signature/autolink.h new file mode 100644 index 0000000..37c9258 --- /dev/null +++ b/connor_signature/autolink.h @@ -0,0 +1,19 @@ +#ifndef JSON_AUTOLINK_H_INCLUDED +# define JSON_AUTOLINK_H_INCLUDED + +# include "config.h" + +# ifdef JSON_IN_CPPTL +# include +# endif + +# if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && !defined(JSON_IN_CPPTL) +# define CPPTL_AUTOLINK_NAME "json" +# undef CPPTL_AUTOLINK_DLL +# ifdef JSON_DLL +# define CPPTL_AUTOLINK_DLL +# endif +# include "autolink.h" +# endif + +#endif // JSON_AUTOLINK_H_INCLUDED diff --git a/connor_signature/config.h b/connor_signature/config.h new file mode 100644 index 0000000..5d334cb --- /dev/null +++ b/connor_signature/config.h @@ -0,0 +1,43 @@ +#ifndef JSON_CONFIG_H_INCLUDED +# define JSON_CONFIG_H_INCLUDED + +/// If defined, indicates that json library is embedded in CppTL library. +//# define JSON_IN_CPPTL 1 + +/// If defined, indicates that json may leverage CppTL library +//# define JSON_USE_CPPTL 1 +/// If defined, indicates that cpptl vector based map should be used instead of std::map +/// as Value container. +//# define JSON_USE_CPPTL_SMALLMAP 1 +/// If defined, indicates that Json specific container should be used +/// (hash table & simple deque container with customizable allocator). +/// THIS FEATURE IS STILL EXPERIMENTAL! +//# define JSON_VALUE_USE_INTERNAL_MAP 1 +/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. +/// The memory pools allocator used optimization (initializing Value and ValueInternalLink +/// as if it was a POD) that may cause some validation tool to report errors. +/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. +//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 + +/// If defined, indicates that Json use exception to report invalid type manipulation +/// instead of C assert macro. +# define JSON_USE_EXCEPTION 1 + +# ifdef JSON_IN_CPPTL +# include +# ifndef JSON_USE_CPPTL +# define JSON_USE_CPPTL 1 +# endif +# endif + +# ifdef JSON_IN_CPPTL +# define JSON_API CPPTL_API +# elif defined(JSON_DLL_BUILD) +# define JSON_API __declspec(dllexport) +# elif defined(JSON_DLL) +# define JSON_API __declspec(dllimport) +# else +# define JSON_API +# endif + +#endif // JSON_CONFIG_H_INCLUDED diff --git a/connor_signature/connor_clear_master.cpp b/connor_signature/connor_clear_master.cpp new file mode 100644 index 0000000..e69de29 diff --git a/connor_signature/connor_signature.vcxproj b/connor_signature/connor_signature.vcxproj new file mode 100644 index 0000000..5f100d6 --- /dev/null +++ b/connor_signature/connor_signature.vcxproj @@ -0,0 +1,212 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {87A8539F-972D-4E90-844B-DABEE71C1D40} + Win32Proj + connor_signature + ld_itk_c + 10.0 + + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + false + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CONNOR_SIGNATURE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CONNOR_SIGNATURE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CONNOR_SIGNATURE_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CONNOR_SIGNATURE_EXPORTS;IPLIB=none;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + D:\include13\13\include;D:\include13\13\include_cpp;D:\dflittk\oci\include;D:\WorkEnvironment\tc13ITK\include;D:\WorkEnvironment\tc13ITK\include_cpp;D:\WorkEnvironment\tc13ITK\oci\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + false + + + Windows + true + true + true + D:\include13\13\lib\*.lib;D:\WorkEnvironment\tc13ITK\lib\*.lib;%(AdditionalDependencies) + libuser_exits.ar.lib + $(OutDir)$(TargetName)$(TargetExt) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/connor_signature/connor_signature.vcxproj.filters b/connor_signature/connor_signature.vcxproj.filters new file mode 100644 index 0000000..4d8aca6 --- /dev/null +++ b/connor_signature/connor_signature.vcxproj.filters @@ -0,0 +1,170 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {5a9d0713-46ed-4d01-9976-96843444adb3} + + + {a3b918fb-f652-44f5-ade5-7d72f29a86e1} + + + + + + + + 源文件 + + + 源文件 + + + lib_json + + + lib_json + + + lib_json + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + json + + + json + + + json + + + json + + + json + + + json + + + json + + + json + + + lib_json + + + 头文件 + + + 头文件 + + + 头文件 + + + + + lib_json + + + lib_json + + + lib_json + + + lib_json + + + \ No newline at end of file diff --git a/connor_signature/connor_signature.vcxproj.user b/connor_signature/connor_signature.vcxproj.user new file mode 100644 index 0000000..a11cd7f --- /dev/null +++ b/connor_signature/connor_signature.vcxproj.user @@ -0,0 +1,6 @@ + + + + true + + \ No newline at end of file diff --git a/connor_signature/features.h b/connor_signature/features.h new file mode 100644 index 0000000..5a9adec --- /dev/null +++ b/connor_signature/features.h @@ -0,0 +1,42 @@ +#ifndef CPPTL_JSON_FEATURES_H_INCLUDED +# define CPPTL_JSON_FEATURES_H_INCLUDED + +# include "forwards.h" + +namespace Json { + + /** \brief Configuration passed to reader and writer. + * This configuration object can be used to force the Reader or Writer + * to behave in a standard conforming way. + */ + class JSON_API Features + { + public: + /** \brief A configuration that allows all features and assumes all strings are UTF-8. + * - C & C++ comments are allowed + * - Root object can be any JSON value + * - Assumes Value strings are encoded in UTF-8 + */ + static Features all(); + + /** \brief A configuration that is strictly compatible with the JSON specification. + * - Comments are forbidden. + * - Root object must be either an array or an object value. + * - Assumes Value strings are encoded in UTF-8 + */ + static Features strictMode(); + + /** \brief Initialize the configuration like JsonConfig::allFeatures; + */ + Features(); + + /// \c true if comments are allowed. Default: \c true. + bool allowComments_; + + /// \c true if root must be either an array or an object value. Default: \c false. + bool strictRoot_; + }; + +} // namespace Json + +#endif // CPPTL_JSON_FEATURES_H_INCLUDED diff --git a/connor_signature/forwards.h b/connor_signature/forwards.h new file mode 100644 index 0000000..d0ce830 --- /dev/null +++ b/connor_signature/forwards.h @@ -0,0 +1,39 @@ +#ifndef JSON_FORWARDS_H_INCLUDED +# define JSON_FORWARDS_H_INCLUDED + +# include "config.h" + +namespace Json { + + // writer.h + class FastWriter; + class StyledWriter; + + // reader.h + class Reader; + + // features.h + class Features; + + // value.h + typedef int Int; + typedef unsigned int UInt; + class StaticString; + class Path; + class PathArgument; + class Value; + class ValueIteratorBase; + class ValueIterator; + class ValueConstIterator; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + class ValueAllocator; + class ValueMapAllocator; + class ValueInternalLink; + class ValueInternalArray; + class ValueInternalMap; +#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP + +} // namespace Json + + +#endif // JSON_FORWARDS_H_INCLUDED diff --git a/connor_signature/handler.h b/connor_signature/handler.h new file mode 100644 index 0000000..e99b819 --- /dev/null +++ b/connor_signature/handler.h @@ -0,0 +1,110 @@ +#include "kutil.h" + +#pragma once +#include +#include +#include +#include +#include
+#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ocilib.h" + +int ML_append_code(EPM_action_message_t msg); +int CONNOR_SIGN_MASTER(EPM_action_message_t msg); +int CONNOR_CLEAR_MASTER(EPM_action_message_t msg); +int CONNOR_REVISE_CLEAR_FORM(METHOD_message_t msg,va_list args); +int CONNOR_Signature_WORD(EPM_action_message_t msg); +int CONNOR_AVIC_CATIASIGN(EPM_action_message_t msg); +extern int K_add_release_status(void * return_data); +int CONNOR_SIGN_PRE_REVISION(EPM_action_message_t msg); +int QF8_WGJ_check(EPM_action_message_t msg); +int connor_set_prop_value(void *returnValue); +int ML_update_currentState(EPM_action_message_t msg); +int ML_WBS(EPM_action_message_t msg); +int ML_ProductCode(EPM_action_message_t msg); +int ML_nowtime(EPM_action_message_t msg); +int ML_sendToWeixin(EPM_action_message_t msg); +int ML_sendToPutinfo(EPM_action_message_t msg); +int ML_update_CChosenRevision(EPM_action_message_t msg); +int ML_sendByProposer(EPM_action_message_t msg); +int ML_sendChangeOrder(EPM_action_message_t msg); +int ML_createProjectForm(EPM_action_message_t msg); +int ML_handler266(EPM_action_message_t msg); +int ML_1106(EPM_action_message_t msg); +int ML_sendToQMS(EPM_action_message_t msg); +int ML_1128(EPM_action_message_t msg); +int ML_1207(EPM_action_message_t msg); +int ML_1214(EPM_action_message_t msg); +int ML_1215(EPM_action_message_t msg); +int ML_1216(EPM_action_message_t msg); +int ML_loginCheck(EPM_action_message_t msg); +int ML_1217(EPM_action_message_t msg); +int ML_checkState(EPM_action_message_t msg); +int ML_1227(EPM_action_message_t msg); +int ML_ItemRevPreUpdate(METHOD_message_t* msg, va_list args); +int ML_ChildGeneralIdentify(EPM_action_message_t msg); +int PLM_TO_OA(EPM_action_message_t msg); +int PLM_TO_SAP_NEW(EPM_action_message_t msg); +int PLM_TO_SAP_Revise(EPM_action_message_t msg); +int PLM_TO_SAP_Disuse(EPM_action_message_t msg); +int PLM_MBOM_TO_SAP_NEW(EPM_action_message_t msg); +int PLM_MBOM_TO_SAP_Revise(EPM_action_message_t msg); +int PLM_FBMBOM_TO_SAP(EPM_action_message_t msg); +int PLM_BZGX_TO_SAP(EPM_action_message_t msg); +int TEST(EPM_action_message_t msg); +int RK_getProjectData(void* returnValue); +int RK_getProjectAssignId(void* returnValue); +int RK_getProjectIdAndName(void* returnValue); +int Raycus_auto_TBYWL(EPM_action_message_t msg); +int RK_attach_assembly_components(EPM_action_message_t msg); +int RK_Assign_Inform(EPM_action_message_t msg); +int Connor_Review_Person(EPM_action_message_t msg); +int Connor_allow_Workflow(EPM_action_message_t msg); +int LD_FormAttrToExcel(EPM_action_message_t msg); +int LD_PartCompFLAG(EPM_action_message_t msg); +int LD_SendDJJDD_To_MES(EPM_action_message_t msg); +int UpgradeTask(EPM_action_message_t msg); +int LD_PartChange(EPM_action_message_t msg); +int ML_ItemRevSave(METHOD_message_t* msg, va_list args); +int LD_ElevateTask(EPM_action_message_t msg); +int LD_AutoAssign(EPM_action_message_t msg); +int reviseDesignPost(METHOD_message_t* msg, va_list va); +int uploadFile(void* returnValue); +int LD_ECN01_SetCICNFormProperty(EPM_action_message_t msg); +int LD_515_SetCICNFormProperty(EPM_action_message_t msg); +int LD_SendECRECN_ToSAPMES(EPM_action_message_t msg); +int LD_GYLXFrozen(EPM_action_message_t msg); +int LD_CompletionDate(EPM_action_message_t msg); +int LD_TaskAssignmentDate(EPM_action_message_t msg); +int SH_PLM_Email(EPM_action_message_t msg); +//int LD6_CusProdFolderSave(METHOD_message_t* msg, va_list args); \ No newline at end of file diff --git a/connor_signature/json.h b/connor_signature/json.h new file mode 100644 index 0000000..c71ed65 --- /dev/null +++ b/connor_signature/json.h @@ -0,0 +1,10 @@ +#ifndef JSON_JSON_H_INCLUDED +# define JSON_JSON_H_INCLUDED + +# include "autolink.h" +# include "value.h" +# include "reader.h" +# include "writer.h" +# include "features.h" + +#endif // JSON_JSON_H_INCLUDED diff --git a/connor_signature/json_batchallocator.h b/connor_signature/json_batchallocator.h new file mode 100644 index 0000000..87ea5ed --- /dev/null +++ b/connor_signature/json_batchallocator.h @@ -0,0 +1,125 @@ +#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED +# define JSONCPP_BATCHALLOCATOR_H_INCLUDED + +# include +# include + +# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + +namespace Json { + +/* Fast memory allocator. + * + * This memory allocator allocates memory for a batch of object (specified by + * the page size, the number of object in each page). + * + * It does not allow the destruction of a single object. All the allocated objects + * can be destroyed at once. The memory can be either released or reused for future + * allocation. + * + * The in-place new operator must be used to construct the object using the pointer + * returned by allocate. + */ +template +class BatchAllocator +{ +public: + typedef AllocatedType Type; + + BatchAllocator( unsigned int objectsPerPage = 255 ) + : freeHead_( 0 ) + , objectsPerPage_( objectsPerPage ) + { +// printf( "Size: %d => %s\n", sizeof(AllocatedType), typeid(AllocatedType).name() ); + assert( sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *) ); // We must be able to store a slist in the object free space. + assert( objectsPerPage >= 16 ); + batches_ = allocateBatch( 0 ); // allocated a dummy page + currentBatch_ = batches_; + } + + ~BatchAllocator() + { + for ( BatchInfo *batch = batches_; batch; ) + { + BatchInfo *nextBatch = batch->next_; + free( batch ); + batch = nextBatch; + } + } + + /// allocate space for an array of objectPerAllocation object. + /// @warning it is the responsability of the caller to call objects constructors. + AllocatedType *allocate() + { + if ( freeHead_ ) // returns node from free list. + { + AllocatedType *object = freeHead_; + freeHead_ = *(AllocatedType **)object; + return object; + } + if ( currentBatch_->used_ == currentBatch_->end_ ) + { + currentBatch_ = currentBatch_->next_; + while ( currentBatch_ && currentBatch_->used_ == currentBatch_->end_ ) + currentBatch_ = currentBatch_->next_; + + if ( !currentBatch_ ) // no free batch found, allocate a new one + { + currentBatch_ = allocateBatch( objectsPerPage_ ); + currentBatch_->next_ = batches_; // insert at the head of the list + batches_ = currentBatch_; + } + } + AllocatedType *allocated = currentBatch_->used_; + currentBatch_->used_ += objectPerAllocation; + return allocated; + } + + /// Release the object. + /// @warning it is the responsability of the caller to actually destruct the object. + void release( AllocatedType *object ) + { + assert( object != 0 ); + *(AllocatedType **)object = freeHead_; + freeHead_ = object; + } + +private: + struct BatchInfo + { + BatchInfo *next_; + AllocatedType *used_; + AllocatedType *end_; + AllocatedType buffer_[objectPerAllocation]; + }; + + // disabled copy constructor and assignement operator. + BatchAllocator( const BatchAllocator & ); + void operator =( const BatchAllocator &); + + static BatchInfo *allocateBatch( unsigned int objectsPerPage ) + { + const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType)* objectPerAllocation + + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; + BatchInfo *batch = static_cast( malloc( mallocSize ) ); + batch->next_ = 0; + batch->used_ = batch->buffer_; + batch->end_ = batch->buffer_ + objectsPerPage; + return batch; + } + + BatchInfo *batches_; + BatchInfo *currentBatch_; + /// Head of a single linked list within the allocated space of freeed object + AllocatedType *freeHead_; + unsigned int objectsPerPage_; +}; + + +} // namespace Json + +# endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION + +#endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED + diff --git a/connor_signature/json_internalarray.inl b/connor_signature/json_internalarray.inl new file mode 100644 index 0000000..9b985d2 --- /dev/null +++ b/connor_signature/json_internalarray.inl @@ -0,0 +1,448 @@ +// included by json_value.cpp +// everything is within Json namespace + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueInternalArray +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueArrayAllocator::~ValueArrayAllocator() +{ +} + +// ////////////////////////////////////////////////////////////////// +// class DefaultValueArrayAllocator +// ////////////////////////////////////////////////////////////////// +#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +class DefaultValueArrayAllocator : public ValueArrayAllocator +{ +public: // overridden from ValueArrayAllocator + virtual ~DefaultValueArrayAllocator() + { + } + + virtual ValueInternalArray *newArray() + { + return new ValueInternalArray(); + } + + virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) + { + return new ValueInternalArray( other ); + } + + virtual void destructArray( ValueInternalArray *array ) + { + delete array; + } + + virtual void reallocateArrayPageIndex( Value **&indexes, + ValueInternalArray::PageIndex &indexCount, + ValueInternalArray::PageIndex minNewIndexCount ) + { + ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; + if ( minNewIndexCount > newIndexCount ) + newIndexCount = minNewIndexCount; + void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); + if ( !newIndexes ) + throw std::bad_alloc(); + indexCount = newIndexCount; + indexes = static_cast( newIndexes ); + } + virtual void releaseArrayPageIndex( Value **indexes, + ValueInternalArray::PageIndex indexCount ) + { + if ( indexes ) + free( indexes ); + } + + virtual Value *allocateArrayPage() + { + return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); + } + + virtual void releaseArrayPage( Value *value ) + { + if ( value ) + free( value ); + } +}; + +#else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +/// @todo make this thread-safe (lock when accessign batch allocator) +class DefaultValueArrayAllocator : public ValueArrayAllocator +{ +public: // overridden from ValueArrayAllocator + virtual ~DefaultValueArrayAllocator() + { + } + + virtual ValueInternalArray *newArray() + { + ValueInternalArray *array = arraysAllocator_.allocate(); + new (array) ValueInternalArray(); // placement new + return array; + } + + virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) + { + ValueInternalArray *array = arraysAllocator_.allocate(); + new (array) ValueInternalArray( other ); // placement new + return array; + } + + virtual void destructArray( ValueInternalArray *array ) + { + if ( array ) + { + array->~ValueInternalArray(); + arraysAllocator_.release( array ); + } + } + + virtual void reallocateArrayPageIndex( Value **&indexes, + ValueInternalArray::PageIndex &indexCount, + ValueInternalArray::PageIndex minNewIndexCount ) + { + ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; + if ( minNewIndexCount > newIndexCount ) + newIndexCount = minNewIndexCount; + void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); + if ( !newIndexes ) + throw std::bad_alloc(); + indexCount = newIndexCount; + indexes = static_cast( newIndexes ); + } + virtual void releaseArrayPageIndex( Value **indexes, + ValueInternalArray::PageIndex indexCount ) + { + if ( indexes ) + free( indexes ); + } + + virtual Value *allocateArrayPage() + { + return static_cast( pagesAllocator_.allocate() ); + } + + virtual void releaseArrayPage( Value *value ) + { + if ( value ) + pagesAllocator_.release( value ); + } +private: + BatchAllocator arraysAllocator_; + BatchAllocator pagesAllocator_; +}; +#endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR + +static ValueArrayAllocator *&arrayAllocator() +{ + static DefaultValueArrayAllocator defaultAllocator; + static ValueArrayAllocator *arrayAllocator = &defaultAllocator; + return arrayAllocator; +} + +static struct DummyArrayAllocatorInitializer { + DummyArrayAllocatorInitializer() + { + arrayAllocator(); // ensure arrayAllocator() statics are initialized before main(). + } +} dummyArrayAllocatorInitializer; + +// ////////////////////////////////////////////////////////////////// +// class ValueInternalArray +// ////////////////////////////////////////////////////////////////// +bool +ValueInternalArray::equals( const IteratorState &x, + const IteratorState &other ) +{ + return x.array_ == other.array_ + && x.currentItemIndex_ == other.currentItemIndex_ + && x.currentPageIndex_ == other.currentPageIndex_; +} + + +void +ValueInternalArray::increment( IteratorState &it ) +{ + JSON_ASSERT_MESSAGE( it.array_ && + (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ + != it.array_->size_, + "ValueInternalArray::increment(): moving iterator beyond end" ); + ++(it.currentItemIndex_); + if ( it.currentItemIndex_ == itemsPerPage ) + { + it.currentItemIndex_ = 0; + ++(it.currentPageIndex_); + } +} + + +void +ValueInternalArray::decrement( IteratorState &it ) +{ + JSON_ASSERT_MESSAGE( it.array_ && it.currentPageIndex_ == it.array_->pages_ + && it.currentItemIndex_ == 0, + "ValueInternalArray::decrement(): moving iterator beyond end" ); + if ( it.currentItemIndex_ == 0 ) + { + it.currentItemIndex_ = itemsPerPage-1; + --(it.currentPageIndex_); + } + else + { + --(it.currentItemIndex_); + } +} + + +Value & +ValueInternalArray::unsafeDereference( const IteratorState &it ) +{ + return (*(it.currentPageIndex_))[it.currentItemIndex_]; +} + + +Value & +ValueInternalArray::dereference( const IteratorState &it ) +{ + JSON_ASSERT_MESSAGE( it.array_ && + (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ + < it.array_->size_, + "ValueInternalArray::dereference(): dereferencing invalid iterator" ); + return unsafeDereference( it ); +} + +void +ValueInternalArray::makeBeginIterator( IteratorState &it ) const +{ + it.array_ = const_cast( this ); + it.currentItemIndex_ = 0; + it.currentPageIndex_ = pages_; +} + + +void +ValueInternalArray::makeIterator( IteratorState &it, ArrayIndex index ) const +{ + it.array_ = const_cast( this ); + it.currentItemIndex_ = index % itemsPerPage; + it.currentPageIndex_ = pages_ + index / itemsPerPage; +} + + +void +ValueInternalArray::makeEndIterator( IteratorState &it ) const +{ + makeIterator( it, size_ ); +} + + +ValueInternalArray::ValueInternalArray() + : pages_( 0 ) + , size_( 0 ) + , pageCount_( 0 ) +{ +} + + +ValueInternalArray::ValueInternalArray( const ValueInternalArray &other ) + : pages_( 0 ) + , pageCount_( 0 ) + , size_( other.size_ ) +{ + PageIndex minNewPages = other.size_ / itemsPerPage; + arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); + JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, + "ValueInternalArray::reserve(): bad reallocation" ); + IteratorState itOther; + other.makeBeginIterator( itOther ); + Value *value; + for ( ArrayIndex index = 0; index < size_; ++index, increment(itOther) ) + { + if ( index % itemsPerPage == 0 ) + { + PageIndex pageIndex = index / itemsPerPage; + value = arrayAllocator()->allocateArrayPage(); + pages_[pageIndex] = value; + } + new (value) Value( dereference( itOther ) ); + } +} + + +ValueInternalArray & +ValueInternalArray::operator =( const ValueInternalArray &other ) +{ + ValueInternalArray temp( other ); + swap( temp ); + return *this; +} + + +ValueInternalArray::~ValueInternalArray() +{ + // destroy all constructed items + IteratorState it; + IteratorState itEnd; + makeBeginIterator( it); + makeEndIterator( itEnd ); + for ( ; !equals(it,itEnd); increment(it) ) + { + Value *value = &dereference(it); + value->~Value(); + } + // release all pages + PageIndex lastPageIndex = size_ / itemsPerPage; + for ( PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex ) + arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); + // release pages index + arrayAllocator()->releaseArrayPageIndex( pages_, pageCount_ ); +} + + +void +ValueInternalArray::swap( ValueInternalArray &other ) +{ + Value **tempPages = pages_; + pages_ = other.pages_; + other.pages_ = tempPages; + ArrayIndex tempSize = size_; + size_ = other.size_; + other.size_ = tempSize; + PageIndex tempPageCount = pageCount_; + pageCount_ = other.pageCount_; + other.pageCount_ = tempPageCount; +} + +void +ValueInternalArray::clear() +{ + ValueInternalArray dummy; + swap( dummy ); +} + + +void +ValueInternalArray::resize( ArrayIndex newSize ) +{ + if ( newSize == 0 ) + clear(); + else if ( newSize < size_ ) + { + IteratorState it; + IteratorState itEnd; + makeIterator( it, newSize ); + makeIterator( itEnd, size_ ); + for ( ; !equals(it,itEnd); increment(it) ) + { + Value *value = &dereference(it); + value->~Value(); + } + PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage; + PageIndex lastPageIndex = size_ / itemsPerPage; + for ( ; pageIndex < lastPageIndex; ++pageIndex ) + arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); + size_ = newSize; + } + else if ( newSize > size_ ) + resolveReference( newSize ); +} + + +void +ValueInternalArray::makeIndexValid( ArrayIndex index ) +{ + // Need to enlarge page index ? + if ( index >= pageCount_ * itemsPerPage ) + { + PageIndex minNewPages = (index + 1) / itemsPerPage; + arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); + JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); + } + + // Need to allocate new pages ? + ArrayIndex nextPageIndex = + (size_ % itemsPerPage) != 0 ? size_ - (size_%itemsPerPage) + itemsPerPage + : size_; + if ( nextPageIndex <= index ) + { + PageIndex pageIndex = nextPageIndex / itemsPerPage; + PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1; + for ( ; pageToAllocate-- > 0; ++pageIndex ) + pages_[pageIndex] = arrayAllocator()->allocateArrayPage(); + } + + // Initialize all new entries + IteratorState it; + IteratorState itEnd; + makeIterator( it, size_ ); + size_ = index + 1; + makeIterator( itEnd, size_ ); + for ( ; !equals(it,itEnd); increment(it) ) + { + Value *value = &dereference(it); + new (value) Value(); // Construct a default value using placement new + } +} + +Value & +ValueInternalArray::resolveReference( ArrayIndex index ) +{ + if ( index >= size_ ) + makeIndexValid( index ); + return pages_[index/itemsPerPage][index%itemsPerPage]; +} + +Value * +ValueInternalArray::find( ArrayIndex index ) const +{ + if ( index >= size_ ) + return 0; + return &(pages_[index/itemsPerPage][index%itemsPerPage]); +} + +ValueInternalArray::ArrayIndex +ValueInternalArray::size() const +{ + return size_; +} + +int +ValueInternalArray::distance( const IteratorState &x, const IteratorState &y ) +{ + return indexOf(y) - indexOf(x); +} + + +ValueInternalArray::ArrayIndex +ValueInternalArray::indexOf( const IteratorState &iterator ) +{ + if ( !iterator.array_ ) + return ArrayIndex(-1); + return ArrayIndex( + (iterator.currentPageIndex_ - iterator.array_->pages_) * itemsPerPage + + iterator.currentItemIndex_ ); +} + + +int +ValueInternalArray::compare( const ValueInternalArray &other ) const +{ + int sizeDiff( size_ - other.size_ ); + if ( sizeDiff != 0 ) + return sizeDiff; + + for ( ArrayIndex index =0; index < size_; ++index ) + { + int diff = pages_[index/itemsPerPage][index%itemsPerPage].compare( + other.pages_[index/itemsPerPage][index%itemsPerPage] ); + if ( diff != 0 ) + return diff; + } + return 0; +} diff --git a/connor_signature/json_internalmap.inl b/connor_signature/json_internalmap.inl new file mode 100644 index 0000000..1977148 --- /dev/null +++ b/connor_signature/json_internalmap.inl @@ -0,0 +1,607 @@ +// included by json_value.cpp +// everything is within Json namespace + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueInternalMap +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +/** \internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) ); + * This optimization is used by the fast allocator. + */ +ValueInternalLink::ValueInternalLink() + : previous_( 0 ) + , next_( 0 ) +{ +} + +ValueInternalLink::~ValueInternalLink() +{ + for ( int index =0; index < itemPerLink; ++index ) + { + if ( !items_[index].isItemAvailable() ) + { + if ( !items_[index].isMemberNameStatic() ) + free( keys_[index] ); + } + else + break; + } +} + + + +ValueMapAllocator::~ValueMapAllocator() +{ +} + +#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +class DefaultValueMapAllocator : public ValueMapAllocator +{ +public: // overridden from ValueMapAllocator + virtual ValueInternalMap *newMap() + { + return new ValueInternalMap(); + } + + virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) + { + return new ValueInternalMap( other ); + } + + virtual void destructMap( ValueInternalMap *map ) + { + delete map; + } + + virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) + { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets( ValueInternalLink *links ) + { + delete [] links; + } + + virtual ValueInternalLink *allocateMapLink() + { + return new ValueInternalLink(); + } + + virtual void releaseMapLink( ValueInternalLink *link ) + { + delete link; + } +}; +#else +/// @todo make this thread-safe (lock when accessign batch allocator) +class DefaultValueMapAllocator : public ValueMapAllocator +{ +public: // overridden from ValueMapAllocator + virtual ValueInternalMap *newMap() + { + ValueInternalMap *map = mapsAllocator_.allocate(); + new (map) ValueInternalMap(); // placement new + return map; + } + + virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) + { + ValueInternalMap *map = mapsAllocator_.allocate(); + new (map) ValueInternalMap( other ); // placement new + return map; + } + + virtual void destructMap( ValueInternalMap *map ) + { + if ( map ) + { + map->~ValueInternalMap(); + mapsAllocator_.release( map ); + } + } + + virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) + { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets( ValueInternalLink *links ) + { + delete [] links; + } + + virtual ValueInternalLink *allocateMapLink() + { + ValueInternalLink *link = linksAllocator_.allocate(); + memset( link, 0, sizeof(ValueInternalLink) ); + return link; + } + + virtual void releaseMapLink( ValueInternalLink *link ) + { + link->~ValueInternalLink(); + linksAllocator_.release( link ); + } +private: + BatchAllocator mapsAllocator_; + BatchAllocator linksAllocator_; +}; +#endif + +static ValueMapAllocator *&mapAllocator() +{ + static DefaultValueMapAllocator defaultAllocator; + static ValueMapAllocator *mapAllocator = &defaultAllocator; + return mapAllocator; +} + +static struct DummyMapAllocatorInitializer { + DummyMapAllocatorInitializer() + { + mapAllocator(); // ensure mapAllocator() statics are initialized before main(). + } +} dummyMapAllocatorInitializer; + + + +// h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32. + +/* +use linked list hash map. +buckets array is a container. +linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124) +value have extra state: valid, available, deleted +*/ + + +ValueInternalMap::ValueInternalMap() + : buckets_( 0 ) + , tailLink_( 0 ) + , bucketsSize_( 0 ) + , itemCount_( 0 ) +{ +} + + +ValueInternalMap::ValueInternalMap( const ValueInternalMap &other ) + : buckets_( 0 ) + , tailLink_( 0 ) + , bucketsSize_( 0 ) + , itemCount_( 0 ) +{ + reserve( other.itemCount_ ); + IteratorState it; + IteratorState itEnd; + other.makeBeginIterator( it ); + other.makeEndIterator( itEnd ); + for ( ; !equals(it,itEnd); increment(it) ) + { + bool isStatic; + const char *memberName = key( it, isStatic ); + const Value &aValue = value( it ); + resolveReference(memberName, isStatic) = aValue; + } +} + + +ValueInternalMap & +ValueInternalMap::operator =( const ValueInternalMap &other ) +{ + ValueInternalMap dummy( other ); + swap( dummy ); + return *this; +} + + +ValueInternalMap::~ValueInternalMap() +{ + if ( buckets_ ) + { + for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex ) + { + ValueInternalLink *link = buckets_[bucketIndex].next_; + while ( link ) + { + ValueInternalLink *linkToRelease = link; + link = link->next_; + mapAllocator()->releaseMapLink( linkToRelease ); + } + } + mapAllocator()->releaseMapBuckets( buckets_ ); + } +} + + +void +ValueInternalMap::swap( ValueInternalMap &other ) +{ + ValueInternalLink *tempBuckets = buckets_; + buckets_ = other.buckets_; + other.buckets_ = tempBuckets; + ValueInternalLink *tempTailLink = tailLink_; + tailLink_ = other.tailLink_; + other.tailLink_ = tempTailLink; + BucketIndex tempBucketsSize = bucketsSize_; + bucketsSize_ = other.bucketsSize_; + other.bucketsSize_ = tempBucketsSize; + BucketIndex tempItemCount = itemCount_; + itemCount_ = other.itemCount_; + other.itemCount_ = tempItemCount; +} + + +void +ValueInternalMap::clear() +{ + ValueInternalMap dummy; + swap( dummy ); +} + + +ValueInternalMap::BucketIndex +ValueInternalMap::size() const +{ + return itemCount_; +} + +bool +ValueInternalMap::reserveDelta( BucketIndex growth ) +{ + return reserve( itemCount_ + growth ); +} + +bool +ValueInternalMap::reserve( BucketIndex newItemCount ) +{ + if ( !buckets_ && newItemCount > 0 ) + { + buckets_ = mapAllocator()->allocateMapBuckets( 1 ); + bucketsSize_ = 1; + tailLink_ = &buckets_[0]; + } +// BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink; + return true; +} + + +const Value * +ValueInternalMap::find( const char *key ) const +{ + if ( !bucketsSize_ ) + return 0; + HashKey hashedKey = hash( key ); + BucketIndex bucketIndex = hashedKey % bucketsSize_; + for ( const ValueInternalLink *current = &buckets_[bucketIndex]; + current != 0; + current = current->next_ ) + { + for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index ) + { + if ( current->items_[index].isItemAvailable() ) + return 0; + if ( strcmp( key, current->keys_[index] ) == 0 ) + return ¤t->items_[index]; + } + } + return 0; +} + + +Value * +ValueInternalMap::find( const char *key ) +{ + const ValueInternalMap *constThis = this; + return const_cast( constThis->find( key ) ); +} + + +Value & +ValueInternalMap::resolveReference( const char *key, + bool isStatic ) +{ + HashKey hashedKey = hash( key ); + if ( bucketsSize_ ) + { + BucketIndex bucketIndex = hashedKey % bucketsSize_; + ValueInternalLink **previous = 0; + BucketIndex index; + for ( ValueInternalLink *current = &buckets_[bucketIndex]; + current != 0; + previous = ¤t->next_, current = current->next_ ) + { + for ( index=0; index < ValueInternalLink::itemPerLink; ++index ) + { + if ( current->items_[index].isItemAvailable() ) + return setNewItem( key, isStatic, current, index ); + if ( strcmp( key, current->keys_[index] ) == 0 ) + return current->items_[index]; + } + } + } + + reserveDelta( 1 ); + return unsafeAdd( key, isStatic, hashedKey ); +} + + +void +ValueInternalMap::remove( const char *key ) +{ + HashKey hashedKey = hash( key ); + if ( !bucketsSize_ ) + return; + BucketIndex bucketIndex = hashedKey % bucketsSize_; + for ( ValueInternalLink *link = &buckets_[bucketIndex]; + link != 0; + link = link->next_ ) + { + BucketIndex index; + for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) + { + if ( link->items_[index].isItemAvailable() ) + return; + if ( strcmp( key, link->keys_[index] ) == 0 ) + { + doActualRemove( link, index, bucketIndex ); + return; + } + } + } +} + +void +ValueInternalMap::doActualRemove( ValueInternalLink *link, + BucketIndex index, + BucketIndex bucketIndex ) +{ + // find last item of the bucket and swap it with the 'removed' one. + // set removed items flags to 'available'. + // if last page only contains 'available' items, then desallocate it (it's empty) + ValueInternalLink *&lastLink = getLastLinkInBucket( index ); + BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1 + for ( ; + lastItemIndex < ValueInternalLink::itemPerLink; + ++lastItemIndex ) // may be optimized with dicotomic search + { + if ( lastLink->items_[lastItemIndex].isItemAvailable() ) + break; + } + + BucketIndex lastUsedIndex = lastItemIndex - 1; + Value *valueToDelete = &link->items_[index]; + Value *valueToPreserve = &lastLink->items_[lastUsedIndex]; + if ( valueToDelete != valueToPreserve ) + valueToDelete->swap( *valueToPreserve ); + if ( lastUsedIndex == 0 ) // page is now empty + { // remove it from bucket linked list and delete it. + ValueInternalLink *linkPreviousToLast = lastLink->previous_; + if ( linkPreviousToLast != 0 ) // can not deleted bucket link. + { + mapAllocator()->releaseMapLink( lastLink ); + linkPreviousToLast->next_ = 0; + lastLink = linkPreviousToLast; + } + } + else + { + Value dummy; + valueToPreserve->swap( dummy ); // restore deleted to default Value. + valueToPreserve->setItemUsed( false ); + } + --itemCount_; +} + + +ValueInternalLink *& +ValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex ) +{ + if ( bucketIndex == bucketsSize_ - 1 ) + return tailLink_; + ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_; + if ( !previous ) + previous = &buckets_[bucketIndex]; + return previous; +} + + +Value & +ValueInternalMap::setNewItem( const char *key, + bool isStatic, + ValueInternalLink *link, + BucketIndex index ) +{ + char *duplicatedKey = valueAllocator()->makeMemberName( key ); + ++itemCount_; + link->keys_[index] = duplicatedKey; + link->items_[index].setItemUsed(); + link->items_[index].setMemberNameIsStatic( isStatic ); + return link->items_[index]; // items already default constructed. +} + + +Value & +ValueInternalMap::unsafeAdd( const char *key, + bool isStatic, + HashKey hashedKey ) +{ + JSON_ASSERT_MESSAGE( bucketsSize_ > 0, "ValueInternalMap::unsafeAdd(): internal logic error." ); + BucketIndex bucketIndex = hashedKey % bucketsSize_; + ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex ); + ValueInternalLink *link = previousLink; + BucketIndex index; + for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) + { + if ( link->items_[index].isItemAvailable() ) + break; + } + if ( index == ValueInternalLink::itemPerLink ) // need to add a new page + { + ValueInternalLink *newLink = mapAllocator()->allocateMapLink(); + index = 0; + link->next_ = newLink; + previousLink = newLink; + link = newLink; + } + return setNewItem( key, isStatic, link, index ); +} + + +ValueInternalMap::HashKey +ValueInternalMap::hash( const char *key ) const +{ + HashKey hash = 0; + while ( *key ) + hash += *key++ * 37; + return hash; +} + + +int +ValueInternalMap::compare( const ValueInternalMap &other ) const +{ + int sizeDiff( itemCount_ - other.itemCount_ ); + if ( sizeDiff != 0 ) + return sizeDiff; + // Strict order guaranty is required. Compare all keys FIRST, then compare values. + IteratorState it; + IteratorState itEnd; + makeBeginIterator( it ); + makeEndIterator( itEnd ); + for ( ; !equals(it,itEnd); increment(it) ) + { + if ( !other.find( key( it ) ) ) + return 1; + } + + // All keys are equals, let's compare values + makeBeginIterator( it ); + for ( ; !equals(it,itEnd); increment(it) ) + { + const Value *otherValue = other.find( key( it ) ); + int valueDiff = value(it).compare( *otherValue ); + if ( valueDiff != 0 ) + return valueDiff; + } + return 0; +} + + +void +ValueInternalMap::makeBeginIterator( IteratorState &it ) const +{ + it.map_ = const_cast( this ); + it.bucketIndex_ = 0; + it.itemIndex_ = 0; + it.link_ = buckets_; +} + + +void +ValueInternalMap::makeEndIterator( IteratorState &it ) const +{ + it.map_ = const_cast( this ); + it.bucketIndex_ = bucketsSize_; + it.itemIndex_ = 0; + it.link_ = 0; +} + + +bool +ValueInternalMap::equals( const IteratorState &x, const IteratorState &other ) +{ + return x.map_ == other.map_ + && x.bucketIndex_ == other.bucketIndex_ + && x.link_ == other.link_ + && x.itemIndex_ == other.itemIndex_; +} + + +void +ValueInternalMap::incrementBucket( IteratorState &iterator ) +{ + ++iterator.bucketIndex_; + JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_, + "ValueInternalMap::increment(): attempting to iterate beyond end." ); + if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ ) + iterator.link_ = 0; + else + iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]); + iterator.itemIndex_ = 0; +} + + +void +ValueInternalMap::increment( IteratorState &iterator ) +{ + JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterator using invalid iterator." ); + ++iterator.itemIndex_; + if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink ) + { + JSON_ASSERT_MESSAGE( iterator.link_ != 0, + "ValueInternalMap::increment(): attempting to iterate beyond end." ); + iterator.link_ = iterator.link_->next_; + if ( iterator.link_ == 0 ) + incrementBucket( iterator ); + } + else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() ) + { + incrementBucket( iterator ); + } +} + + +void +ValueInternalMap::decrement( IteratorState &iterator ) +{ + if ( iterator.itemIndex_ == 0 ) + { + JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterate using invalid iterator." ); + if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] ) + { + JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, "Attempting to iterate beyond beginning." ); + --(iterator.bucketIndex_); + } + iterator.link_ = iterator.link_->previous_; + iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1; + } +} + + +const char * +ValueInternalMap::key( const IteratorState &iterator ) +{ + JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); + return iterator.link_->keys_[iterator.itemIndex_]; +} + +const char * +ValueInternalMap::key( const IteratorState &iterator, bool &isStatic ) +{ + JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); + isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic(); + return iterator.link_->keys_[iterator.itemIndex_]; +} + + +Value & +ValueInternalMap::value( const IteratorState &iterator ) +{ + JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); + return iterator.link_->items_[iterator.itemIndex_]; +} + + +int +ValueInternalMap::distance( const IteratorState &x, const IteratorState &y ) +{ + int offset = 0; + IteratorState it = x; + while ( !equals( it, y ) ) + increment( it ); + return offset; +} diff --git a/connor_signature/json_reader.cpp b/connor_signature/json_reader.cpp new file mode 100644 index 0000000..3623e71 --- /dev/null +++ b/connor_signature/json_reader.cpp @@ -0,0 +1,885 @@ +#include "reader.h" +#include "value.h" +#include +#include +#include +#include +#include +#include + +#if _MSC_VER >= 1400 // VC++ 8.0 +#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. +#endif + +namespace Json { + +// Implementation of class Features +// //////////////////////////////// + +Features::Features() + : allowComments_( true ) + , strictRoot_( false ) +{ +} + + +Features +Features::all() +{ + return Features(); +} + + +Features +Features::strictMode() +{ + Features features; + features.allowComments_ = false; + features.strictRoot_ = true; + return features; +} + +// Implementation of class Reader +// //////////////////////////////// + + +static inline bool +in( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4 ) +{ + return c == c1 || c == c2 || c == c3 || c == c4; +} + +static inline bool +in( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4, Reader::Char c5 ) +{ + return c == c1 || c == c2 || c == c3 || c == c4 || c == c5; +} + + +static bool +containsNewLine( Reader::Location begin, + Reader::Location end ) +{ + for ( ;begin < end; ++begin ) + if ( *begin == '\n' || *begin == '\r' ) + return true; + return false; +} + +static std::string codePointToUTF8(unsigned int cp) +{ + std::string result; + + // based on description from http://en.wikipedia.org/wiki/UTF-8 + + if (cp <= 0x7f) + { + result.resize(1); + result[0] = static_cast(cp); + } + else if (cp <= 0x7FF) + { + result.resize(2); + result[1] = static_cast(0x80 | (0x3f & cp)); + result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); + } + else if (cp <= 0xFFFF) + { + result.resize(3); + result[2] = static_cast(0x80 | (0x3f & cp)); + result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); + result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); + } + else if (cp <= 0x10FFFF) + { + result.resize(4); + result[3] = static_cast(0x80 | (0x3f & cp)); + result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); + result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); + result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); + } + + return result; +} + + +// Class Reader +// ////////////////////////////////////////////////////////////////// + +Reader::Reader() + : features_( Features::all() ) +{ +} + + +Reader::Reader( const Features &features ) + : features_( features ) +{ +} + + +bool +Reader::parse( const std::string &document, + Value &root, + bool collectComments ) +{ + document_ = document; + const char *begin = document_.c_str(); + const char *end = begin + document_.length(); + return parse( begin, end, root, collectComments ); +} + + +bool +Reader::parse( std::istream& sin, + Value &root, + bool collectComments ) +{ + //std::istream_iterator begin(sin); + //std::istream_iterator end; + // Those would allow streamed input from a file, if parse() were a + // template function. + + // Since std::string is reference-counted, this at least does not + // create an extra copy. + std::string doc; + std::getline(sin, doc, (char)EOF); + return parse( doc, root, collectComments ); +} + +bool +Reader::parse( const char *beginDoc, const char *endDoc, + Value &root, + bool collectComments ) +{ + if ( !features_.allowComments_ ) + { + collectComments = false; + } + + begin_ = beginDoc; + end_ = endDoc; + collectComments_ = collectComments; + current_ = begin_; + lastValueEnd_ = 0; + lastValue_ = 0; + commentsBefore_ = ""; + errors_.clear(); + while ( !nodes_.empty() ) + nodes_.pop(); + nodes_.push( &root ); + + bool successful = readValue(); + Token token; + skipCommentTokens( token ); + if ( collectComments_ && !commentsBefore_.empty() ) + root.setComment( commentsBefore_, commentAfter ); + if ( features_.strictRoot_ ) + { + if ( !root.isArray() && !root.isObject() ) + { + // Set error location to start of doc, ideally should be first token found in doc + token.type_ = tokenError; + token.start_ = beginDoc; + token.end_ = endDoc; + addError( "A valid JSON document must be either an array or an object value.", + token ); + return false; + } + } + return successful; +} + + +bool +Reader::readValue() +{ + Token token; + skipCommentTokens( token ); + bool successful = true; + + if ( collectComments_ && !commentsBefore_.empty() ) + { + currentValue().setComment( commentsBefore_, commentBefore ); + commentsBefore_ = ""; + } + + + switch ( token.type_ ) + { + case tokenObjectBegin: + successful = readObject( token ); + break; + case tokenArrayBegin: + successful = readArray( token ); + break; + case tokenNumber: + successful = decodeNumber( token ); + break; + case tokenString: + successful = decodeString( token ); + break; + case tokenTrue: + currentValue() = true; + break; + case tokenFalse: + currentValue() = false; + break; + case tokenNull: + currentValue() = Value(); + break; + default: + return addError( "Syntax error: value, object or array expected.", token ); + } + + if ( collectComments_ ) + { + lastValueEnd_ = current_; + lastValue_ = ¤tValue(); + } + + return successful; +} + + +void +Reader::skipCommentTokens( Token &token ) +{ + if ( features_.allowComments_ ) + { + do + { + readToken( token ); + } + while ( token.type_ == tokenComment ); + } + else + { + readToken( token ); + } +} + + +bool +Reader::expectToken( TokenType type, Token &token, const char *message ) +{ + readToken( token ); + if ( token.type_ != type ) + return addError( message, token ); + return true; +} + + +bool +Reader::readToken( Token &token ) +{ + skipSpaces(); + token.start_ = current_; + Char c = getNextChar(); + bool ok = true; + switch ( c ) + { + case '{': + token.type_ = tokenObjectBegin; + break; + case '}': + token.type_ = tokenObjectEnd; + break; + case '[': + token.type_ = tokenArrayBegin; + break; + case ']': + token.type_ = tokenArrayEnd; + break; + case '"': + token.type_ = tokenString; + ok = readString(); + break; + case '/': + token.type_ = tokenComment; + ok = readComment(); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + token.type_ = tokenNumber; + readNumber(); + break; + case 't': + token.type_ = tokenTrue; + ok = match( "rue", 3 ); + break; + case 'f': + token.type_ = tokenFalse; + ok = match( "alse", 4 ); + break; + case 'n': + token.type_ = tokenNull; + ok = match( "ull", 3 ); + break; + case ',': + token.type_ = tokenArraySeparator; + break; + case ':': + token.type_ = tokenMemberSeparator; + break; + case 0: + token.type_ = tokenEndOfStream; + break; + default: + ok = false; + break; + } + if ( !ok ) + token.type_ = tokenError; + token.end_ = current_; + return true; +} + + +void +Reader::skipSpaces() +{ + while ( current_ != end_ ) + { + Char c = *current_; + if ( c == ' ' || c == '\t' || c == '\r' || c == '\n' ) + ++current_; + else + break; + } +} + + +bool +Reader::match( Location pattern, + int patternLength ) +{ + if ( end_ - current_ < patternLength ) + return false; + int index = patternLength; + while ( index-- ) + if ( current_[index] != pattern[index] ) + return false; + current_ += patternLength; + return true; +} + + +bool +Reader::readComment() +{ + Location commentBegin = current_ - 1; + Char c = getNextChar(); + bool successful = false; + if ( c == '*' ) + successful = readCStyleComment(); + else if ( c == '/' ) + successful = readCppStyleComment(); + if ( !successful ) + return false; + + if ( collectComments_ ) + { + CommentPlacement placement = commentBefore; + if ( lastValueEnd_ && !containsNewLine( lastValueEnd_, commentBegin ) ) + { + if ( c != '*' || !containsNewLine( commentBegin, current_ ) ) + placement = commentAfterOnSameLine; + } + + addComment( commentBegin, current_, placement ); + } + return true; +} + + +void +Reader::addComment( Location begin, + Location end, + CommentPlacement placement ) +{ + assert( collectComments_ ); + if ( placement == commentAfterOnSameLine ) + { + assert( lastValue_ != 0 ); + lastValue_->setComment( std::string( begin, end ), placement ); + } + else + { + if ( !commentsBefore_.empty() ) + commentsBefore_ += "\n"; + commentsBefore_ += std::string( begin, end ); + } +} + + +bool +Reader::readCStyleComment() +{ + while ( current_ != end_ ) + { + Char c = getNextChar(); + if ( c == '*' && *current_ == '/' ) + break; + } + return getNextChar() == '/'; +} + + +bool +Reader::readCppStyleComment() +{ + while ( current_ != end_ ) + { + Char c = getNextChar(); + if ( c == '\r' || c == '\n' ) + break; + } + return true; +} + + +void +Reader::readNumber() +{ + while ( current_ != end_ ) + { + if ( !(*current_ >= '0' && *current_ <= '9') && + !in( *current_, '.', 'e', 'E', '+', '-' ) ) + break; + ++current_; + } +} + +bool +Reader::readString() +{ + Char c = 0; + while ( current_ != end_ ) + { + c = getNextChar(); + if ( c == '\\' ) + getNextChar(); + else if ( c == '"' ) + break; + } + return c == '"'; +} + + +bool +Reader::readObject( Token &tokenStart ) +{ + Token tokenName; + std::string name; + currentValue() = Value( objectValue ); + while ( readToken( tokenName ) ) + { + bool initialTokenOk = true; + while ( tokenName.type_ == tokenComment && initialTokenOk ) + initialTokenOk = readToken( tokenName ); + if ( !initialTokenOk ) + break; + if ( tokenName.type_ == tokenObjectEnd && name.empty() ) // empty object + return true; + if ( tokenName.type_ != tokenString ) + break; + + name = ""; + if ( !decodeString( tokenName, name ) ) + return recoverFromError( tokenObjectEnd ); + + Token colon; + if ( !readToken( colon ) || colon.type_ != tokenMemberSeparator ) + { + return addErrorAndRecover( "Missing ':' after object member name", + colon, + tokenObjectEnd ); + } + Value &value = currentValue()[ name ]; + nodes_.push( &value ); + bool ok = readValue(); + nodes_.pop(); + if ( !ok ) // error already set + return recoverFromError( tokenObjectEnd ); + + Token comma; + if ( !readToken( comma ) + || ( comma.type_ != tokenObjectEnd && + comma.type_ != tokenArraySeparator && + comma.type_ != tokenComment ) ) + { + return addErrorAndRecover( "Missing ',' or '}' in object declaration", + comma, + tokenObjectEnd ); + } + bool finalizeTokenOk = true; + while ( comma.type_ == tokenComment && + finalizeTokenOk ) + finalizeTokenOk = readToken( comma ); + if ( comma.type_ == tokenObjectEnd ) + return true; + } + return addErrorAndRecover( "Missing '}' or object member name", + tokenName, + tokenObjectEnd ); +} + + +bool +Reader::readArray( Token &tokenStart ) +{ + currentValue() = Value( arrayValue ); + skipSpaces(); + if ( *current_ == ']' ) // empty array + { + Token endArray; + readToken( endArray ); + return true; + } + int index = 0; + while ( true ) + { + Value &value = currentValue()[ index++ ]; + nodes_.push( &value ); + bool ok = readValue(); + nodes_.pop(); + if ( !ok ) // error already set + return recoverFromError( tokenArrayEnd ); + + Token token; + // Accept Comment after last item in the array. + ok = readToken( token ); + while ( token.type_ == tokenComment && ok ) + { + ok = readToken( token ); + } + bool badTokenType = ( token.type_ == tokenArraySeparator && + token.type_ == tokenArrayEnd ); + if ( !ok || badTokenType ) + { + return addErrorAndRecover( "Missing ',' or ']' in array declaration", + token, + tokenArrayEnd ); + } + if ( token.type_ == tokenArrayEnd ) + break; + } + return true; +} + + +bool +Reader::decodeNumber( Token &token ) +{ + bool isDouble = false; + for ( Location inspect = token.start_; inspect != token.end_; ++inspect ) + { + isDouble = isDouble + || in( *inspect, '.', 'e', 'E', '+' ) + || ( *inspect == '-' && inspect != token.start_ ); + } + if ( isDouble ) + return decodeDouble( token ); + Location current = token.start_; + bool isNegative = *current == '-'; + if ( isNegative ) + ++current; + Value::UInt threshold = (isNegative ? Value::UInt(-Value::minInt) + : Value::maxUInt) / 10; + Value::UInt value = 0; + while ( current < token.end_ ) + { + Char c = *current++; + if ( c < '0' || c > '9' ) + return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token ); + if ( value >= threshold ) + return decodeDouble( token ); + value = value * 10 + Value::UInt(c - '0'); + } + if ( isNegative ) + currentValue() = -Value::Int( value ); + else if ( value <= Value::UInt(Value::maxInt) ) + currentValue() = Value::Int( value ); + else + currentValue() = value; + return true; +} + + +bool +Reader::decodeDouble( Token &token ) +{ + double value = 0; + const int bufferSize = 32; + int count; + int length = int(token.end_ - token.start_); + if ( length <= bufferSize ) + { + Char buffer[bufferSize]; + memcpy( buffer, token.start_, length ); + buffer[length] = 0; + count = sscanf( buffer, "%lf", &value ); + } + else + { + std::string buffer( token.start_, token.end_ ); + count = sscanf( buffer.c_str(), "%lf", &value ); + } + + if ( count != 1 ) + return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token ); + currentValue() = value; + return true; +} + + +bool +Reader::decodeString( Token &token ) +{ + std::string decoded; + if ( !decodeString( token, decoded ) ) + return false; + currentValue() = decoded; + return true; +} + + +bool +Reader::decodeString( Token &token, std::string &decoded ) +{ + decoded.reserve( token.end_ - token.start_ - 2 ); + Location current = token.start_ + 1; // skip '"' + Location end = token.end_ - 1; // do not include '"' + while ( current != end ) + { + Char c = *current++; + if ( c == '"' ) + break; + else if ( c == '\\' ) + { + if ( current == end ) + return addError( "Empty escape sequence in string", token, current ); + Char escape = *current++; + switch ( escape ) + { + case '"': decoded += '"'; break; + case '/': decoded += '/'; break; + case '\\': decoded += '\\'; break; + case 'b': decoded += '\b'; break; + case 'f': decoded += '\f'; break; + case 'n': decoded += '\n'; break; + case 'r': decoded += '\r'; break; + case 't': decoded += '\t'; break; + case 'u': + { + unsigned int unicode; + if ( !decodeUnicodeCodePoint( token, current, end, unicode ) ) + return false; + decoded += codePointToUTF8(unicode); + } + break; + default: + return addError( "Bad escape sequence in string", token, current ); + } + } + else + { + decoded += c; + } + } + return true; +} + +bool +Reader::decodeUnicodeCodePoint( Token &token, + Location ¤t, + Location end, + unsigned int &unicode ) +{ + + if ( !decodeUnicodeEscapeSequence( token, current, end, unicode ) ) + return false; + if (unicode >= 0xD800 && unicode <= 0xDBFF) + { + // surrogate pairs + if (end - current < 6) + return addError( "additional six characters expected to parse unicode surrogate pair.", token, current ); + unsigned int surrogatePair; + if (*(current++) == '\\' && *(current++)== 'u') + { + if (decodeUnicodeEscapeSequence( token, current, end, surrogatePair )) + { + unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); + } + else + return false; + } + else + return addError( "expecting another \\u token to begin the second half of a unicode surrogate pair", token, current ); + } + return true; +} + +bool +Reader::decodeUnicodeEscapeSequence( Token &token, + Location ¤t, + Location end, + unsigned int &unicode ) +{ + if ( end - current < 4 ) + return addError( "Bad unicode escape sequence in string: four digits expected.", token, current ); + unicode = 0; + for ( int index =0; index < 4; ++index ) + { + Char c = *current++; + unicode *= 16; + if ( c >= '0' && c <= '9' ) + unicode += c - '0'; + else if ( c >= 'a' && c <= 'f' ) + unicode += c - 'a' + 10; + else if ( c >= 'A' && c <= 'F' ) + unicode += c - 'A' + 10; + else + return addError( "Bad unicode escape sequence in string: hexadecimal digit expected.", token, current ); + } + return true; +} + + +bool +Reader::addError( const std::string &message, + Token &token, + Location extra ) +{ + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = extra; + errors_.push_back( info ); + return false; +} + + +bool +Reader::recoverFromError( TokenType skipUntilToken ) +{ + int errorCount = int(errors_.size()); + Token skip; + while ( true ) + { + if ( !readToken(skip) ) + errors_.resize( errorCount ); // discard errors caused by recovery + if ( skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream ) + break; + } + errors_.resize( errorCount ); + return false; +} + + +bool +Reader::addErrorAndRecover( const std::string &message, + Token &token, + TokenType skipUntilToken ) +{ + addError( message, token ); + return recoverFromError( skipUntilToken ); +} + + +Value & +Reader::currentValue() +{ + return *(nodes_.top()); +} + + +Reader::Char +Reader::getNextChar() +{ + if ( current_ == end_ ) + return 0; + return *current_++; +} + + +void +Reader::getLocationLineAndColumn( Location location, + int &line, + int &column ) const +{ + Location current = begin_; + Location lastLineStart = current; + line = 0; + while ( current < location && current != end_ ) + { + Char c = *current++; + if ( c == '\r' ) + { + if ( *current == '\n' ) + ++current; + lastLineStart = current; + ++line; + } + else if ( c == '\n' ) + { + lastLineStart = current; + ++line; + } + } + // column & line start at 1 + column = int(location - lastLineStart) + 1; + ++line; +} + + +std::string +Reader::getLocationLineAndColumn( Location location ) const +{ + int line, column; + getLocationLineAndColumn( location, line, column ); + char buffer[18+16+16+1]; + sprintf( buffer, "Line %d, Column %d", line, column ); + return buffer; +} + + +std::string +Reader::getFormatedErrorMessages() const +{ + std::string formattedMessage; + for ( Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); + ++itError ) + { + const ErrorInfo &error = *itError; + formattedMessage += "* " + getLocationLineAndColumn( error.token_.start_ ) + "\n"; + formattedMessage += " " + error.message_ + "\n"; + if ( error.extra_ ) + formattedMessage += "See " + getLocationLineAndColumn( error.extra_ ) + " for detail.\n"; + } + return formattedMessage; +} + + +std::istream& operator>>( std::istream &sin, Value &root ) +{ + Json::Reader reader; + bool ok = reader.parse(sin, root, true); + //JSON_ASSERT( ok ); + if (!ok) throw std::runtime_error(reader.getFormatedErrorMessages()); + return sin; +} + + +} // namespace Json diff --git a/connor_signature/json_value.cpp b/connor_signature/json_value.cpp new file mode 100644 index 0000000..f418af2 --- /dev/null +++ b/connor_signature/json_value.cpp @@ -0,0 +1,1718 @@ +#include +#include "value.h" +#include "writer.h" +#include +#include +#include +#include +#ifdef JSON_USE_CPPTL +# include +#endif +#include // size_t +#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +# include "json_batchallocator.h" +#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR + +#define JSON_ASSERT_UNREACHABLE assert( false ) +#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw +#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message ); + +namespace Json { + +const Value Value::null; +const Int Value::minInt = Int( ~(UInt(-1)/2) ); +const Int Value::maxInt = Int( UInt(-1)/2 ); +const UInt Value::maxUInt = UInt(-1); + +// A "safe" implementation of strdup. Allow null pointer to be passed. +// Also avoid warning on msvc80. +// +//inline char *safeStringDup( const char *czstring ) +//{ +// if ( czstring ) +// { +// const size_t length = (unsigned int)( strlen(czstring) + 1 ); +// char *newString = static_cast( malloc( length ) ); +// memcpy( newString, czstring, length ); +// return newString; +// } +// return 0; +//} +// +//inline char *safeStringDup( const std::string &str ) +//{ +// if ( !str.empty() ) +// { +// const size_t length = str.length(); +// char *newString = static_cast( malloc( length + 1 ) ); +// memcpy( newString, str.c_str(), length ); +// newString[length] = 0; +// return newString; +// } +// return 0; +//} + +ValueAllocator::~ValueAllocator() +{ +} + +class DefaultValueAllocator : public ValueAllocator +{ +public: + virtual ~DefaultValueAllocator() + { + } + + virtual char *makeMemberName( const char *memberName ) + { + return duplicateStringValue( memberName ); + } + + virtual void releaseMemberName( char *memberName ) + { + releaseStringValue( memberName ); + } + + virtual char *duplicateStringValue( const char *value, + unsigned int length = unknown ) + { + //@todo invesgate this old optimization + //if ( !value || value[0] == 0 ) + // return 0; + + if ( length == unknown ) + length = (unsigned int)strlen(value); + char *newString = static_cast( malloc( length + 1 ) ); + memcpy( newString, value, length ); + newString[length] = 0; + return newString; + } + + virtual void releaseStringValue( char *value ) + { + if ( value ) + free( value ); + } +}; + +static ValueAllocator *&valueAllocator() +{ + static DefaultValueAllocator defaultAllocator; + static ValueAllocator *valueAllocator = &defaultAllocator; + return valueAllocator; +} + +static struct DummyValueAllocatorInitializer { + DummyValueAllocatorInitializer() + { + valueAllocator(); // ensure valueAllocator() statics are initialized before main(). + } +} dummyValueAllocatorInitializer; + + + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ValueInternals... +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +#ifdef JSON_VALUE_USE_INTERNAL_MAP +# include "json_internalarray.inl" +# include "json_internalmap.inl" +#endif // JSON_VALUE_USE_INTERNAL_MAP + +# include "json_valueiterator.inl" + + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::CommentInfo +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + + +Value::CommentInfo::CommentInfo() + : comment_( 0 ) +{ +} + +Value::CommentInfo::~CommentInfo() +{ + if ( comment_ ) + valueAllocator()->releaseStringValue( comment_ ); +} + + +void +Value::CommentInfo::setComment( const char *text ) +{ + if ( comment_ ) + valueAllocator()->releaseStringValue( comment_ ); + JSON_ASSERT( text ); + JSON_ASSERT_MESSAGE( text[0]=='\0' || text[0]=='/', "Comments must start with /"); + // It seems that /**/ style comments are acceptable as well. + comment_ = valueAllocator()->duplicateStringValue( text ); +} + + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::CZString +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +# ifndef JSON_VALUE_USE_INTERNAL_MAP + +// Notes: index_ indicates if the string was allocated when +// a string is stored. + +Value::CZString::CZString( int index ) + : cstr_( 0 ) + , index_( index ) +{ +} + +Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate ) + : cstr_( allocate == duplicate ? valueAllocator()->makeMemberName(cstr) + : cstr ) + , index_( allocate ) +{ +} + +Value::CZString::CZString( const CZString &other ) +: cstr_( other.index_ != noDuplication && other.cstr_ != 0 + ? valueAllocator()->makeMemberName( other.cstr_ ) + : other.cstr_ ) + , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) + : other.index_ ) +{ +} + +Value::CZString::~CZString() +{ + if ( cstr_ && index_ == duplicate ) + valueAllocator()->releaseMemberName( const_cast( cstr_ ) ); +} + +void +Value::CZString::swap( CZString &other ) +{ + std::swap( cstr_, other.cstr_ ); + std::swap( index_, other.index_ ); +} + +Value::CZString & +Value::CZString::operator =( const CZString &other ) +{ + CZString temp( other ); + swap( temp ); + return *this; +} + +bool +Value::CZString::operator<( const CZString &other ) const +{ + if ( cstr_ ) + return strcmp( cstr_, other.cstr_ ) < 0; + return index_ < other.index_; +} + +bool +Value::CZString::operator==( const CZString &other ) const +{ + if ( cstr_ ) + return strcmp( cstr_, other.cstr_ ) == 0; + return index_ == other.index_; +} + + +int +Value::CZString::index() const +{ + return index_; +} + + +const char * +Value::CZString::c_str() const +{ + return cstr_; +} + +bool +Value::CZString::isStaticString() const +{ + return index_ == noDuplication; +} + +#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP + + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::Value +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +/*! \internal Default constructor initialization must be equivalent to: + * memset( this, 0, sizeof(Value) ) + * This optimization is used in ValueInternalMap fast allocator. + */ +Value::Value( ValueType type ) + : type_( type ) + , allocated_( 0 ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + switch ( type ) + { + case nullValue: + break; + case intValue: + case uintValue: + value_.int_ = 0; + break; + case realValue: + value_.real_ = 0.0; + break; + case stringValue: + value_.string_ = 0; + break; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues(); + break; +#else + case arrayValue: + value_.array_ = arrayAllocator()->newArray(); + break; + case objectValue: + value_.map_ = mapAllocator()->newMap(); + break; +#endif + case booleanValue: + value_.bool_ = false; + break; + default: + JSON_ASSERT_UNREACHABLE; + } +} + + +Value::Value( Int value ) + : type_( intValue ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + value_.int_ = value; +} + + +Value::Value( UInt value ) + : type_( uintValue ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + value_.uint_ = value; +} + +Value::Value( double value ) + : type_( realValue ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + value_.real_ = value; +} + +Value::Value( const char *value ) + : type_( stringValue ) + , allocated_( true ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + value_.string_ = valueAllocator()->duplicateStringValue( value ); +} + + +Value::Value( const char *beginValue, + const char *endValue ) + : type_( stringValue ) + , allocated_( true ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + value_.string_ = valueAllocator()->duplicateStringValue( beginValue, + UInt(endValue - beginValue) ); +} + + +Value::Value( const std::string &value ) + : type_( stringValue ) + , allocated_( true ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + value_.string_ = valueAllocator()->duplicateStringValue( value.c_str(), + (unsigned int)value.length() ); + +} + +Value::Value( const StaticString &value ) + : type_( stringValue ) + , allocated_( false ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + value_.string_ = const_cast( value.c_str() ); +} + + +# ifdef JSON_USE_CPPTL +Value::Value( const CppTL::ConstString &value ) + : type_( stringValue ) + , allocated_( true ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + value_.string_ = valueAllocator()->duplicateStringValue( value, value.length() ); +} +# endif + +Value::Value( bool value ) + : type_( booleanValue ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + value_.bool_ = value; +} + + +Value::Value( const Value &other ) + : type_( other.type_ ) + , comments_( 0 ) +# ifdef JSON_VALUE_USE_INTERNAL_MAP + , itemIsUsed_( 0 ) +#endif +{ + switch ( type_ ) + { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + value_ = other.value_; + break; + case stringValue: + if ( other.value_.string_ ) + { + value_.string_ = valueAllocator()->duplicateStringValue( other.value_.string_ ); + allocated_ = true; + } + else + value_.string_ = 0; + break; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues( *other.value_.map_ ); + break; +#else + case arrayValue: + value_.array_ = arrayAllocator()->newArrayCopy( *other.value_.array_ ); + break; + case objectValue: + value_.map_ = mapAllocator()->newMapCopy( *other.value_.map_ ); + break; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + if ( other.comments_ ) + { + comments_ = new CommentInfo[numberOfCommentPlacement]; + for ( int comment =0; comment < numberOfCommentPlacement; ++comment ) + { + const CommentInfo &otherComment = other.comments_[comment]; + if ( otherComment.comment_ ) + comments_[comment].setComment( otherComment.comment_ ); + } + } +} + + +Value::~Value() +{ + switch ( type_ ) + { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + break; + case stringValue: + if ( allocated_ ) + valueAllocator()->releaseStringValue( value_.string_ ); + break; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + delete value_.map_; + break; +#else + case arrayValue: + arrayAllocator()->destructArray( value_.array_ ); + break; + case objectValue: + mapAllocator()->destructMap( value_.map_ ); + break; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + + if ( comments_ ) + delete[] comments_; +} + +Value & +Value::operator=( const Value &other ) +{ + Value temp( other ); + swap( temp ); + return *this; +} + +void +Value::swap( Value &other ) +{ + ValueType temp = type_; + type_ = other.type_; + other.type_ = temp; + std::swap( value_, other.value_ ); + int temp2 = allocated_; + allocated_ = other.allocated_; + other.allocated_ = temp2; +} + +ValueType +Value::type() const +{ + return type_; +} + + +int +Value::compare( const Value &other ) +{ + /* + int typeDelta = other.type_ - type_; + switch ( type_ ) + { + case nullValue: + + return other.type_ == type_; + case intValue: + if ( other.type_.isNumeric() + case uintValue: + case realValue: + case booleanValue: + break; + case stringValue, + break; + case arrayValue: + delete value_.array_; + break; + case objectValue: + delete value_.map_; + default: + JSON_ASSERT_UNREACHABLE; + } + */ + return 0; // unreachable +} + +bool +Value::operator <( const Value &other ) const +{ + int typeDelta = type_ - other.type_; + if ( typeDelta ) + return typeDelta < 0 ? true : false; + switch ( type_ ) + { + case nullValue: + return false; + case intValue: + return value_.int_ < other.value_.int_; + case uintValue: + return value_.uint_ < other.value_.uint_; + case realValue: + return value_.real_ < other.value_.real_; + case booleanValue: + return value_.bool_ < other.value_.bool_; + case stringValue: + return ( value_.string_ == 0 && other.value_.string_ ) + || ( other.value_.string_ + && value_.string_ + && strcmp( value_.string_, other.value_.string_ ) < 0 ); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + { + int delta = int( value_.map_->size() - other.value_.map_->size() ); + if ( delta ) + return delta < 0; + return (*value_.map_) < (*other.value_.map_); + } +#else + case arrayValue: + return value_.array_->compare( *(other.value_.array_) ) < 0; + case objectValue: + return value_.map_->compare( *(other.value_.map_) ) < 0; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + return 0; // unreachable +} + +bool +Value::operator <=( const Value &other ) const +{ + return !(other > *this); +} + +bool +Value::operator >=( const Value &other ) const +{ + return !(*this < other); +} + +bool +Value::operator >( const Value &other ) const +{ + return other < *this; +} + +bool +Value::operator ==( const Value &other ) const +{ + //if ( type_ != other.type_ ) + // GCC 2.95.3 says: + // attempt to take address of bit-field structure member `Json::Value::type_' + // Beats me, but a temp solves the problem. + int temp = other.type_; + if ( type_ != temp ) + return false; + switch ( type_ ) + { + case nullValue: + return true; + case intValue: + return value_.int_ == other.value_.int_; + case uintValue: + return value_.uint_ == other.value_.uint_; + case realValue: + return value_.real_ == other.value_.real_; + case booleanValue: + return value_.bool_ == other.value_.bool_; + case stringValue: + return ( value_.string_ == other.value_.string_ ) + || ( other.value_.string_ + && value_.string_ + && strcmp( value_.string_, other.value_.string_ ) == 0 ); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + return value_.map_->size() == other.value_.map_->size() + && (*value_.map_) == (*other.value_.map_); +#else + case arrayValue: + return value_.array_->compare( *(other.value_.array_) ) == 0; + case objectValue: + return value_.map_->compare( *(other.value_.map_) ) == 0; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + return 0; // unreachable +} + +bool +Value::operator !=( const Value &other ) const +{ + return !( *this == other ); +} + +const char * +Value::asCString() const +{ + JSON_ASSERT( type_ == stringValue ); + return value_.string_; +} + + +std::string +Value::asString() const +{ + switch ( type_ ) + { + case nullValue: + return ""; + case stringValue: + return value_.string_ ? value_.string_ : ""; + case booleanValue: + return value_.bool_ ? "true" : "false"; + case intValue: + case uintValue: + case realValue: + case arrayValue: + case objectValue: + JSON_ASSERT_MESSAGE( false, "Type is not convertible to string" ); + default: + JSON_ASSERT_UNREACHABLE; + } + return ""; // unreachable +} + +# ifdef JSON_USE_CPPTL +CppTL::ConstString +Value::asConstString() const +{ + return CppTL::ConstString( asString().c_str() ); +} +# endif + +Value::Int +Value::asInt() const +{ + switch ( type_ ) + { + case nullValue: + return 0; + case intValue: + return value_.int_; + case uintValue: + JSON_ASSERT_MESSAGE( value_.uint_ < (unsigned)maxInt, "integer out of signed integer range" ); + return value_.uint_; + case realValue: + JSON_ASSERT_MESSAGE( value_.real_ >= minInt && value_.real_ <= maxInt, "Real out of signed integer range" ); + return Int( value_.real_ ); + case booleanValue: + return value_.bool_ ? 1 : 0; + case stringValue: + case arrayValue: + case objectValue: + JSON_ASSERT_MESSAGE( false, "Type is not convertible to int" ); + default: + JSON_ASSERT_UNREACHABLE; + } + return 0; // unreachable; +} + +Value::UInt +Value::asUInt() const +{ + switch ( type_ ) + { + case nullValue: + return 0; + case intValue: + JSON_ASSERT_MESSAGE( value_.int_ >= 0, "Negative integer can not be converted to unsigned integer" ); + return value_.int_; + case uintValue: + return value_.uint_; + case realValue: + JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt, "Real out of unsigned integer range" ); + return UInt( value_.real_ ); + case booleanValue: + return value_.bool_ ? 1 : 0; + case stringValue: + case arrayValue: + case objectValue: + JSON_ASSERT_MESSAGE( false, "Type is not convertible to uint" ); + default: + JSON_ASSERT_UNREACHABLE; + } + return 0; // unreachable; +} + +double +Value::asDouble() const +{ + switch ( type_ ) + { + case nullValue: + return 0.0; + case intValue: + return value_.int_; + case uintValue: + return value_.uint_; + case realValue: + return value_.real_; + case booleanValue: + return value_.bool_ ? 1.0 : 0.0; + case stringValue: + case arrayValue: + case objectValue: + JSON_ASSERT_MESSAGE( false, "Type is not convertible to double" ); + default: + JSON_ASSERT_UNREACHABLE; + } + return 0; // unreachable; +} + +bool +Value::asBool() const +{ + switch ( type_ ) + { + case nullValue: + return false; + case intValue: + case uintValue: + return value_.int_ != 0; + case realValue: + return value_.real_ != 0.0; + case booleanValue: + return value_.bool_; + case stringValue: + return value_.string_ && value_.string_[0] != 0; + case arrayValue: + case objectValue: + return value_.map_->size() != 0; + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable; +} + + +bool +Value::isConvertibleTo( ValueType other ) const +{ + switch ( type_ ) + { + case nullValue: + return true; + case intValue: + return ( other == nullValue && value_.int_ == 0 ) + || other == intValue + || ( other == uintValue && value_.int_ >= 0 ) + || other == realValue + || other == stringValue + || other == booleanValue; + case uintValue: + return ( other == nullValue && value_.uint_ == 0 ) + || ( other == intValue && value_.uint_ <= (unsigned)maxInt ) + || other == uintValue + || other == realValue + || other == stringValue + || other == booleanValue; + case realValue: + return ( other == nullValue && value_.real_ == 0.0 ) + || ( other == intValue && value_.real_ >= minInt && value_.real_ <= maxInt ) + || ( other == uintValue && value_.real_ >= 0 && value_.real_ <= maxUInt ) + || other == realValue + || other == stringValue + || other == booleanValue; + case booleanValue: + return ( other == nullValue && value_.bool_ == false ) + || other == intValue + || other == uintValue + || other == realValue + || other == stringValue + || other == booleanValue; + case stringValue: + return other == stringValue + || ( other == nullValue && (!value_.string_ || value_.string_[0] == 0) ); + case arrayValue: + return other == arrayValue + || ( other == nullValue && value_.map_->size() == 0 ); + case objectValue: + return other == objectValue + || ( other == nullValue && value_.map_->size() == 0 ); + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable; +} + + +/// Number of values in array or object +Value::UInt +Value::size() const +{ + switch ( type_ ) + { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + case stringValue: + return 0; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: // size of the array is highest index + 1 + if ( !value_.map_->empty() ) + { + ObjectValues::const_iterator itLast = value_.map_->end(); + --itLast; + return (*itLast).first.index()+1; + } + return 0; + case objectValue: + return Int( value_.map_->size() ); +#else + case arrayValue: + return Int( value_.array_->size() ); + case objectValue: + return Int( value_.map_->size() ); +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + return 0; // unreachable; +} + + +bool +Value::empty() const +{ + if ( isNull() || isArray() || isObject() ) + return size() == 0u; + else + return false; +} + + +bool +Value::operator!() const +{ + return isNull(); +} + + +void +Value::clear() +{ + JSON_ASSERT( type_ == nullValue || type_ == arrayValue || type_ == objectValue ); + + switch ( type_ ) + { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + value_.map_->clear(); + break; +#else + case arrayValue: + value_.array_->clear(); + break; + case objectValue: + value_.map_->clear(); + break; +#endif + default: + break; + } +} + +void +Value::resize( UInt newSize ) +{ + JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); + if ( type_ == nullValue ) + *this = Value( arrayValue ); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + UInt oldSize = size(); + if ( newSize == 0 ) + clear(); + else if ( newSize > oldSize ) + (*this)[ newSize - 1 ]; + else + { + for ( UInt index = newSize; index < oldSize; ++index ) + value_.map_->erase( index ); + assert( size() == newSize ); + } +#else + value_.array_->resize( newSize ); +#endif +} + + +Value & +Value::operator[]( UInt index ) +{ + JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); + if ( type_ == nullValue ) + *this = Value( arrayValue ); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString key( index ); + ObjectValues::iterator it = value_.map_->lower_bound( key ); + if ( it != value_.map_->end() && (*it).first == key ) + return (*it).second; + + ObjectValues::value_type defaultValue( key, null ); + it = value_.map_->insert( it, defaultValue ); + return (*it).second; +#else + return value_.array_->resolveReference( index ); +#endif +} + + +const Value & +Value::operator[]( UInt index ) const +{ + JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); + if ( type_ == nullValue ) + return null; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString key( index ); + ObjectValues::const_iterator it = value_.map_->find( key ); + if ( it == value_.map_->end() ) + return null; + return (*it).second; +#else + Value *value = value_.array_->find( index ); + return value ? *value : null; +#endif +} + + +Value & +Value::operator[]( const char *key ) +{ + return resolveReference( key, false ); +} + + +Value & +Value::resolveReference( const char *key, + bool isStatic ) +{ + JSON_ASSERT( type_ == nullValue || type_ == objectValue ); + if ( type_ == nullValue ) + *this = Value( objectValue ); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString actualKey( key, isStatic ? CZString::noDuplication + : CZString::duplicateOnCopy ); + ObjectValues::iterator it = value_.map_->lower_bound( actualKey ); + if ( it != value_.map_->end() && (*it).first == actualKey ) + return (*it).second; + + ObjectValues::value_type defaultValue( actualKey, null ); + it = value_.map_->insert( it, defaultValue ); + Value &value = (*it).second; + return value; +#else + return value_.map_->resolveReference( key, isStatic ); +#endif +} + + +Value +Value::get( UInt index, + const Value &defaultValue ) const +{ + const Value *value = &((*this)[index]); + return value == &null ? defaultValue : *value; +} + + +bool +Value::isValidIndex( UInt index ) const +{ + return index < size(); +} + + + +const Value & +Value::operator[]( const char *key ) const +{ + JSON_ASSERT( type_ == nullValue || type_ == objectValue ); + if ( type_ == nullValue ) + return null; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString actualKey( key, CZString::noDuplication ); + ObjectValues::const_iterator it = value_.map_->find( actualKey ); + if ( it == value_.map_->end() ) + return null; + return (*it).second; +#else + const Value *value = value_.map_->find( key ); + return value ? *value : null; +#endif +} + + +Value & +Value::operator[]( const std::string &key ) +{ + return (*this)[ key.c_str() ]; +} + + +const Value & +Value::operator[]( const std::string &key ) const +{ + return (*this)[ key.c_str() ]; +} + +Value & +Value::operator[]( const StaticString &key ) +{ + return resolveReference( key, true ); +} + + +# ifdef JSON_USE_CPPTL +Value & +Value::operator[]( const CppTL::ConstString &key ) +{ + return (*this)[ key.c_str() ]; +} + + +const Value & +Value::operator[]( const CppTL::ConstString &key ) const +{ + return (*this)[ key.c_str() ]; +} +# endif + + +Value & +Value::append( const Value &value ) +{ + return (*this)[size()] = value; +} + + +Value +Value::get( const char *key, + const Value &defaultValue ) const +{ + const Value *value = &((*this)[key]); + return value == &null ? defaultValue : *value; +} + + +Value +Value::get( const std::string &key, + const Value &defaultValue ) const +{ + return get( key.c_str(), defaultValue ); +} + +Value +Value::removeMember( const char* key ) +{ + JSON_ASSERT( type_ == nullValue || type_ == objectValue ); + if ( type_ == nullValue ) + return null; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString actualKey( key, CZString::noDuplication ); + ObjectValues::iterator it = value_.map_->find( actualKey ); + if ( it == value_.map_->end() ) + return null; + Value old(it->second); + value_.map_->erase(it); + return old; +#else + Value *value = value_.map_->find( key ); + if (value){ + Value old(*value); + value_.map_.remove( key ); + return old; + } else { + return null; + } +#endif +} + +Value +Value::removeMember( const std::string &key ) +{ + return removeMember( key.c_str() ); +} + +# ifdef JSON_USE_CPPTL +Value +Value::get( const CppTL::ConstString &key, + const Value &defaultValue ) const +{ + return get( key.c_str(), defaultValue ); +} +# endif + +bool +Value::isMember( const char *key ) const +{ + const Value *value = &((*this)[key]); + return value != &null; +} + + +bool +Value::isMember( const std::string &key ) const +{ + return isMember( key.c_str() ); +} + + +# ifdef JSON_USE_CPPTL +bool +Value::isMember( const CppTL::ConstString &key ) const +{ + return isMember( key.c_str() ); +} +#endif + +Value::Members +Value::getMemberNames() const +{ + JSON_ASSERT( type_ == nullValue || type_ == objectValue ); + if ( type_ == nullValue ) + return Value::Members(); + Members members; + members.reserve( value_.map_->size() ); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + ObjectValues::const_iterator it = value_.map_->begin(); + ObjectValues::const_iterator itEnd = value_.map_->end(); + for ( ; it != itEnd; ++it ) + members.push_back( std::string( (*it).first.c_str() ) ); +#else + ValueInternalMap::IteratorState it; + ValueInternalMap::IteratorState itEnd; + value_.map_->makeBeginIterator( it ); + value_.map_->makeEndIterator( itEnd ); + for ( ; !ValueInternalMap::equals( it, itEnd ); ValueInternalMap::increment(it) ) + members.push_back( std::string( ValueInternalMap::key( it ) ) ); +#endif + return members; +} +// +//# ifdef JSON_USE_CPPTL +//EnumMemberNames +//Value::enumMemberNames() const +//{ +// if ( type_ == objectValue ) +// { +// return CppTL::Enum::any( CppTL::Enum::transform( +// CppTL::Enum::keys( *(value_.map_), CppTL::Type() ), +// MemberNamesTransform() ) ); +// } +// return EnumMemberNames(); +//} +// +// +//EnumValues +//Value::enumValues() const +//{ +// if ( type_ == objectValue || type_ == arrayValue ) +// return CppTL::Enum::anyValues( *(value_.map_), +// CppTL::Type() ); +// return EnumValues(); +//} +// +//# endif + + +bool +Value::isNull() const +{ + return type_ == nullValue; +} + + +bool +Value::isBool() const +{ + return type_ == booleanValue; +} + + +bool +Value::isInt() const +{ + return type_ == intValue; +} + + +bool +Value::isUInt() const +{ + return type_ == uintValue; +} + + +bool +Value::isIntegral() const +{ + return type_ == intValue + || type_ == uintValue + || type_ == booleanValue; +} + + +bool +Value::isDouble() const +{ + return type_ == realValue; +} + + +bool +Value::isNumeric() const +{ + return isIntegral() || isDouble(); +} + + +bool +Value::isString() const +{ + return type_ == stringValue; +} + + +bool +Value::isArray() const +{ + return type_ == nullValue || type_ == arrayValue; +} + + +bool +Value::isObject() const +{ + return type_ == nullValue || type_ == objectValue; +} + + +void +Value::setComment( const char *comment, + CommentPlacement placement ) +{ + if ( !comments_ ) + comments_ = new CommentInfo[numberOfCommentPlacement]; + comments_[placement].setComment( comment ); +} + + +void +Value::setComment( const std::string &comment, + CommentPlacement placement ) +{ + setComment( comment.c_str(), placement ); +} + + +bool +Value::hasComment( CommentPlacement placement ) const +{ + return comments_ != 0 && comments_[placement].comment_ != 0; +} + +std::string +Value::getComment( CommentPlacement placement ) const +{ + if ( hasComment(placement) ) + return comments_[placement].comment_; + return ""; +} + + +std::string +Value::toStyledString() const +{ + StyledWriter writer; + return writer.write( *this ); +} + + +Value::const_iterator +Value::begin() const +{ + switch ( type_ ) + { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if ( value_.array_ ) + { + ValueInternalArray::IteratorState it; + value_.array_->makeBeginIterator( it ); + return const_iterator( it ); + } + break; + case objectValue: + if ( value_.map_ ) + { + ValueInternalMap::IteratorState it; + value_.map_->makeBeginIterator( it ); + return const_iterator( it ); + } + break; +#else + case arrayValue: + case objectValue: + if ( value_.map_ ) + return const_iterator( value_.map_->begin() ); + break; +#endif + default: + break; + } + return const_iterator(); +} + +Value::const_iterator +Value::end() const +{ + switch ( type_ ) + { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if ( value_.array_ ) + { + ValueInternalArray::IteratorState it; + value_.array_->makeEndIterator( it ); + return const_iterator( it ); + } + break; + case objectValue: + if ( value_.map_ ) + { + ValueInternalMap::IteratorState it; + value_.map_->makeEndIterator( it ); + return const_iterator( it ); + } + break; +#else + case arrayValue: + case objectValue: + if ( value_.map_ ) + return const_iterator( value_.map_->end() ); + break; +#endif + default: + break; + } + return const_iterator(); +} + + +Value::iterator +Value::begin() +{ + switch ( type_ ) + { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if ( value_.array_ ) + { + ValueInternalArray::IteratorState it; + value_.array_->makeBeginIterator( it ); + return iterator( it ); + } + break; + case objectValue: + if ( value_.map_ ) + { + ValueInternalMap::IteratorState it; + value_.map_->makeBeginIterator( it ); + return iterator( it ); + } + break; +#else + case arrayValue: + case objectValue: + if ( value_.map_ ) + return iterator( value_.map_->begin() ); + break; +#endif + default: + break; + } + return iterator(); +} + +Value::iterator +Value::end() +{ + switch ( type_ ) + { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if ( value_.array_ ) + { + ValueInternalArray::IteratorState it; + value_.array_->makeEndIterator( it ); + return iterator( it ); + } + break; + case objectValue: + if ( value_.map_ ) + { + ValueInternalMap::IteratorState it; + value_.map_->makeEndIterator( it ); + return iterator( it ); + } + break; +#else + case arrayValue: + case objectValue: + if ( value_.map_ ) + return iterator( value_.map_->end() ); + break; +#endif + default: + break; + } + return iterator(); +} + + +// class PathArgument +// ////////////////////////////////////////////////////////////////// + +PathArgument::PathArgument() + : kind_( kindNone ) +{ +} + + +PathArgument::PathArgument( Value::UInt index ) + : index_( index ) + , kind_( kindIndex ) +{ +} + + +PathArgument::PathArgument( const char *key ) + : key_( key ) + , kind_( kindKey ) +{ +} + + +PathArgument::PathArgument( const std::string &key ) + : key_( key.c_str() ) + , kind_( kindKey ) +{ +} + +// class Path +// ////////////////////////////////////////////////////////////////// + +Path::Path( const std::string &path, + const PathArgument &a1, + const PathArgument &a2, + const PathArgument &a3, + const PathArgument &a4, + const PathArgument &a5 ) +{ + InArgs in; + in.push_back( &a1 ); + in.push_back( &a2 ); + in.push_back( &a3 ); + in.push_back( &a4 ); + in.push_back( &a5 ); + makePath( path, in ); +} + + +void +Path::makePath( const std::string &path, + const InArgs &in ) +{ + const char *current = path.c_str(); + const char *end = current + path.length(); + InArgs::const_iterator itInArg = in.begin(); + while ( current != end ) + { + if ( *current == '[' ) + { + ++current; + if ( *current == '%' ) + addPathInArg( path, in, itInArg, PathArgument::kindIndex ); + else + { + Value::UInt index = 0; + for ( ; current != end && *current >= '0' && *current <= '9'; ++current ) + index = index * 10 + Value::UInt(*current - '0'); + args_.push_back( index ); + } + if ( current == end || *current++ != ']' ) + invalidPath( path, int(current - path.c_str()) ); + } + else if ( *current == '%' ) + { + addPathInArg( path, in, itInArg, PathArgument::kindKey ); + ++current; + } + else if ( *current == '.' ) + { + ++current; + } + else + { + const char *beginName = current; + while ( current != end && !strchr( "[.", *current ) ) + ++current; + args_.push_back( std::string( beginName, current ) ); + } + } +} + + +void +Path::addPathInArg( const std::string &path, + const InArgs &in, + InArgs::const_iterator &itInArg, + PathArgument::Kind kind ) +{ + if ( itInArg == in.end() ) + { + // Error: missing argument %d + } + else if ( (*itInArg)->kind_ != kind ) + { + // Error: bad argument type + } + else + { + args_.push_back( **itInArg ); + } +} + + +void +Path::invalidPath( const std::string &path, + int location ) +{ + // Error: invalid path. +} + + +const Value & +Path::resolve( const Value &root ) const +{ + const Value *node = &root; + for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it ) + { + const PathArgument &arg = *it; + if ( arg.kind_ == PathArgument::kindIndex ) + { + if ( !node->isArray() || node->isValidIndex( arg.index_ ) ) + { + // Error: unable to resolve path (array value expected at position... + } + node = &((*node)[arg.index_]); + } + else if ( arg.kind_ == PathArgument::kindKey ) + { + if ( !node->isObject() ) + { + // Error: unable to resolve path (object value expected at position...) + } + node = &((*node)[arg.key_]); + if ( node == &Value::null ) + { + // Error: unable to resolve path (object has no member named '' at position...) + } + } + } + return *node; +} + + +Value +Path::resolve( const Value &root, + const Value &defaultValue ) const +{ + const Value *node = &root; + for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it ) + { + const PathArgument &arg = *it; + if ( arg.kind_ == PathArgument::kindIndex ) + { + if ( !node->isArray() || node->isValidIndex( arg.index_ ) ) + return defaultValue; + node = &((*node)[arg.index_]); + } + else if ( arg.kind_ == PathArgument::kindKey ) + { + if ( !node->isObject() ) + return defaultValue; + node = &((*node)[arg.key_]); + if ( node == &Value::null ) + return defaultValue; + } + } + return *node; +} + + +Value & +Path::make( Value &root ) const +{ + Value *node = &root; + for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it ) + { + const PathArgument &arg = *it; + if ( arg.kind_ == PathArgument::kindIndex ) + { + if ( !node->isArray() ) + { + // Error: node is not an array at position ... + } + node = &((*node)[arg.index_]); + } + else if ( arg.kind_ == PathArgument::kindKey ) + { + if ( !node->isObject() ) + { + // Error: node is not an object at position... + } + node = &((*node)[arg.key_]); + } + } + return *node; +} + + +} // namespace Json diff --git a/connor_signature/json_valueiterator.inl b/connor_signature/json_valueiterator.inl new file mode 100644 index 0000000..736e260 --- /dev/null +++ b/connor_signature/json_valueiterator.inl @@ -0,0 +1,292 @@ +// included by json_value.cpp +// everything is within Json namespace + + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueIteratorBase +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueIteratorBase::ValueIteratorBase() +#ifndef JSON_VALUE_USE_INTERNAL_MAP + : current_() + , isNull_( true ) +{ +} +#else + : isArray_( true ) + , isNull_( true ) +{ + iterator_.array_ = ValueInternalArray::IteratorState(); +} +#endif + + +#ifndef JSON_VALUE_USE_INTERNAL_MAP +ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator ¤t ) + : current_( current ) + , isNull_( false ) +{ +} +#else +ValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state ) + : isArray_( true ) +{ + iterator_.array_ = state; +} + + +ValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state ) + : isArray_( false ) +{ + iterator_.map_ = state; +} +#endif + +Value & +ValueIteratorBase::deref() const +{ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + return current_->second; +#else + if ( isArray_ ) + return ValueInternalArray::dereference( iterator_.array_ ); + return ValueInternalMap::value( iterator_.map_ ); +#endif +} + + +void +ValueIteratorBase::increment() +{ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + ++current_; +#else + if ( isArray_ ) + ValueInternalArray::increment( iterator_.array_ ); + ValueInternalMap::increment( iterator_.map_ ); +#endif +} + + +void +ValueIteratorBase::decrement() +{ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + --current_; +#else + if ( isArray_ ) + ValueInternalArray::decrement( iterator_.array_ ); + ValueInternalMap::decrement( iterator_.map_ ); +#endif +} + + +ValueIteratorBase::difference_type +ValueIteratorBase::computeDistance( const SelfType &other ) const +{ +#ifndef JSON_VALUE_USE_INTERNAL_MAP +# ifdef JSON_USE_CPPTL_SMALLMAP + return current_ - other.current_; +# else + // Iterator for null value are initialized using the default + // constructor, which initialize current_ to the default + // std::map::iterator. As begin() and end() are two instance + // of the default std::map::iterator, they can not be compared. + // To allow this, we handle this comparison specifically. + if ( isNull_ && other.isNull_ ) + { + return 0; + } + + + // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL, + // which is the one used by default). + // Using a portable hand-made version for non random iterator instead: + // return difference_type( std::distance( current_, other.current_ ) ); + difference_type myDistance = 0; + for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it ) + { + ++myDistance; + } + return myDistance; +# endif +#else + if ( isArray_ ) + return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ ); + return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ ); +#endif +} + + +bool +ValueIteratorBase::isEqual( const SelfType &other ) const +{ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + if ( isNull_ ) + { + return other.isNull_; + } + return current_ == other.current_; +#else + if ( isArray_ ) + return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ ); + return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ ); +#endif +} + + +void +ValueIteratorBase::copy( const SelfType &other ) +{ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + current_ = other.current_; +#else + if ( isArray_ ) + iterator_.array_ = other.iterator_.array_; + iterator_.map_ = other.iterator_.map_; +#endif +} + + +Value +ValueIteratorBase::key() const +{ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + const Value::CZString czstring = (*current_).first; + if ( czstring.c_str() ) + { + if ( czstring.isStaticString() ) + return Value( StaticString( czstring.c_str() ) ); + return Value( czstring.c_str() ); + } + return Value( czstring.index() ); +#else + if ( isArray_ ) + return Value( ValueInternalArray::indexOf( iterator_.array_ ) ); + bool isStatic; + const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic ); + if ( isStatic ) + return Value( StaticString( memberName ) ); + return Value( memberName ); +#endif +} + + +UInt +ValueIteratorBase::index() const +{ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + const Value::CZString czstring = (*current_).first; + if ( !czstring.c_str() ) + return czstring.index(); + return Value::UInt( -1 ); +#else + if ( isArray_ ) + return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) ); + return Value::UInt( -1 ); +#endif +} + + +const char * +ValueIteratorBase::memberName() const +{ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + const char *name = (*current_).first.c_str(); + return name ? name : ""; +#else + if ( !isArray_ ) + return ValueInternalMap::key( iterator_.map_ ); + return ""; +#endif +} + + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueConstIterator +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueConstIterator::ValueConstIterator() +{ +} + + +#ifndef JSON_VALUE_USE_INTERNAL_MAP +ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator ¤t ) + : ValueIteratorBase( current ) +{ +} +#else +ValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state ) + : ValueIteratorBase( state ) +{ +} + +ValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state ) + : ValueIteratorBase( state ) +{ +} +#endif + +ValueConstIterator & +ValueConstIterator::operator =( const ValueIteratorBase &other ) +{ + copy( other ); + return *this; +} + + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueIterator +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueIterator::ValueIterator() +{ +} + + +#ifndef JSON_VALUE_USE_INTERNAL_MAP +ValueIterator::ValueIterator( const Value::ObjectValues::iterator ¤t ) + : ValueIteratorBase( current ) +{ +} +#else +ValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state ) + : ValueIteratorBase( state ) +{ +} + +ValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state ) + : ValueIteratorBase( state ) +{ +} +#endif + +ValueIterator::ValueIterator( const ValueConstIterator &other ) + : ValueIteratorBase( other ) +{ +} + +ValueIterator::ValueIterator( const ValueIterator &other ) + : ValueIteratorBase( other ) +{ +} + +ValueIterator & +ValueIterator::operator =( const SelfType &other ) +{ + copy( other ); + return *this; +} diff --git a/connor_signature/json_writer.cpp b/connor_signature/json_writer.cpp new file mode 100644 index 0000000..2a9f0db --- /dev/null +++ b/connor_signature/json_writer.cpp @@ -0,0 +1,829 @@ +#include "writer.h" +#include +#include +#include +#include +#include +#include +#include + +#if _MSC_VER >= 1400 // VC++ 8.0 +#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. +#endif + +namespace Json { + +static bool isControlCharacter(char ch) +{ + return ch > 0 && ch <= 0x1F; +} + +static bool containsControlCharacter( const char* str ) +{ + while ( *str ) + { + if ( isControlCharacter( *(str++) ) ) + return true; + } + return false; +} +static void uintToString( unsigned int value, + char *¤t ) +{ + *--current = 0; + do + { + *--current = (value % 10) + '0'; + value /= 10; + } + while ( value != 0 ); +} + +std::string valueToString( Int value ) +{ + char buffer[32]; + char *current = buffer + sizeof(buffer); + bool isNegative = value < 0; + if ( isNegative ) + value = -value; + uintToString( UInt(value), current ); + if ( isNegative ) + *--current = '-'; + assert( current >= buffer ); + return current; +} + + +std::string valueToString( UInt value ) +{ + char buffer[32]; + char *current = buffer + sizeof(buffer); + uintToString( value, current ); + assert( current >= buffer ); + return current; +} + +std::string valueToString( double value ) +{ + char buffer[32]; +#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 to avoid warning. + sprintf_s(buffer, sizeof(buffer), "%#.16g", value); +#else + sprintf(buffer, "%#.16g", value); +#endif + char* ch = buffer + strlen(buffer) - 1; + if (*ch != '0') return buffer; // nothing to truncate, so save time + while(ch > buffer && *ch == '0'){ + --ch; + } + char* last_nonzero = ch; + while(ch >= buffer){ + switch(*ch){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + --ch; + continue; + case '.': + // Truncate zeroes to save bytes in output, but keep one. + *(last_nonzero+2) = '\0'; + return buffer; + default: + return buffer; + } + } + return buffer; +} + + +std::string valueToString( bool value ) +{ + return value ? "true" : "false"; +} + +std::string valueToQuotedString( const char *value ) +{ + // Not sure how to handle unicode... + if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && !containsControlCharacter( value )) + return std::string("\"") + value + "\""; + // We have to walk value and escape any special characters. + // Appending to std::string is not efficient, but this should be rare. + // (Note: forward slashes are *not* rare, but I am not escaping them.) + unsigned maxsize = strlen(value)*2 + 3; // allescaped+quotes+NULL + std::string result; + result.reserve(maxsize); // to avoid lots of mallocs + result += "\""; + for (const char* c=value; *c != 0; ++c) + { + switch(*c) + { + case '\"': + result += "\\\""; + break; + case '\\': + result += "\\\\"; + break; + case '\b': + result += "\\b"; + break; + case '\f': + result += "\\f"; + break; + case '\n': + result += "\\n"; + break; + case '\r': + result += "\\r"; + break; + case '\t': + result += "\\t"; + break; + //case '/': + // Even though \/ is considered a legal escape in JSON, a bare + // slash is also legal, so I see no reason to escape it. + // (I hope I am not misunderstanding something. + // blep notes: actually escaping \/ may be useful in javascript to avoid (*c); + result += oss.str(); + } + else + { + result += *c; + } + break; + } + } + result += "\""; + return result; +} + +// Class Writer +// ////////////////////////////////////////////////////////////////// +Writer::~Writer() +{ +} + + +// Class FastWriter +// ////////////////////////////////////////////////////////////////// + +FastWriter::FastWriter() + : yamlCompatiblityEnabled_( false ) +{ +} + + +void +FastWriter::enableYAMLCompatibility() +{ + yamlCompatiblityEnabled_ = true; +} + + +std::string +FastWriter::write( const Value &root ) +{ + document_ = ""; + writeValue( root ); + document_ += "\n"; + return document_; +} + + +void +FastWriter::writeValue( const Value &value ) +{ + switch ( value.type() ) + { + case nullValue: + document_ += "null"; + break; + case intValue: + document_ += valueToString( value.asInt() ); + break; + case uintValue: + document_ += valueToString( value.asUInt() ); + break; + case realValue: + document_ += valueToString( value.asDouble() ); + break; + case stringValue: + document_ += valueToQuotedString( value.asCString() ); + break; + case booleanValue: + document_ += valueToString( value.asBool() ); + break; + case arrayValue: + { + document_ += "["; + int size = value.size(); + for ( int index =0; index < size; ++index ) + { + if ( index > 0 ) + document_ += ","; + writeValue( value[index] ); + } + document_ += "]"; + } + break; + case objectValue: + { + Value::Members members( value.getMemberNames() ); + document_ += "{"; + for ( Value::Members::iterator it = members.begin(); + it != members.end(); + ++it ) + { + const std::string &name = *it; + if ( it != members.begin() ) + document_ += ","; + document_ += valueToQuotedString( name.c_str() ); + document_ += yamlCompatiblityEnabled_ ? ": " + : ":"; + writeValue( value[name] ); + } + document_ += "}"; + } + break; + } +} + + +// Class StyledWriter +// ////////////////////////////////////////////////////////////////// + +StyledWriter::StyledWriter() + : rightMargin_( 74 ) + , indentSize_( 3 ) +{ +} + + +std::string +StyledWriter::write( const Value &root ) +{ + document_ = ""; + addChildValues_ = false; + indentString_ = ""; + writeCommentBeforeValue( root ); + writeValue( root ); + writeCommentAfterValueOnSameLine( root ); + document_ += "\n"; + return document_; +} + + +void +StyledWriter::writeValue( const Value &value ) +{ + switch ( value.type() ) + { + case nullValue: + pushValue( "null" ); + break; + case intValue: + pushValue( valueToString( value.asInt() ) ); + break; + case uintValue: + pushValue( valueToString( value.asUInt() ) ); + break; + case realValue: + pushValue( valueToString( value.asDouble() ) ); + break; + case stringValue: + pushValue( valueToQuotedString( value.asCString() ) ); + break; + case booleanValue: + pushValue( valueToString( value.asBool() ) ); + break; + case arrayValue: + writeArrayValue( value); + break; + case objectValue: + { + Value::Members members( value.getMemberNames() ); + if ( members.empty() ) + pushValue( "{}" ); + else + { + writeWithIndent( "{" ); + indent(); + Value::Members::iterator it = members.begin(); + while ( true ) + { + const std::string &name = *it; + const Value &childValue = value[name]; + writeCommentBeforeValue( childValue ); + writeWithIndent( valueToQuotedString( name.c_str() ) ); + document_ += " : "; + writeValue( childValue ); + if ( ++it == members.end() ) + { + writeCommentAfterValueOnSameLine( childValue ); + break; + } + document_ += ","; + writeCommentAfterValueOnSameLine( childValue ); + } + unindent(); + writeWithIndent( "}" ); + } + } + break; + } +} + + +void +StyledWriter::writeArrayValue( const Value &value ) +{ + unsigned size = value.size(); + if ( size == 0 ) + pushValue( "[]" ); + else + { + bool isArrayMultiLine = isMultineArray( value ); + if ( isArrayMultiLine ) + { + writeWithIndent( "[" ); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index =0; + while ( true ) + { + const Value &childValue = value[index]; + writeCommentBeforeValue( childValue ); + if ( hasChildValue ) + writeWithIndent( childValues_[index] ); + else + { + writeIndent(); + writeValue( childValue ); + } + if ( ++index == size ) + { + writeCommentAfterValueOnSameLine( childValue ); + break; + } + document_ += ","; + writeCommentAfterValueOnSameLine( childValue ); + } + unindent(); + writeWithIndent( "]" ); + } + else // output on a single line + { + assert( childValues_.size() == size ); + document_ += "[ "; + for ( unsigned index =0; index < size; ++index ) + { + if ( index > 0 ) + document_ += ", "; + document_ += childValues_[index]; + } + document_ += " ]"; + } + } +} + + +bool +StyledWriter::isMultineArray( const Value &value ) +{ + int size = value.size(); + bool isMultiLine = size*3 >= rightMargin_ ; + childValues_.clear(); + for ( int index =0; index < size && !isMultiLine; ++index ) + { + const Value &childValue = value[index]; + isMultiLine = isMultiLine || + ( (childValue.isArray() || childValue.isObject()) && + childValue.size() > 0 ); + } + if ( !isMultiLine ) // check if line length > max line length + { + childValues_.reserve( size ); + addChildValues_ = true; + int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]' + for ( int index =0; index < size && !isMultiLine; ++index ) + { + writeValue( value[index] ); + lineLength += int( childValues_[index].length() ); + isMultiLine = isMultiLine && hasCommentForValue( value[index] ); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + + +void +StyledWriter::pushValue( const std::string &value ) +{ + if ( addChildValues_ ) + childValues_.push_back( value ); + else + document_ += value; +} + + +void +StyledWriter::writeIndent() +{ + if ( !document_.empty() ) + { + char last = document_[document_.length()-1]; + if ( last == ' ' ) // already indented + return; + if ( last != '\n' ) // Comments may add new-line + document_ += '\n'; + } + document_ += indentString_; +} + + +void +StyledWriter::writeWithIndent( const std::string &value ) +{ + writeIndent(); + document_ += value; +} + + +void +StyledWriter::indent() +{ + indentString_ += std::string( indentSize_, ' ' ); +} + + +void +StyledWriter::unindent() +{ + assert( int(indentString_.size()) >= indentSize_ ); + indentString_.resize( indentString_.size() - indentSize_ ); +} + + +void +StyledWriter::writeCommentBeforeValue( const Value &root ) +{ + if ( !root.hasComment( commentBefore ) ) + return; + document_ += normalizeEOL( root.getComment( commentBefore ) ); + document_ += "\n"; +} + + +void +StyledWriter::writeCommentAfterValueOnSameLine( const Value &root ) +{ + if ( root.hasComment( commentAfterOnSameLine ) ) + document_ += " " + normalizeEOL( root.getComment( commentAfterOnSameLine ) ); + + if ( root.hasComment( commentAfter ) ) + { + document_ += "\n"; + document_ += normalizeEOL( root.getComment( commentAfter ) ); + document_ += "\n"; + } +} + + +bool +StyledWriter::hasCommentForValue( const Value &value ) +{ + return value.hasComment( commentBefore ) + || value.hasComment( commentAfterOnSameLine ) + || value.hasComment( commentAfter ); +} + + +std::string +StyledWriter::normalizeEOL( const std::string &text ) +{ + std::string normalized; + normalized.reserve( text.length() ); + const char *begin = text.c_str(); + const char *end = begin + text.length(); + const char *current = begin; + while ( current != end ) + { + char c = *current++; + if ( c == '\r' ) // mac or dos EOL + { + if ( *current == '\n' ) // convert dos EOL + ++current; + normalized += '\n'; + } + else // handle unix EOL & other char + normalized += c; + } + return normalized; +} + + +// Class StyledStreamWriter +// ////////////////////////////////////////////////////////////////// + +StyledStreamWriter::StyledStreamWriter( std::string indentation ) + : document_(NULL) + , rightMargin_( 74 ) + , indentation_( indentation ) +{ +} + + +void +StyledStreamWriter::write( std::ostream &out, const Value &root ) +{ + document_ = &out; + addChildValues_ = false; + indentString_ = ""; + writeCommentBeforeValue( root ); + writeValue( root ); + writeCommentAfterValueOnSameLine( root ); + *document_ << "\n"; + document_ = NULL; // Forget the stream, for safety. +} + + +void +StyledStreamWriter::writeValue( const Value &value ) +{ + switch ( value.type() ) + { + case nullValue: + pushValue( "null" ); + break; + case intValue: + pushValue( valueToString( value.asInt() ) ); + break; + case uintValue: + pushValue( valueToString( value.asUInt() ) ); + break; + case realValue: + pushValue( valueToString( value.asDouble() ) ); + break; + case stringValue: + pushValue( valueToQuotedString( value.asCString() ) ); + break; + case booleanValue: + pushValue( valueToString( value.asBool() ) ); + break; + case arrayValue: + writeArrayValue( value); + break; + case objectValue: + { + Value::Members members( value.getMemberNames() ); + if ( members.empty() ) + pushValue( "{}" ); + else + { + writeWithIndent( "{" ); + indent(); + Value::Members::iterator it = members.begin(); + while ( true ) + { + const std::string &name = *it; + const Value &childValue = value[name]; + writeCommentBeforeValue( childValue ); + writeWithIndent( valueToQuotedString( name.c_str() ) ); + *document_ << " : "; + writeValue( childValue ); + if ( ++it == members.end() ) + { + writeCommentAfterValueOnSameLine( childValue ); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine( childValue ); + } + unindent(); + writeWithIndent( "}" ); + } + } + break; + } +} + + +void +StyledStreamWriter::writeArrayValue( const Value &value ) +{ + unsigned size = value.size(); + if ( size == 0 ) + pushValue( "[]" ); + else + { + bool isArrayMultiLine = isMultineArray( value ); + if ( isArrayMultiLine ) + { + writeWithIndent( "[" ); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index =0; + while ( true ) + { + const Value &childValue = value[index]; + writeCommentBeforeValue( childValue ); + if ( hasChildValue ) + writeWithIndent( childValues_[index] ); + else + { + writeIndent(); + writeValue( childValue ); + } + if ( ++index == size ) + { + writeCommentAfterValueOnSameLine( childValue ); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine( childValue ); + } + unindent(); + writeWithIndent( "]" ); + } + else // output on a single line + { + assert( childValues_.size() == size ); + *document_ << "[ "; + for ( unsigned index =0; index < size; ++index ) + { + if ( index > 0 ) + *document_ << ", "; + *document_ << childValues_[index]; + } + *document_ << " ]"; + } + } +} + + +bool +StyledStreamWriter::isMultineArray( const Value &value ) +{ + int size = value.size(); + bool isMultiLine = size*3 >= rightMargin_ ; + childValues_.clear(); + for ( int index =0; index < size && !isMultiLine; ++index ) + { + const Value &childValue = value[index]; + isMultiLine = isMultiLine || + ( (childValue.isArray() || childValue.isObject()) && + childValue.size() > 0 ); + } + if ( !isMultiLine ) // check if line length > max line length + { + childValues_.reserve( size ); + addChildValues_ = true; + int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]' + for ( int index =0; index < size && !isMultiLine; ++index ) + { + writeValue( value[index] ); + lineLength += int( childValues_[index].length() ); + isMultiLine = isMultiLine && hasCommentForValue( value[index] ); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + + +void +StyledStreamWriter::pushValue( const std::string &value ) +{ + if ( addChildValues_ ) + childValues_.push_back( value ); + else + *document_ << value; +} + + +void +StyledStreamWriter::writeIndent() +{ + /* + Some comments in this method would have been nice. ;-) + + if ( !document_.empty() ) + { + char last = document_[document_.length()-1]; + if ( last == ' ' ) // already indented + return; + if ( last != '\n' ) // Comments may add new-line + *document_ << '\n'; + } + */ + *document_ << '\n' << indentString_; +} + + +void +StyledStreamWriter::writeWithIndent( const std::string &value ) +{ + writeIndent(); + *document_ << value; +} + + +void +StyledStreamWriter::indent() +{ + indentString_ += indentation_; +} + + +void +StyledStreamWriter::unindent() +{ + assert( indentString_.size() >= indentation_.size() ); + indentString_.resize( indentString_.size() - indentation_.size() ); +} + + +void +StyledStreamWriter::writeCommentBeforeValue( const Value &root ) +{ + if ( !root.hasComment( commentBefore ) ) + return; + *document_ << normalizeEOL( root.getComment( commentBefore ) ); + *document_ << "\n"; +} + + +void +StyledStreamWriter::writeCommentAfterValueOnSameLine( const Value &root ) +{ + if ( root.hasComment( commentAfterOnSameLine ) ) + *document_ << " " + normalizeEOL( root.getComment( commentAfterOnSameLine ) ); + + if ( root.hasComment( commentAfter ) ) + { + *document_ << "\n"; + *document_ << normalizeEOL( root.getComment( commentAfter ) ); + *document_ << "\n"; + } +} + + +bool +StyledStreamWriter::hasCommentForValue( const Value &value ) +{ + return value.hasComment( commentBefore ) + || value.hasComment( commentAfterOnSameLine ) + || value.hasComment( commentAfter ); +} + + +std::string +StyledStreamWriter::normalizeEOL( const std::string &text ) +{ + std::string normalized; + normalized.reserve( text.length() ); + const char *begin = text.c_str(); + const char *end = begin + text.length(); + const char *current = begin; + while ( current != end ) + { + char c = *current++; + if ( c == '\r' ) // mac or dos EOL + { + if ( *current == '\n' ) // convert dos EOL + ++current; + normalized += '\n'; + } + else // handle unix EOL & other char + normalized += c; + } + return normalized; +} + + +std::ostream& operator<<( std::ostream &sout, const Value &root ) +{ + Json::StyledStreamWriter writer; + writer.write(sout, root); + return sout; +} + + +} // namespace Json diff --git a/connor_signature/kutil.cpp b/connor_signature/kutil.cpp new file mode 100644 index 0000000..12293a3 --- /dev/null +++ b/connor_signature/kutil.cpp @@ -0,0 +1,1492 @@ +#pragma warning (disable: 4996) +#pragma warning (disable: 4819) + +#include "kutil.h" + +FILE* logFile = NULL; + +#define MAX_PATH_LENGTH 200 +#define MAX_PRINTLINE_LENGTH 400000 + + +//void sendGetRequest() +//{ +// //ʼsocketʼ; +// WSADATA wData; +// ::WSAStartup(MAKEWORD(2, 2), &wData); +// +// SOCKET clientSocket = socket(AF_INET, 1, 0); +// struct sockaddr_in ServerAddr = { 0 }; +// int Ret = 0; +// int AddrLen = 0; +// HANDLE hThread = 0; +// +// char *bufSend = "Get /check?+ HTTP/1.1\r\n" +// "Connection:Keep-Alive\r\n" +// "Accept-Encoding:gzip, deflate\r\n" +// "Accept-Language:zh-CN,en,*\r\n" +// "host:www.baidu.com\r\n" +// "User-Agent:Mozilla/5.0\r\n\r\n"; +// +// char addIp[256] = { 0 }; +// GetIpByDomainName("www.baidu.com", addIp); +// ServerAddr.sin_addr.s_addr = inet_addr(addIp); +// ServerAddr.sin_port = htons(80);; +// ServerAddr.sin_family = AF_INET; +// char bufData[3069] = { 0 }; +// char bufRecv[3069] = { 0 }; +// int errNo = 0; +// errNo = connect(clientSocket, (sockaddr*)&ServerAddr, sizeof(ServerAddr)); +// if (errNo == 0) +// { +// //ͳɹ򷵻طͳɹֽ; +// if (send(clientSocket, bufSend, strlen(bufData), 0)>0) +// { +// cout << "ͳɹ\n";; +// } +// //ܳɹ򷵻ؽֽܵ; +// if (recv(clientSocket, bufRecv, 3069, 0)>0) +// { +// cout << "ܵ:" << bufRecv << endl; +// } +// } +// else +// { +// errNo = WSAGetLastError(); +// } +// //socket; +// ::WSACleanup(); +//} +// +//BOOL GetIpByDomainName(char *szHost, char* szIp) +//{ +// WSADATA wsaData; +// +// HOSTENT *pHostEnt; +// int nAdapter = 0; +// struct sockaddr_in sAddr; +// if (WSAStartup(0x0101, &wsaData)) +// { +// printf(" gethostbyname error for host:\n"); +// return FALSE; +// } +// +// pHostEnt = gethostbyname(szHost); +// if (pHostEnt) +// { +// if (pHostEnt->h_addr_list[nAdapter]) +// { +// memcpy(&sAddr.sin_addr.s_addr, pHostEnt->h_addr_list[nAdapter], pHostEnt->h_length); +// sprintf(szIp, "%s", inet_ntoa(sAddr.sin_addr)); +// } +// } +// else +// { +// // DWORD dwError = GetLastError(); +// // CString csError; +// // csError.Format("%d", dwError); +// } +// WSACleanup(); +// return TRUE; +//} + +int write_string_to_file_append(const std::string & file_string, const std::string str) +{ + std::ofstream OsWrite(file_string, std::ofstream::app); + OsWrite << str; + OsWrite << std::endl; + OsWrite.close(); + return 0; +} + + +void setProperty(tag_t formValue, char * propertyName, tag_t toValue, char * toPropertyName) +{ + PROP_value_type_t propertyType; + char * valtype_n = NULL; + //ȡ + AOM_ask_value_type(formValue, propertyName, &propertyType, &valtype_n); + switch (propertyType) + { + case PROP_date: + date_t propertyValue; + AOM_ask_value_date(formValue, propertyName, &propertyValue); + //lock + AOM_lock(toValue); + AOM_set_value_date(toValue, toPropertyName, propertyValue); + //save + AOM_save(toValue); + //unlock + AOM_unlock(toValue); + AOM_refresh(toValue, FALSE); + break; + case PROP_double: + double propertyValue2; + AOM_ask_value_double(formValue, propertyName, &propertyValue2); + //lock + AOM_lock(toValue); + AOM_set_value_double(toValue, toPropertyName, propertyValue2); + //save + AOM_save(toValue); + //unlock + AOM_unlock(toValue); + AOM_refresh(toValue, FALSE); + break; + case PROP_int: + int propertyValue3; + AOM_ask_value_int(formValue, propertyName, &propertyValue3); + //lock + AOM_lock(toValue); + AOM_set_value_int(toValue, toPropertyName, propertyValue3); + //save + AOM_save(toValue); + //unlock + AOM_unlock(toValue); + AOM_refresh(toValue, FALSE); + break; + case PROP_string: + char * propertyValue4; + AOM_ask_value_string(formValue, propertyName, &propertyValue4); + //lock + AOM_lock(toValue); + AOM_set_value_string(toValue, toPropertyName, propertyValue4); + //save + AOM_save(toValue); + //unlock + AOM_unlock(toValue); + AOM_refresh(toValue, FALSE); + DOFREE(propertyValue4); + break; + default: + break; + } + DOFREE(valtype_n); +} + +bool is_str_utf8(const char* str) +{ + unsigned int nBytes = 0;//UFT81-6ֽڱ,ASCIIһֽ + unsigned char chr = *str; + bool bAllAscii = true; + for (unsigned int i = 0; str[i] != '\0'; ++i) { + chr = *(str + i); + //жǷASCII,,˵пUTF8,ASCII7λ,λΪ0,0xxxxxxx + if (nBytes == 0 && (chr & 0x80) != 0) { + bAllAscii = false; + } + if (nBytes == 0) { + //ASCII,ӦǶֽڷ,ֽ + if (chr >= 0x80) { + if (chr >= 0xFC && chr <= 0xFD) { + nBytes = 6; + } + else if (chr >= 0xF8) { + nBytes = 5; + } + else if (chr >= 0xF0) { + nBytes = 4; + } + else if (chr >= 0xE0) { + nBytes = 3; + } + else if (chr >= 0xC0) { + nBytes = 2; + } + else { + return false; + } + nBytes--; + } + } + else { + //ֽڷķֽ,ӦΪ 10xxxxxx + if ((chr & 0xC0) != 0x80) { + return false; + } + //ΪΪֹ + nBytes--; + } + } + //ΥUTF8 + if (nBytes != 0) { + return false; + } + if (bAllAscii) { //ȫASCII, ҲUTF8 + return true; + } + return true; +} + +bool find_prop(int prop_cnt, char** props, const char* prop) { + for (int i = 0; i < prop_cnt; i++) { + if (tc_strcmp(props[i], prop) == 0) { + return true; + } + } + return false; +} + +string itoa_self(int i) +{ + stringstream ss; + ss << i; + return ss.str(); +} + +//ļ뵽string +string readFileIntoString(char * filename) +{ + //string line; + + //ifstream infile(filename, ios::in); + + //if (infile) // иļ + //{ + // while (getline(infile, line, '\n')) // lineвÿеĻз + // { + // cout << line << endl; + // } + //} + + // + ////bufַ + //cout << line< jsonstr2map(const string& json) +{ + //cout << json << endl; + Json::Reader reader; + Json::Value value; + map maps; + + if (json.length() > 0) + { + if (reader.parse(json, value)) + { + Json::Value::Members members = value.getMemberNames(); + for (Json::Value::Members::iterator it = members.begin(); it != members.end(); it++) + { + Json::ValueType vt = value[*it].type(); + switch (vt) + { + case Json::stringValue: + { + maps.insert(pair(*it, value[*it].asString())); + break; + } + case Json::intValue: + { + int intTmp = value[*it].asInt(); + maps.insert(pair(*it, itoa_self(intTmp))); + break; + } + case Json::arrayValue: + { + std::string strid; + for (unsigned int i = 0; i < value[*it].size(); i++) + { + strid += value[*it][i].asString(); + strid += ","; + } + if (!strid.empty()) + { + strid = strid.substr(0, strid.size() - 1); + } + maps.insert(pair(*it, strid)); + break; + } + default: + { + break; + } + }//end switch + }//end for + }//end if + } + + return maps; +} + + +//ȡǰʱ +void getCurrentTime(date_t * now) +{ + time_t tim = time(NULL); + time(&tim); + struct tm * gmt = NULL; + gmt = localtime(&tim); + //char temp[MAX_PATH_LENGTH]; + //sprintf(temp, "%d-%d-%d", gmt->tm_year, gmt->tm_mon, gmt->tm_mday); + cout << now->year << 1900 + gmt->tm_year; //02021 + cout << now->month << 1 + gmt->tm_mon; //8 + cout << now->day << gmt->tm_mday; + cout << now->hour << gmt->tm_hour; + cout << now->minute << gmt->tm_min; +} + +//ȡǰĺλ +int getLast2Year(char* &year) +{ + int ifail = ITK_ok; + time_t now = time(0); + tm* ltm = localtime(&now); + char temp[200] = ""; + snprintf(temp, sizeof(temp), "%d", 1900 + ltm->tm_year); + string year2(temp); + year2 = year2.substr(2); + strcpy(temp, year2.c_str()); + year = temp; + return ifail; +} + +//ֻԵֵ +int connor_set_prop_value(char* propname, const char* propvalue, tag_t &tag_instance) { + int ifail = ITK_ok; + + POM_AM__set_application_bypass(true); + char * class_id = NULL; + tag_t attr_id = NULLTAG, class_tag = NULLTAG; + + ITKCALL(AOM_lock(tag_instance)); + ITKCALL(ifail = POM_class_of_instance(tag_instance, &class_tag)); + ITKCALL(ifail = POM_name_of_class(class_tag, &class_id)); + ITKCALL(ifail = POM_attr_id_of_attr(propname, class_id, &attr_id)); + ITKCALL(POM_refresh_instances_any_class(1, &tag_instance, POM_modify_lock)); + ITKCALL(POM_set_attr_string(1, &tag_instance, attr_id, propvalue)); + ITKCALL(POM_save_instances(1, &tag_instance, true)); + ITKCALL(AOM_unlock(tag_instance)); + DOFREE(class_id); + POM_AM__set_application_bypass(false); + return ITK_ok; +} + +//ֻԵֵ +int connor_set_prop_value(void *returnValue) +{ + int ifail = ITK_ok; + WriteLog(ifail, "> ʼִ <ò޸ĵ> "); + char *propname = NULL, *propvalue = NULL, *class_id = NULL; + tag_t tag_instance = NULLTAG, attr_id = NULLTAG, class_tag = NULLTAG; + ITKCALL(ifail = USERARG_get_string_argument(&propname)); + ITKCALL(ifail = USERARG_get_string_argument(&propvalue)); + ITKCALL(ifail = USERARG_get_tag_argument(&tag_instance)); + WriteLog(ifail, ">>> propname = %s propvalue = %s", propname, propvalue); + + { + POM_AM__set_application_bypass(true); + ITKCALL(AOM_lock(tag_instance)); + ITKCALL(ifail = POM_class_of_instance(tag_instance, &class_tag)); + ITKCALL(ifail = POM_name_of_class(class_tag, &class_id)); + ITKCALL(ifail = POM_attr_id_of_attr(propname, class_id, &attr_id)); + ITKCALL(POM_refresh_instances_any_class(1, &tag_instance, POM_modify_lock)); + ITKCALL(POM_set_attr_string(1, &tag_instance, attr_id, propvalue)); + ITKCALL(POM_save_instances(1, &tag_instance, true)); + ITKCALL(AOM_unlock(tag_instance)); + DOFREE(class_id); + POM_AM__set_application_bypass(false); + } + //÷ֵ + char server_string[10]; + if (ifail == ITK_ok) + { + tc_strcpy(server_string, "true"); + } + else + { + tc_strcpy(server_string, "false"); + } + + *((char **)returnValue) = (char *)MEM_alloc((strlen(server_string) + 1) * sizeof(char)); + tc_strcpy(*((char **)returnValue), server_string); + WriteLog(ifail, "> ִн <ò޸ĵ> "); + return ifail; +} + +/* + ж϶objtagǷtype_name +*/ +bool isTypeOf(tag_t objtag, const char * type_name) { + tag_t type = NULLTAG; + TCTYPE_ask_object_type(objtag, &type); + tag_t item_type = NULLTAG; + TCTYPE_find_type(type_name, "", &item_type); + bool is_type = false; + if (item_type != NULLTAG) { + logical isok = FALSE; + TCTYPE_is_type_of(type, item_type, &isok); + if (isok) { + is_type = true; + } + } + return is_type; +} + +void initUserDir(char *userId) { + char logFileDir[MAX_PATH_LENGTH]; + memset(logFileDir, 0, sizeof(logFileDir)); + sprintf(logFileDir, "%s", getenv("TEMP")); + strcat(logFileDir, "\\tc_"); + strcat(logFileDir, userId); + if (chdir(logFileDir) != ITK_ok) { + printf(">> ½·%s\n", logFileDir); + mkdir(logFileDir); + } +} + +bool copyFile(const char *SRC, const char* DEST) +{ + std::ifstream src(SRC, std::ios::binary); + std::ofstream dest(DEST, std::ios::binary); + dest << src.rdbuf(); + return src && dest; +} + +int WriteToFile(logical debug, FILE* file, const char* format, ...) +{ + va_list arg; + char tmp[MAX_PRINTLINE_LENGTH]; + + //get the message + memset(tmp, 0, sizeof(tmp)); + va_start(arg, format); + vsprintf(tmp, format, arg); + va_end(arg); + //print message to log file + WriteLog(debug, "дݣ%s", tmp); + if (file) + { + fprintf(file, "%s", tmp); + fflush(file); + return ITK_ok; + } + else + { + WriteLog(debug, "дļʧܣļ"); + return -1; + } +} + +void WriteLog(logical debug, const char* format, ...) +{ + va_list arg; + char tmp[MAX_PRINTLINE_LENGTH]; + char date_string[MAX_PATH_LENGTH]; + time_t now; + struct tm *p; + + //get the message + memset(tmp, 0, sizeof(tmp)); + va_start(arg, format); + vsprintf(tmp, format, arg); + va_end(arg); + //----------print to command window for trace--------// + //printf("%s\n", tmp); + printf("%s\n", tmp); + //print message to log file + TC_write_syslog("%s\n", tmp); +} + +void WriteLog2(logical debug, const char* format, ...) +{ + va_list arg; + char tmp[MAX_PRINTLINE_LENGTH]; + char date_string[MAX_PATH_LENGTH]; + time_t now; + struct tm *p; + + //get the message + memset(tmp, 0, sizeof(tmp)); + va_start(arg, format); + vsprintf(tmp, format, arg); + va_end(arg); + //----------print to command window for trace--------// + //printf("%s\n", tmp); + printf("%s\n", tmp); + //print message to log file + if (!debug) { + return; + } + if (logFile) + { + time(&now); + //current_time(&status_now); + p = localtime(&now); + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%02d:%02d:%02d", p->tm_hour, p->tm_min, p->tm_sec); + fprintf(logFile, "[%s] %s\n", date_string, tmp); + fflush(logFile); + } + else + { + printf("*!Error!*: Log File Not Exist\n"); + } +} + +void CloseLog(void) +{ + if (logFile) + { + fclose(logFile); + logFile = NULL; + } +} + + +int CreateTempFile(logical debug, const char* temp_path, char *file_name, char* ext, char **fullname, FILE **file) +{ + int ifail = ITK_ok; + char logFileName[MAX_PATH_LENGTH]; + + if (chdir(temp_path) != ITK_ok) { + printf(">> ½·%s", temp_path); + mkdir(temp_path); + } + memset(logFileName, 0, sizeof(logFileName)); + //get session_uid to make sure the log file name unique + //POM_ask_session(&session_tag); + //ITK__convert_tag_to_uid(session_tag, &session_uid); + //get logFileName + sprintf(logFileName, "%s.%s", file_name, ext); + //printf("log file name: %s\n", logFileName); + + *fullname = (char *)MEM_alloc(sizeof(char) * 512); + sprintf(*fullname, "%s\\%s", temp_path, logFileName); + + //for(i = 0; _access((char *)logFileName, 4) == 0; i++) + /*{ + memset(logFileName, 0, sizeof(logFileName)); + sprintf(logFileName, "%s_%s_%s_%d.log", FunctionName, session_uid, date_string, i); + } + printf("final log file name: %s\n", logFileName);*/ + + //create log file + *file = fopen(logFileName, "a"); + return ITK_ok; + //CLEANUP:; + //DOFREE(date_string); + /*if(session_uid!=NULL){ + MEM_free(session_uid); + session_uid=NULL; + }*/ +} + + +int CreateTempFile(logical debug, const char* temp_path, char *file_name, char* user_id, char* ext, char **fullname, FILE **file) +{ + int ifail = ITK_ok; + //date_t status_now; + //char* date_string = NULL; + char date_string[MAX_PATH_LENGTH]; + char logFileName[MAX_PATH_LENGTH]; + //char* session_uid = NULL; + //tag_t session_tag = NULLTAG; + + time_t now; + struct tm *p; + + time(&now); + + //logFile = NULL; + //current_time(&status_now); + p = localtime(&now); + + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%4d%02d%02d%02d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + //sprintf(date_string, "%4d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday); + //if( DATE_date_to_string( status_now, "%Y%m%d%H%M%S", &date_string) != ITK_ok ) + //ifail = ITK_date_to_string (status_now, &date_string ); + //if (ifail) + //{ + // printf("!*ERROR*!: Failed to get current date time\n"); + // goto CLEANUP; + //} + if (chdir(temp_path) != ITK_ok) { + printf(">> ½·%s", temp_path); + mkdir(temp_path); + } + memset(logFileName, 0, sizeof(logFileName)); + //get session_uid to make sure the log file name unique + //POM_ask_session(&session_tag); + //ITK__convert_tag_to_uid(session_tag, &session_uid); + //get logFileName + sprintf(logFileName, "%s_%s_%s.%s", file_name, user_id, date_string, ext); + //printf("log file name: %s\n", logFileName); + + *fullname = (char *)MEM_alloc(sizeof(char) * 512); + sprintf(*fullname, "%s\\%s", temp_path, logFileName); + + //for(i = 0; _access((char *)logFileName, 4) == 0; i++) + /*{ + memset(logFileName, 0, sizeof(logFileName)); + sprintf(logFileName, "%s_%s_%s_%d.log", FunctionName, session_uid, date_string, i); + } + printf("final log file name: %s\n", logFileName);*/ + + //create log file + *file = fopen(logFileName, "a"); + return ITK_ok; + //CLEANUP:; + //DOFREE(date_string); + /*if(session_uid!=NULL){ + MEM_free(session_uid); + session_uid=NULL; + }*/ +} + + +int CreateUserFile(logical debug, char* FunctionName, char *userId, char **fullname, FILE **file) +{ + int ifail = ITK_ok; + //date_t status_now; + //char* date_string = NULL; + char date_string[MAX_PATH_LENGTH]; + char logFileDir[MAX_PATH_LENGTH]; + char logFileName[MAX_PATH_LENGTH]; + //char* session_uid = NULL; + //tag_t session_tag = NULLTAG; + + time_t now; + struct tm *p; + + time(&now); + + //logFile = NULL; + //current_time(&status_now); + p = localtime(&now); + + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%4d%02d%02d%02d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + //sprintf(date_string, "%4d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday); + //if( DATE_date_to_string( status_now, "%Y%m%d%H%M%S", &date_string) != ITK_ok ) + //ifail = ITK_date_to_string (status_now, &date_string ); + //if (ifail) + //{ + // printf("!*ERROR*!: Failed to get current date time\n"); + // goto CLEANUP; + //} + + memset(logFileDir, 0, sizeof(logFileDir)); + memset(logFileName, 0, sizeof(logFileName)); + //get log dir + sprintf(logFileDir, "%s", getenv("TEMP")); + strcat(logFileDir, "\\tc_"); + strcat(logFileDir, userId); + //printf("\n log file dir: %s\n", logFileDir); + //try to change dir to TC_USER_LOG_DIR + if (chdir(logFileDir) != ITK_ok) + { + //not set TC_USER_LOG_DIR + //log in to default TC_LOG + memset(logFileDir, 0, sizeof(logFileDir)); + sprintf(logFileDir, "%s", getenv("TC_LOG")); + WriteLog(debug, "TC_USER_LOG_DIR invalide, log file dir: %s", logFileDir); + //printf("\n TC_USER_LOG_DIR invalide, log file dir: %s\n", logFileDir); + if (chdir(logFileDir) != ITK_ok) + { + //still can not change to log dir + WriteLog(debug, "!*ERROR*!: Failed to change dir to TC_USER_LOG_DIR"); + //printf("!*ERROR*!: Failed to change dir to TC_USER_LOG_DIR\n"); + return -1; + } + } + + //get session_uid to make sure the log file name unique + //POM_ask_session(&session_tag); + //ITK__convert_tag_to_uid(session_tag, &session_uid); + //get logFileName + sprintf(logFileName, "%s_%s_%s.txt", FunctionName, userId, date_string); + //printf("log file name: %s\n", logFileName); + + *fullname = (char *)MEM_alloc(sizeof(char) * 512); + sprintf(*fullname, "%s\\%s", logFileDir, logFileName); + + //for(i = 0; _access((char *)logFileName, 4) == 0; i++) + /*{ + memset(logFileName, 0, sizeof(logFileName)); + sprintf(logFileName, "%s_%s_%s_%d.log", FunctionName, session_uid, date_string, i); + } + printf("final log file name: %s\n", logFileName);*/ + + //create log file + *file = fopen(logFileName, "a"); + return ITK_ok; + //CLEANUP:; + //DOFREE(date_string); + /*if(session_uid!=NULL){ + MEM_free(session_uid); + session_uid=NULL; + }*/ +} + + +void CreateLogFile(char* FunctionName, char *userId, char **fullname) +{ + int ifail = ITK_ok; + //date_t status_now; + //char* date_string = NULL; + char date_string[MAX_PATH_LENGTH]; + char logFileDir[MAX_PATH_LENGTH]; + char logFileName[MAX_PATH_LENGTH]; + //char* session_uid = NULL; + //tag_t session_tag = NULLTAG; + + time_t now; + struct tm *p; + + time(&now); + + logFile = NULL; + //current_time(&status_now); + p = localtime(&now); + + memset(date_string, 0, sizeof(date_string)); + //sprintf(date_string,"%4d%02d%02d%02d%02d%02d",1900+p->tm_year,p->tm_mon+1 ,p->tm_mday ,p->tm_hour,p->tm_min ,p->tm_sec ); + sprintf(date_string, "%4d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday); + //if( DATE_date_to_string( status_now, "%Y%m%d%H%M%S", &date_string) != ITK_ok ) + //ifail = ITK_date_to_string (status_now, &date_string ); + //if (ifail) + //{ + // printf("!*ERROR*!: Failed to get current date time\n"); + // goto CLEANUP; + //} + + memset(logFileDir, 0, sizeof(logFileDir)); + memset(logFileName, 0, sizeof(logFileName)); + //get log dir + sprintf(logFileDir, "%s", getenv("TEMP")); + strcat(logFileDir, "\\tc_"); + strcat(logFileDir, userId); + //printf("\n log file dir: %s\n", logFileDir); + //try to change dir to TC_USER_LOG_DIR + if (chdir(logFileDir) != ITK_ok) + { + //not set TC_USER_LOG_DIR + //log in to default TC_LOG + memset(logFileDir, 0, sizeof(logFileDir)); + sprintf(logFileDir, "%s", getenv("TC_LOG")); + printf("\n TC_USER_LOG_DIR invalide, log file dir: %s\n", logFileDir); + if (chdir(logFileDir) != ITK_ok) + { + //still can not change to log dir + printf("!*ERROR*!: Failed to change dir to TC_USER_LOG_DIR\n"); + goto CLEANUP; + } + } + + //get session_uid to make sure the log file name unique + //POM_ask_session(&session_tag); + //ITK__convert_tag_to_uid(session_tag, &session_uid); + //get logFileName + sprintf(logFileName, "%s_%s_%s.log", FunctionName, userId, date_string); + //printf("log file name: %s\n", logFileName); + + *fullname = (char *)MEM_alloc(sizeof(char) * 512); + sprintf(*fullname, "%s\\%s", logFileDir, logFileName); + + //for(i = 0; _access((char *)logFileName, 4) == 0; i++) + /*{ + memset(logFileName, 0, sizeof(logFileName)); + sprintf(logFileName, "%s_%s_%s_%d.log", FunctionName, session_uid, date_string, i); + } + printf("final log file name: %s\n", logFileName);*/ + + //create log file + logFile = fopen(logFileName, "a"); + +CLEANUP:; + //DOFREE(date_string); + /*if(session_uid!=NULL){ + MEM_free(session_uid); + session_uid=NULL; + }*/ +} + + + +void set_bypass(logical bypass) +{ + //AM__set_application_bypass(bypass); + POM_AM__set_application_bypass(bypass); +} + +bool isClass(tag_t class_id, char *className) { + tag_t *pclass_ids = NULL; + char* class_name = NULL; + int pclass_count = 0, ifail = ITK_ok; + ITKCALL(POM_name_of_class(class_id, &class_name)); + printf("class name = %s\n", class_name); + bool isType = false; + if (strcmp(class_name, className) == 0) { + isType = true; + } + DOFREE(class_name); + if (isType) { + return true; + } + ITKCALL(ifail = POM_superclasses_of_class(class_id, &pclass_count, &pclass_ids)); + for (int i = 0; i < pclass_count; i++) { + isType = isClass(pclass_ids[i], className); + if (isType) { + return true; + } + } + return false; +} + +bool isType(tag_t item, char* type) { + tag_t class_id = NULLTAG, *pclass_ids = NULL; + char* class_name = NULL; + int pclass_count = 0, ifail = ITK_ok; + + ITKCALL(POM_class_of_instance(item, &class_id)); + return isClass(class_id, type); +} + +void deleteFile(bool debug, char *path) { + //ɾļ + if (remove(path) == 0) { + WriteLog(debug, "ɾļɹ%s", path); + WriteLog2(debug, "ɾļɹ%s", path); + } + else { + WriteLog(debug, "ɾļʧܣ%s", path); + WriteLog2(debug, "ɾļʧܣ%s", path); + } +} + + +int readError(bool debug, char *errFilePath, int errCode) { + fstream _file; + _file.open(errFilePath, ios::in); + if (_file) { + WriteLog(debug, "ҵ쳣ʱļ%s", errFilePath); + ifstream fin(errFilePath); + string s; + while (getline(fin, s)) + { + WriteLog(debug, s.c_str()); + EMH_store_error_s1(EMH_severity_error, errCode, s.c_str()); + } + _file.close(); + return errCode; + } + return ITK_ok; +} + +//ݼ +int import_dataset_file(tag_t dataset, const char *ref_name, char *ext, char *fullfilename, char *original_name) +{ + int ifail = ITK_ok; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor = NULL; + AOM_refresh(dataset, FALSE); + char *new_file_name = NULL; + char new_ds_name[WSO_name_size_c + 1] = ""; + char *filename = NULL; + new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + filename = strrchr(fullfilename, '\\') + 1; + if (filename == NULL) + return ITK_ok; + + ITKCALL(ifail = IMF_import_file(fullfilename, new_file_name, SS_TEXT, &new_file_tag, &file_descriptor)); + if (ifail != ITK_ok) { + ITKCALL(ifail = IMF_import_file(fullfilename, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + } + ITKCALL(ifail = IMF_set_original_file_name2(new_file_tag, original_name)); + + ITKCALL(ifail = IMF_close_file(file_descriptor)); + ITKCALL(ifail = AOM_save(new_file_tag)); + AOM_unlock(new_file_tag); + ITKCALL(ifail = AOM_refresh(new_file_tag, FALSE)); + + ITKCALL(AOM_lock(dataset)); + if (ifail != ITK_ok) { return ifail; } + ITKCALL(ifail = RES_checkout2(dataset, "import file", NULL, getenv("TEMP"), RES_EXCLUSIVE_RESERVE)); + if (ifail != ITK_ok) { return ifail; } + ITKCALL(ifail = AE_remove_dataset_named_ref2(dataset, ref_name)); + ITKCALL(ifail = AOM_save(dataset)); + + ITKCALL(ifail = AE_add_dataset_named_ref2(dataset, ref_name, AE_PART_OF, new_file_tag)); + AOM_save(dataset); + ITKCALL(ifail = RES_checkin(dataset)); + AOM_unlock(dataset); + + //ITKCALL( AOM_refresh( dataset, FALSE ) ); + return ifail; +} + +//ݼ +int import_dataset_file_binary(tag_t dataset, const char* temp_path, const char *ref_name, char *ext, char *fullfilename, char *original_name) +{ + int ifail = ITK_ok; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor = NULL; + AOM_refresh(dataset, FALSE); + char *new_file_name = NULL; + char new_ds_name[WSO_name_size_c + 1] = ""; + char *filename = NULL; + new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + filename = strrchr(fullfilename, '\\') + 1; + if (filename == NULL) + return ITK_ok; + ITKCALL(ifail = IMF_import_file(fullfilename, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + ITKCALL(ifail = IMF_set_original_file_name2(new_file_tag, original_name)); + + ITKCALL(ifail = IMF_close_file(file_descriptor)); + ITKCALL(ifail = AOM_save(new_file_tag)); + AOM_unlock(new_file_tag); + ITKCALL(ifail = AOM_refresh(new_file_tag, FALSE)); + // + ITKCALL(ifail = AOM_lock(dataset)); + if (ifail != ITK_ok) { return ifail; } + ITKCALL(ifail = RES_checkout2(dataset, "import file", NULL, temp_path, RES_EXCLUSIVE_RESERVE)); + if (ifail != ITK_ok) { return ifail; } + ITKCALL(ifail = AE_remove_dataset_named_ref2(dataset, ref_name)); + if (ifail != ITK_ok) { return ifail; } + ITKCALL(ifail = AOM_save(dataset)); + ITKCALL(ifail = AE_add_dataset_named_ref2(dataset, ref_name, AE_PART_OF, new_file_tag)); + AOM_save(dataset); + ITKCALL(ifail = RES_checkin(dataset)); + AOM_unlock(dataset); + //ITKCALL( AOM_refresh( dataset, FALSE ) ); + return ifail; +} + + +void Split(string strArg, char spliter, vector &ans) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + if (strArg.find_first_not_of(' ') == string::npos) + strArg = ""; + while (strArg.size() > 0) + { + index0 = strArg.find_first_of(spliter); + if (index0 != string::npos) + { + one_arg = strArg.substr(0, index0); + strArg = strArg.substr(index0 + 1); + ans.push_back(one_arg); + } + else + { + ans.push_back(strArg); + break; + } + } +} + +void Split(string strArg, string spliter, vector &ans) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + if (strArg.find_first_not_of(' ') == string::npos) + strArg = ""; + while (strArg.size() > 0) + { + index0 = strArg.find_first_of(spliter); + if (index0 != string::npos) + { + one_arg = strArg.substr(0, index0); + strArg = strArg.substr(index0 + 1); + ans.push_back(one_arg); + } + else + { + ans.push_back(strArg); + break; + } + } +} + +bool inArray(vector types, string type) { + int len = types.size(); + for (int i = 0; i < len; i++) { + if (strcmp(types[i].c_str(), type.c_str()) == 0) { + return true; + } + } + return false; +} + +int getIndexInArray(vector types, string type) { + int len = types.size(); + for (int i = 0; i < len; i++) { + if (strcmp(types[i].c_str(), type.c_str()) == 0) { + return i; + } + } + return -1; +} + +bool CheckType(string config, char* type, char spliter) { + vector types; + Split(config, spliter, types); + int len = types.size(); + for (int i = 0; i < len; i++) { + if (strcmp(types[i].c_str(), type) == 0) { + return true; + } + } + return false; +} + +int GetProcessTargets(bool debug, int att_cnt, tag_t *attachments, vector &targets, char* formType, char splitter) { + char *object_name = NULL, *object_type = NULL; + int ifail = ITK_ok; + WriteLog(debug, "ʼĿ%d", att_cnt); + for (int i = 0; i < att_cnt; i++) { + ITKCALL(ifail = WSOM_ask_name2(attachments[i], &object_name)); + ITKCALL(ifail = WSOM_ask_object_type2(attachments[i], &object_type)); + WriteLog(debug, "%d. ̶<%s>ͣ%s", i + 1, object_name, object_type); + //if (strcmp(object_type, TYPE_ITEM_PZJ.c_str()) == 0) { + if (CheckType(formType, object_type, splitter)) { + targets.push_back(attachments[i]); + } + DOFREE(object_name); + DOFREE(object_type); + } + return ITK_ok; +} + +int findUser(bool debug, string userStr, tag_t *user_tag) { + int ind1 = userStr.find_first_of('('); + int ind2 = userStr.find_first_of(')'); + WriteLog(debug, "ѯû%s", userStr.c_str()); + if (ind1 != string::npos&&ind2 != string::npos&&ind1 < ind2) { + userStr = userStr.substr(ind1 + 1, ind2 - ind1 - 1); + WriteLog(debug, ">> ûid: %s", userStr.c_str()); + } + int ifail = ITK_ok; + ITKCALL(ifail = SA_find_user2(userStr.c_str(), user_tag)); + return ifail; +} + +int GetBomLinePropString(bool debug, tag_t line, char* propName, int errCode, char** attr_val) { + int attribute_id = 0, ifail = ITK_ok; + ITKCALL(ifail = BOM_line_look_up_attribute(propName, &attribute_id)); + if (attribute_id == 0) { + WriteLog(debug, "BOMԲڣ%s", propName); + EMH_store_error_s2(EMH_severity_error, errCode, "BOMԲ", propName); + return errCode; + } + else { + ITKCALL(ifail = BOM_line_ask_attribute_string(line, attribute_id, &*attr_val)); + return ifail; + } + return ITK_ok; +} + +int GetStringProp(tag_t obj, char* propName, char** attr_val) { + return AOM_ask_value_string(obj, propName, &*attr_val); +} + +bool isRev(char* object_type) { + if (((strstr(object_type, "Revision") != NULL) || (strstr(object_type, "revision") != NULL)) + && (strstr(object_type, "Master") == NULL) && (strstr(object_type, "master") == NULL) + && (strstr(object_type, "BOM") == NULL) && (strstr(object_type, "bom") == NULL) && (strstr(object_type, "Bom") == NULL)) { + return true; + } + return false; +} + +int GetBomView(tag_t rev_tag, char* viewtype, tag_t *bomView, tag_t *bomBVR, bool debug) +{ + WriteLog(debug, "ʼȡBOMͼ%s", viewtype); + int ifail = ITK_ok, bvr_count = 0; + tag_t *bvr_list = NULL, bom_view = NULLTAG, view_type = NULLTAG; + *bomBVR = NULLTAG; + *bomView = NULLTAG; + ITKCALL(ITEM_rev_list_bom_view_revs(rev_tag, &bvr_count, &bvr_list)); + if (bvr_count > 0) + { + for (int i = 0; i < bvr_count; i++) + { + ITKCALL(PS_ask_bom_view_of_bvr(bvr_list[i], &bom_view)); + + ITKCALL(PS_ask_bom_view_type(bom_view, &view_type)); + //ITKCALL( PS_find_view_type(bom_view, &view_type)); + char *view_type_name = NULL; + ITKCALL(PS_ask_view_type_name(view_type, &view_type_name)); + WriteLog(debug, "ҵͼ ͣ%s", view_type_name); + if (tc_strcmp(view_type_name, viewtype) == 0) + { + *bomBVR = bvr_list[i]; + *bomView = bom_view; + } + DOFREE(view_type_name); + } + } + //else { + // WriteLog(debug, "ûҵbvrʼд"); + // tag_t bv = NULLTAG, bvr = NULLTAG, item_tag = NULLTAG; + // int bvCnt = 0; + // tag_t* bvTags = NULL; + + + // ITKCALL(ifail = ITEM_ask_item_of_rev(rev_tag, &item_tag)); + + + // tag_t tWindow = NULLTAG; + // ITKCALL(BOM_create_window(&tWindow)); + + // tag_t tTopLine = NULLTAG; + // ITKCALL(BOM_set_window_top_line(tWindow, item_tag, NULLTAG, NULLTAG, &tTopLine)); + + // //ԭBOMͼ + // ITKCALL(ifail=ITEM_list_bom_views(item_tag, &bvCnt, &bvTags)); + // if (bvCnt > 0) { + // WriteLog(debug, "ѴBOMͼ%d", bvCnt); + // bv = bvTags[0]; + // } + // ITKCALL(AOM_lock(item_tag)); + // if (bv == NULLTAG) { + // ITKCALL(ifail=PS_create_bom_view(NULLTAG, "", "", item_tag, &bv)); + // if (ifail != ITK_ok) { + // ITKCALL(AOM_unlock(item_tag)); + // return ifail; + // } + // ITKCALL(AOM_save(bv)); + // } + // ITKCALL(ifail=PS_create_bvr(bv, "", "", false, rev_tag, &bvr)); + // if (ifail != ITK_ok) { + // ITKCALL(AOM_unlock(item_tag)); + // return ifail; + // } + // ITKCALL(AOM_save(bvr)); + // ITKCALL(AOM_save(bv)); + // ITKCALL(AOM_save(item_tag)); + + // tag_t tChildLine = NULLTAG; + + // ITKCALL(BOM_save_window(tWindow)); + // ITKCALL(BOM_close_window(tWindow)); + + // ITKCALL(AOM_unlock(item_tag)); + // *bomBVR = bvr; + // *bomView = bv; + // WriteLog(debug, "bvr½"); + // DOFREE(bvTags); + + //} + DOFREE(bvr_list); + return ifail; +} + +bool propExist(bool debug, tag_t obj, const char *propName) { + tag_t clTag = NULLTAG, *superClass = NULL; + char *clName = NULL; + int ifail = ITK_ok, cnt = 0; + logical exists = false; + ITKCALL(ifail = POM_class_of_instance(obj, &clTag)); + if (ifail != ITK_ok) { return false; } + ITKCALL(ifail = POM_name_of_class(clTag, &clName)); + if (ifail != ITK_ok) { return false; } + WriteLog(debug, ">> %s: %s", clName, propName); + ITKCALL(ifail = POM_attr_exists(propName, clName, &exists)); + if (ifail != ITK_ok) { return false; } + DOFREE(clName); + if (exists) { + //WriteLog(debug,"Դ"); + return exists; + } + ITKCALL(ifail = POM_superclasses_of_class(clTag, &cnt, &superClass)); + for (int i = 0; i < cnt; i++) { + ITKCALL(ifail = POM_name_of_class(superClass[i], &clName)); + if (ifail != ITK_ok) { return false; } + WriteLog(debug, ">> %s: %s", clName, propName); + ITKCALL(ifail = POM_attr_exists(propName, clName, &exists)); + DOFREE(clName); + if (exists) { + //WriteLog(debug, "Դ"); + return exists; + } + } + WriteLog(debug, "Բ"); + return exists; +} + +char* U2G(const char* utf8) +{ + int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0); + wchar_t* wstr = new wchar_t[len + 1]; + memset(wstr, 0, len + 1); + MultiByteToWideChar(CP_UTF8, 0, utf8, -1, wstr, len); + len = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL); + char* str = new char[len + 1]; + memset(str, 0, len + 1); + WideCharToMultiByte(CP_ACP, 0, wstr, -1, str, len, NULL, NULL); + if (wstr) delete[] wstr; + return str; +} + + +char* G2U(const char* gb2312) +{ + int len = MultiByteToWideChar(CP_ACP, 0, gb2312, -1, NULL, 0); + wchar_t* wstr = new wchar_t[len + 1]; + memset(wstr, 0, len + 1); + MultiByteToWideChar(CP_ACP, 0, gb2312, -1, wstr, len); + len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); + char* str = new char[len + 1]; + memset(str, 0, len + 1); + WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL); + if (wstr) delete[] wstr; + return str; +} + +int getPrefStrings(const char *preference, TC_preference_search_scope_t scope, vector &pref_vec) +{ + int ifail = ITK_ok, i = 0, j = 0, k = 0, num = 0; + char **values; + TC_preference_search_scope_t old_scope; + //ITKCALL(ifail = PREF_ask_search_scope(&old_scope)); + //ITKCALL(ifail = PREF_set_search_scope(scope)); + //ITKCALL(ifail = PREF_ask_char_values(preference, &num, &values)); + ITKCALL(ifail = PREF_ask_char_values_at_location(preference, scope, &num, &values)); + if (ifail != ITK_ok) { + return ifail; + } + for (i = 0; i < num; i++) + { + pref_vec.push_back(values[i]); + } + DOFREE(values); + //ITKCALL(ifail = PREF_set_search_scope(old_scope)); + return ifail; +} + +int getPrefStrings2(const char *preference, TC_preference_search_scope_t scope, char splitter, vector &pref_vec) +{ + int ifail = ITK_ok, i = 0, j = 0, k = 0, num = 0; + char **values; + TC_preference_search_scope_t old_scope; + //ITKCALL(ifail = PREF_ask_search_scope(&old_scope)); + //ITKCALL(ifail = PREF_set_search_scope(scope)); + //ITKCALL(ifail = PREF_ask_char_values(preference, &num, &values)); + ITKCALL(ifail = PREF_ask_char_values_at_location(preference, scope, &num, &values)); + if (ifail != ITK_ok) { + return ifail; + } + for (i = 0; i < num; i++) + { + vector split; + Split(values[i], splitter, split); + for each (string val in split) + { + pref_vec.push_back(val); + } + } + DOFREE(values); + //ITKCALL(ifail = PREF_set_search_scope(old_scope)); + return ifail; +} + + +//ݼļ +int export_dataset_file_to_dir(bool debug, tag_t dataset, const char *ref_name, const char* temp_path, char *ext, char **filename, char **original_name) +{ + int ifail = ITK_ok; + tag_t ref_object = NULLTAG, + datasettype = NULLTAG, + new_ds = NULLTAG, + tool = NULLTAG, + folder_tag = NULLTAG, + spec_dataset_rev = NULLTAG; + AE_reference_type_t reference_type; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor; + char *target_ds_name = NULL; + char *new_file_name; + WSOM_ask_name2(dataset, &target_ds_name); + WriteLog(debug, "ʼݼ<%s>ļ", target_ds_name); + DOFREE(target_ds_name); + *filename = (char *)MEM_alloc(sizeof(char) * 512); + *original_name = (char *)MEM_alloc(sizeof(char) * 512); + strcpy(*filename, ""); + AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev); + AE_ask_dataset_named_ref2(dataset, ref_name, &reference_type, &ref_object); + if (ref_object == NULLTAG) + { + WriteLog(debug, "ļΪ"); + return 1; + } + if (reference_type == AE_PART_OF) + { + char *pathname2 = NULL; + IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname2); + DOFREE(pathname2); + char *origin_file_name2 = NULL; + IMF_ask_original_file_name2(ref_object, &origin_file_name2); + strcpy(*original_name, origin_file_name2); + DOFREE(origin_file_name2); + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, temp_path); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + WriteLog(debug, "ʱļ·%s", temp_file); + if ((_access(temp_file, 0)) != -1) { + if (!remove(temp_file)) { + remove(temp_file); + } + } + ITKCALL(ifail = IMF_export_file(ref_object, temp_file)); + strcpy(*filename, temp_file); + return ifail; + } + return -1; +} + +bool exists_test0(const std::string& name) { + ifstream f(name.c_str()); + return f.good(); +} + +//ݼļ +int export_dataset_file(tag_t dataset, char *ref_name, char *ext, char **filename, char **original_name) +{ + int ifail = ITK_ok; + tag_t ref_object = NULLTAG, + datasettype = NULLTAG, + new_ds = NULLTAG, + tool = NULLTAG, + folder_tag = NULLTAG, + spec_dataset_rev = NULLTAG; + AE_reference_type_t reference_type; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor; + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name; + + *filename = (char *)MEM_alloc(sizeof(char) * 5120); + *original_name = (char *)MEM_alloc(sizeof(char) * 5120); + strcpy(*filename, ""); + AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev); + AE_ask_dataset_named_ref2(dataset, ref_name, &reference_type, &ref_object); + if (ref_object == NULLTAG) + { + //ECHO("ref_object is NULLTAG\n"); + return 1; + } + //WriteLog("\reference_type=%d\n",reference_type); + if (reference_type == AE_PART_OF) + { + char *pathname = NULL; + IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname); + char *origin_file_name = NULL; + IMF_ask_original_file_name2(ref_object, &origin_file_name); + strcpy(*original_name, origin_file_name); + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + char *temp_dir = getenv("TEMP"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, temp_dir); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + //ECHO("temp_file=%s\n", temp_file); + + IMF_export_file(ref_object, temp_file); + strcpy(*filename, temp_file); + } + return ITK_ok; +} + + +//ݼļ +int export_dataset_file(bool debug, tag_t dataset, const char *ref_name, char* userId, char *ext, char **filename, char **original_name) +{ + int ifail = ITK_ok; + tag_t ref_object = NULLTAG, + datasettype = NULLTAG, + new_ds = NULLTAG, + tool = NULLTAG, + folder_tag = NULLTAG, + spec_dataset_rev = NULLTAG; + AE_reference_type_t reference_type; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor; + char *target_ds_name = NULL; + char *new_file_name; + WSOM_ask_name2(dataset, &target_ds_name); + WriteLog(debug, "ʼݼ<%s>ļ", target_ds_name); + DOFREE(target_ds_name); + *filename = (char *)MEM_alloc(sizeof(char) * 512); + *original_name = (char *)MEM_alloc(sizeof(char) * 512); + strcpy(*filename, ""); + AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev); + AE_ask_dataset_named_ref2(dataset, ref_name, &reference_type, &ref_object); + if (ref_object == NULLTAG) + { + WriteLog(debug, "ļΪ"); + return 1; + } + if (reference_type == AE_PART_OF) + { + char *pathname2 = NULL; + IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname2); + DOFREE(pathname2); + char *origin_file_name2 = NULL; + IMF_ask_original_file_name2(ref_object, &origin_file_name2); + strcpy(*original_name, origin_file_name2); + DOFREE(origin_file_name2); + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + char *temp_dir = getenv("TEMP"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, temp_dir); + strcat(temp_file, "\\tc_"); + strcat(temp_file, userId); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + WriteLog(debug, "ʱļ·%s", temp_file); + + if ((_access(temp_file, 0)) != -1) { + if (!remove(temp_file)) { + remove(temp_file); + } + } + IMF_export_file(ref_object, temp_file); + strcpy(*filename, temp_file); + return ITK_ok; + } + return -1; +} + +//õļе +char* getfileall(const char* fname) +{ + FILE* fp; + char* str; + char txt[1000]; + int filesize; + //һļ + if ((fp = fopen(fname, "r")) == NULL) { + printf("ļ%s\n", fname); + return NULL; + } + //ļָƵĩβ + fseek(fp, 0, SEEK_END); + filesize = ftell(fp);//ͨftellָ뵽ļͷƫֽ + + str = (char*)malloc(filesize);//̬strڴ +// str=malloc(filesize);//̬strڴ + str[0] = 0;//ַÿ +// memset(str,filesize*sizeof(char),0);//,ַÿյڶ÷ + rewind(fp); + + while ((fgets(txt, 1000, fp)) != NULL) {//ѭȡ1000ֽ,û˳ѭ + strcat(str, txt);//ƴַ + } + fclose(fp); + return str; +} \ No newline at end of file diff --git a/connor_signature/kutil.h b/connor_signature/kutil.h new file mode 100644 index 0000000..83ddafb --- /dev/null +++ b/connor_signature/kutil.h @@ -0,0 +1,130 @@ +//#include +//#include +//ws2_32.libhttp +#pragma comment(lib,"ws2_32.lib") +#include "autolink.h" +#include "config.h" +#include "features.h" +#include "forwards.h" +#include "json.h" +#include "reader.h" +#include "value.h" +#include "writer.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#include +#else +#include +#endif + +#define DOFREE(obj) \ +{ \ + if(obj) \ + { \ + MEM_free(obj); \ + obj = NULL; \ + } \ +} + +extern "C" int POM_AM__set_application_bypass(logical bypass); + +using namespace std; + +bool copyFile(const char *SRC, const char* DEST); + +void initUserDir(char *userId); +int export_dataset_file_to_dir(bool debug,tag_t dataset, const char *ref_name,const char* temp_path, char *ext, char **filename, char **original_name); +void CreateLogFile(char* FunctionName, char *userId, char **fullname); +int CreateTempFile(logical debug,const char* temp_path, char *file_name, char* ext, char **fullname,FILE **file); +int CreateTempFile(logical debug,const char* temp_path, char *file_name, char* user_id, char* ext, char **fullname,FILE **file); +void CloseLog(void); +void WriteLog2(logical debug, const char* format, ...); +void WriteLog(logical debug, const char* format, ...); +void set_bypass(logical bypass); +char* G2U(const char* gb2312); +char* U2G(const char* utf8); +int getPrefStrings(const char *preference, TC_preference_search_scope_t scope, vector &pref_vec); +int export_dataset_file(bool debug, tag_t dataset,const char *ref_name,char *userId, char *ext, char **filename, char **original_name); +int GetBomView(tag_t rev_tag, char* viewtype, tag_t *bomView, tag_t *bomBVR, bool debug); +int GetBomLinePropString(bool debug, tag_t line, char* propName, int errCode, char** attr_val); +void Split(string strArg, char spliter, vector &ans); +void Split(string strArg, string spliter, vector &ans); +int getPrefStrings2(const char *preference, TC_preference_search_scope_t scope, char splitter, vector &pref_vec); +int import_dataset_file(tag_t dataset, const char *ref_name, char *ext, char *fullfilename, char *original_name); +int import_dataset_file_binary(tag_t dataset, const char* temp_path, const char *ref_name, char *ext, char *fullfilename, char *original_name); +int readError(bool debug, char *errFilePath, int errCode); +void deleteFile(bool debug, char *path); +bool CheckType(string config, char* type, char spliter); +bool propExist(bool debug, tag_t obj, const char *propName); +bool isRev(char* object_type); +int GetProcessTargets(bool debug, int att_cnt, tag_t *attachments, vector &targets,char* formType,char splitter); +bool inArray(vector types, string type); +int getIndexInArray(vector types, string type); +int findUser(bool debug,string userStr,tag_t *user_tag); +bool isType(tag_t item,char* type); +int CreateUserFile(logical debug,char* FunctionName, char *userId, char **fullname,FILE **file); +int WriteToFile(logical debug,FILE* file, const char* format, ...); +bool isTypeOf(tag_t objtag, const char * type_name); +int connor_set_prop_value(char* propname, const char* propvalue, tag_t &tag_instance); +int getLast2Year(char* &year); +void getCurrentTime(date_t * now); +bool find_prop(int prop_cnt, char** props, const char* prop); +string readFileIntoString(char * filename); +map jsonstr2map(const string& json); +bool exists_test0(const std::string& name); +int export_dataset_file(tag_t dataset, char *ref_name, char *ext, char **filename, char **original_name); +bool is_str_utf8(const char* str); +int write_string_to_file_append(const std::string & file_string, const std::string str); +char* getfileall(const char* fname); +//BOOL GetIpByDomainName(char *szHost, char* szIp); +//void sendGetRequest(); \ No newline at end of file diff --git a/connor_signature/ocilib.cpp b/connor_signature/ocilib.cpp new file mode 100644 index 0000000..ab9eaee --- /dev/null +++ b/connor_signature/ocilib.cpp @@ -0,0 +1,441 @@ +/*===================================================================================================================== + Copyright(c) 2012 ORIGIN. + Unpublished - All rights reserved +======================================================================================================================= +File description: + + Filename: ocilib.cxx + Module : OCI + + This file describes OCI library Package. + +======================================================================================================================= +Date Name Description of Change +1-Feb-2015 Ray li Initialize creation +$HISTORY$ +=====================================================================================================================*/ +#include "ocilib.h" +#include + +#define NUM 100 +#define USERNAME "MES" +#define PASSWORD "infodba" +#define DBNAME "TCPORD" + + +// ṹ +typedef struct { + OCIEnv* p_env; //OCI environment handle + OCIError* p_err; //OCI error handle + OCISvcCtx* p_svc; //OCI service context handel ľ + OCIServer* p_ser; //OCI server handle + OCISession* p_usr; //OCI user session handle ûỰ + OCIStmt* p_sql; //OCI statement handle + OCIDefine* p_dfn; //OCI define handle + OCIBind* p_bnd; //OCI bind handle 󶨾 +}OCIHandleInfo; + + +// ṹ +typedef struct { + OCIEnv* p_env; + OCIError* p_err; + OCISvcCtx* p_svc; + OCIStmt* p_sql; + OCIDefine* p_dfn; + OCIBind* p_bnd; +}OCIDATA; + + +// ִʱ +typedef struct { + char value[NUM][NUM]; + char type[NUM][NUM]; +}SqlField; + + +// ѯʱ, +typedef struct { + int naIntValue[NUM]; + int nIntNum; + char caCharValue[500][500]; + int nCharNum; +}SqlSelField; + +OCIHandleInfo* ociHandle = NULL; +OCIHandleInfo ociHand; + +int InitHandle(); +int _ExeSQL(char* SQL, char** inputValue, int inputValueCount); +int _QuerySQL(char* SQL, SqlSelField* pOutField, SqlSelField* pSelField); +int GetDataFromQuery(int* pRc, SqlSelField* pOutField); +void QuitFreeHandle(); + + + + +/**************************************************************************************************************************************** +ƣ +ܣ +ڲ +ڲ + ע +*****************************************************************************************************************************************/ + + +// ʼHandler +int InitHandle() +{ + int swResult; + + ociHandle = &ociHand; + + + /*create OCI environment*/ + if (swResult = OCIEnvCreate(&ociHandle->p_env, OCI_DEFAULT, NULL, NULL, NULL, NULL, 0, NULL)) // + { + printf("environment create error!\n\n"); + return -1; + } + else + { + printf("environment create success!\n\n"); + //return 0; + } + + /*init handle*/ + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_ser, OCI_HTYPE_SERVER, 0, NULL)) // + { + printf("init server handle error!\n\n"); + return -1; + } + + + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_err, OCI_HTYPE_ERROR, 0, NULL)) // + { + printf("init error handle error!\n\n"); + return -1; + } + + + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_usr, OCI_HTYPE_SESSION, 0, NULL)) // + { + printf("init session handle error!\n\n"); + return -1; + } + + + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_svc, OCI_HTYPE_SVCCTX, 0, NULL)) //ľ + { + printf("init service context handle error!\n\n"); + return -1; + } + + + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_sql, OCI_HTYPE_STMT, 0, NULL)) //SQL + { + printf("init statement handle error!\n\n"); + return -1; + } + + printf("init handle success!\n\n"); + + return 0; +} + + + +// ݿ +int ConnServer(char* username, char* password, char* dbname) +{ + int swResult; + char errbuf[100] = { 0 }; + int errcode; + + if (InitHandle() == -1)//ʼ + return -1; + + if (swResult = OCILogon(ociHandle->p_env, ociHandle->p_err, &ociHandle->p_svc, (text*)username, strlen(username), (text*)password, strlen(password), (text*)dbname, strlen(dbname))) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("Error - %.*s/n", 512, errbuf); + return -1; + } + else + printf("ݿӳɹ!\n\n"); + return 0; +} + + + +// SQLij(ִSQL) +int _ExeSQL(char* SQL, char** inputValue, int inputValueCount) +{ + int swResult, i; + int errcode; + + //ð󶨱 + OCIBind* p_bndp[100]; + + //׼SQL + if (swResult = OCIStmtPrepare(ociHandle->p_sql, ociHandle->p_err, (text*)SQL, strlen(SQL), OCI_NTV_SYNTAX, OCI_DEFAULT)) + { + printf("prepare SQL statements error!\n\n"); + } + else + { + printf("prepare SQL statements success!\n\n"); + } + + + // + for (i = 0; i < inputValueCount; i++) + { + char errbuf[100] = { 0 }; + if (swResult = OCIBindByPos(ociHandle->p_sql, &p_bndp[i], ociHandle->p_err, i + 1, (dvoid*)inputValue[i], (sb4)strlen(inputValue[i]) + 1, SQLT_STR, (dvoid*)0, (ub2*)0, (ub2*)0, (ub4)0, (ub4*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("Bind Error - %.*s/n", 512, errbuf); + return -1; + } + } + + //ִSQL statements + if (swResult = OCIStmtExecute(ociHandle->p_svc, ociHandle->p_sql, ociHandle->p_err, 1, 0, NULL, NULL, OCI_DEFAULT)) + { + char errbuf[100] = { 0 }; + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("execute SQL statement Error - %.*s\n", 512, errbuf); + return -1; + } + else + { + printf("execute SQL statement success!\n\n"); + } + return 0; +} + + + + +// ѯSQL +int _QuerySQL(char* SQL, SqlSelField* pOutField, SqlSelField* pSelField) +{ + sword status; + int rc = 0, ret = 0; + char errbuf[100] = { 0 }; + int maxNum = 2048; + char chTag[8]; + int iIndex = 0; + int outputColumn = 0; + int errcode = 0; + char nullValue = '\0'; // + sb2 sb2aInd[30] = { '\0' }; + + // ׼SQL + status = OCIStmtPrepare(ociHandle->p_sql, ociHandle->p_err, (text*)SQL, (ub4)strlen(SQL), (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT); + + if (status != OCI_SUCCESS) + { + printf("SQL Preparing failed/n"); + return -1; + } + + + // int͵, SQLʱ :1,:2, + for (iIndex = 0; iIndex < pSelField->nIntNum; iIndex++) + { + memset(chTag, 0, 8); + sprintf(chTag, ":%d", iIndex + 1); + if (rc = OCIBindByName(ociHandle->p_sql, (OCIBind**)&ociHandle->p_dfn, ociHandle->p_err, (text*)chTag, (sb4)strlen((char*)chTag), (dvoid*)&pSelField->naIntValue[iIndex], sizeof(int), SQLT_INT, (dvoid*)0, (ub2*)0, (ub2*)0, (ub4)0, (ub4*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + } + + // char *͵, SQLʱ :3,:4, + for (iIndex = 0; iIndex < pSelField->nCharNum; iIndex++) + { + int n = 0; + memset(chTag, 0, 8); + n = pSelField->nIntNum + iIndex + 1; + sprintf(chTag, ":%d", n); + if (rc = OCIBindByName(ociHandle->p_sql, (OCIBind**)&ociHandle->p_dfn, ociHandle->p_err, (text*)chTag, (sb4)strlen((char*)chTag), (dvoid*)&pSelField->caCharValue[iIndex], NUM, SQLT_STR, (dvoid*)0, (ub2*)0, (ub2*)0, (ub4)0, (ub4*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + } + + + // ִSQL + if (rc = OCIStmtExecute(ociHandle->p_svc, ociHandle->p_sql, ociHandle->p_err, (ub4)0, (ub4)0, (CONST OCISnapshot*) NULL, (OCISnapshot*)NULL, OCI_STMT_SCROLLABLE_READONLY)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("execute SQL Error - %.*s\n", 512, errbuf); + return -1; + } + else + { + printf("execute SQL success!\n\n"); + } + + + if (ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)&outputColumn, (ub4*)0, (ub4)OCI_ATTR_PARAM_COUNT, ociHandle->p_err)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("Get OCIAttr Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + + + // int͵, SQLʱ :1,:2, + for (iIndex = 0; iIndex < pOutField->nIntNum; iIndex++) + { + if (rc = OCIDefineByPos(ociHandle->p_sql, &ociHandle->p_dfn, ociHandle->p_err, iIndex + 1, (dvoid*)&pOutField->naIntValue[iIndex], sizeof(int), SQLT_INT, (dvoid*)0, (ub2*)0, (ub2*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + } + + + // char *͵, SQLʱ :1,:2, + for (iIndex = 0; iIndex < outputColumn; iIndex++) + { + int n = iIndex + 1; + if (rc = OCIDefineByPos(ociHandle->p_sql, &ociHandle->p_dfn, ociHandle->p_err, n, (dvoid*)&pOutField->caCharValue[iIndex], 1000 * sizeof(char), SQLT_STR, (dvoid*)0, (ub2*)0, (ub2*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + } + + return 0; + +} + + + +// ͷHandler +void QuitFreeHandle() +{ + // ˳ + OCILogoff(ociHandle->p_svc, ociHandle->p_err); + printf("Quit success!\n"); + + // ͷž + OCIHandleFree(ociHandle->p_ser, OCI_HTYPE_SERVER); //ͷŷ + OCIHandleFree(ociHandle->p_err, OCI_HTYPE_ERROR); //ͷŴ + OCIHandleFree(ociHandle->p_usr, OCI_HTYPE_SESSION); //ͷ + OCIHandleFree(ociHandle->p_svc, OCI_HTYPE_SVCCTX); //ͷľ + OCIHandleFree(ociHandle->p_sql, OCI_HTYPE_STMT); //ͷSQL +} + + +// ִ +int ExecuteSQL(char* SQL, int valueCount, char** value) +{ + int i = 0; + + if (i = _ExeSQL(SQL, value, valueCount)) + { + printf("1\n"); + QuitFreeHandle(); + return -1; + } + printf("2\n"); + return 0; +} + + +// IJѯ +int QuerySQL(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue) +{ + int i = 0, j = 0, ret = 0; + + int times = 0, temp = 0; + + SqlSelField infield; + SqlSelField outField; + + // ʼṹ + infield.nCharNum = inputValueCount; + infield.nIntNum = 0; + outField.nCharNum = 0; + outField.nIntNum = 0; + + *outputColumn = 0; + *outputValueCount = 0; + + for (i = 0; i < inputValueCount; i++) + { + strcpy(infield.caCharValue[i], inputValue[i]); + } + + // ִвѯ + + + if (ret = _QuerySQL(SQL, &outField, &infield)) + { + printf("SQLѯʧ!\n"); + QuitFreeHandle(); + return -1; + } + + // ȡ + ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)outputColumn, (ub4*)0, (ub4)OCI_ATTR_PARAM_COUNT, ociHandle->p_err); + + // ȡһ,ȥ + ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_LAST, 0, OCI_DEFAULT); + // ȡ + ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)outputValueCount, (ub4*)0, (ub4)OCI_ATTR_ROW_COUNT, ociHandle->p_err); + + if (*outputValueCount == 0) + return 0; + + + // ʼڴ沢Ҵ洢 + ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT); + *outputValue = (char***)calloc((*outputValueCount) + 1, sizeof(char**)); + do + { + (*outputValue)[i] = (char**)calloc((*outputColumn) + 1, sizeof(char*)); + for (j = 0; j < (*outputColumn); j++) + { + (*outputValue)[i][j] = (char*)calloc(1000, sizeof(char)); + strcpy((*outputValue)[i][j], outField.caCharValue[j]); + //printf("outValue[%d][%d] = %s , ַ=%d, ַָ= %d\n ",i,j,(*outputValue)[i][j],&(*outputValue)[i][j],(*outputValue)[i][j]); + } + i++; + } while ((ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_NEXT, 1, OCI_DEFAULT) != OCI_NO_DATA)); + + return 0; +} + + +// IJѯ +int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue) +{ + return QuerySQL(SQL, 0, NULL, outputColumn, outputValueCount, outputValue); +} + +// ޲ +int ExecuteSQLNoInputParam(char* SQL) +{ + printf("ʼ\n"); + return ExecuteSQL(SQL, 0, NULL); +} + +// Ͽ +void DisConnServer() +{ + if (ociHandle != NULL) + QuitFreeHandle(); +} + diff --git a/connor_signature/ocilib.h b/connor_signature/ocilib.h new file mode 100644 index 0000000..ef73d1a --- /dev/null +++ b/connor_signature/ocilib.h @@ -0,0 +1,99 @@ +#pragma once +/*===================================================================================================================== + Copyright(c) 2012 ORIGIN. + Unpublished - All rights reserved +======================================================================================================================= +File description: + + Filename: ocilib.h + Module : OCI + + This Header file of OCI library Package. + +======================================================================================================================= +Date Name Description of Change +1-Feb-2015 Ray Initialize creation +$HISTORY$ +=====================================================================================================================*/ +#include +#include +#include +#include +#include +//#include + +#define OCI_FAIL 1 +#define OCI_OK 0 + +#ifdef __cplusplus +extern "C" +{ +#endif + /** + * ݿ. + * @param username - û + * @param password - + * @param dbname - ݿSID + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int ConnServer(char* username, char* password, char* dbname); + + + /** + * ִSQL. + * @param SQL - SQL + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int ExecuteSQLNoInputParam(char* SQL); + + /** + * ִSQL. + * @param SQL - SQL + * @param inputValueCount - + * @param inputValue - ֵ + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int ExecuteSQL(char* SQL, int inputValueCount, char** inputValue); + + /** + * IJѯSQL. + * @param SQL - SQL + * @param outputColumn - е + * @param outputValueCount - е + * @param outputValue - + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue); + + /** + * IJѯSQL. + * @param SQL - SQL + * @param inputValueCount - + * @param inputValue - ֵ + * @param outputColumn - е + * @param outputValueCount - е + * @param outputValue - + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int QuerySQL(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue); + + /** + * Ͽݿ. + * + * ORACLE ݿװ + */ + extern void DisConnServer(); + +#ifdef __cplusplus +} +#endif diff --git a/connor_signature/raycus_itk.cpp b/connor_signature/raycus_itk.cpp new file mode 100644 index 0000000..5a7b3f3 --- /dev/null +++ b/connor_signature/raycus_itk.cpp @@ -0,0 +1,412 @@ +#include "raycus_itk.h" +#include "handler.h" + +#ifdef __cplusplus + +/* +׼עṩ̵÷handler +*/ + +extern "C" { +#endif + //˺й淶дdllƼ"_"ͷ + DLLAPI int ld_itk_c_register_callbacks() + { + int ifail = ITK_ok; + ITKCALL(ifail = CUSTOM_register_exit("ld_itk_c", "USERSERVICE_register_methods", + (CUSTOM_EXIT_ftn_t)K_register_methods)); + fprintf(stdout, "ld_itk_c register USERSERVICE_custom_register_methods complete\n"); + + + + ITKCALL(ifail = CUSTOM_register_exit("ld_itk_c", "USER_gs_shell_init_module", + (CUSTOM_EXIT_ftn_t)K_register_handlers)); + fprintf(stdout, "ld_itk_c register USERSERVICE_custom_register_handlers complete\n"); + return ifail; + } +#ifdef __cplusplus +} +#endif + +extern DLLAPI int K_register_handlers(int *decision, va_list args) +{ + int ifail = ITK_ok; + + //ָ + ifail = EPM_register_action_handler("LD_AutoAssign", "LD_AutoAssign", + (EPM_action_handler_t)LD_AutoAssign); + if (ifail == ITK_ok) + { + fprintf(stdout, "Registering action handler LD_AutoAssign completed!\n"); + } + else + { + fprintf(stdout, "Registering action handler LD_AutoAssign failed %d!\n", ifail); + } + + //̲˾ + ifail = EPM_register_action_handler("LD_ElevateTask", "LD_ElevateTask", + (EPM_action_handler_t)LD_ElevateTask); + if (ifail == ITK_ok) + { + fprintf(stdout, "Registering action handler LD_ElevateTask completed!\n"); + } + else + { + fprintf(stdout, "Registering action handler LD_ElevateTask failed %d!\n", ifail); + } + + //Connor_Review_Person + ITKCALL(ifail = EPM_register_action_handler("Connor_Review_Person", "", (EPM_action_handler_t)Connor_Review_Person)); + if (ifail == 0) { + printf("עɹConnor_Review_Person\n"); + } + else { + printf("עʧ[%d]Connor_Review_Person\n", ifail); + } + + //Connor_allow_Workflow + ITKCALL(ifail = EPM_register_action_handler("Connor_allow_Workflow", "", (EPM_action_handler_t)Connor_allow_Workflow)); + if (ifail == 0) { + printf("עɹConnor_allow_Workflow\n"); + } + else { + printf("עʧ[%d]Connor_allow_Workflow\n", ifail); + } + + //LD_FormAttrToExcel + ifail = EPM_register_action_handler("LD_FormAttrToExcel", "", (EPM_action_handler_t)LD_FormAttrToExcel); + if (ifail == 0) { + printf("עɹLD_FormAttrToExcel\n"); + } + else { + printf("עʧ[%d]LD_FormAttrToExcel\n", ifail); + } + + //LD_ECN01_SetCICNFormProperty + ifail = EPM_register_action_handler("LD_ECN01_SetCICNFormProperty", "", (EPM_action_handler_t)LD_ECN01_SetCICNFormProperty); + if (ifail == 0) { + printf("עɹLD_ECN01_SetCICNFormProperty\n"); + } + else { + printf("עʧ[%d]LD_ECN01_SetCICNFormProperty\n", ifail); + } + //LD_515_SetCICNFormProperty + ifail = EPM_register_action_handler("LD_515_SetCICNFormProperty", "", (EPM_action_handler_t)LD_515_SetCICNFormProperty); + if (ifail == 0) { + printf("עɹLD_515_SetCICNFormProperty\n"); + } + else { + printf("עʧ[%d]LD_515_SetCICNFormProperty\n", ifail); + } + //LD_PartCompFLAG + ifail = EPM_register_action_handler("LD_PartCompFLAG", "", (EPM_action_handler_t)LD_PartCompFLAG); + if (ifail == 0) { + printf("עɹLD_PartCompFLAG\n"); + } + else { + printf("עʧ[%d]LD_PartCompFLAG\n", ifail); + } + + //LD_SendDJJDD_To_MES + ifail = EPM_register_action_handler("LD_SendDJJDD_To_MES", "", (EPM_action_handler_t)LD_SendDJJDD_To_MES); + if (ifail == 0) { + printf("עɹLD_SendDJJDD_To_MES\n"); + } + else { + printf("עʧ[%d]LD_SendDJJDD_To_MES\n", ifail); + } + + //UpgradeTask + ifail = EPM_register_action_handler("UpgradeTask", "", (EPM_action_handler_t)UpgradeTask); + if (ifail == 0) { + printf("עɹUpgradeTask\n"); + } + else { + printf("עʧ[%d]UpgradeTask\n", ifail); + } + + + //LD_PartChange + ifail = EPM_register_action_handler("LD_PartChange", "", (EPM_action_handler_t)LD_PartChange); + if (ifail == 0) { + printf("עɹLD_PartChange\n"); + } + else { + printf("עʧ[%d]LD_PartChange\n", ifail); + } + + + + //LD_SendECRECN_ToSAPMES + ifail = EPM_register_action_handler("LD_SendECRECN_ToSAPMES", "", (EPM_action_handler_t)LD_SendECRECN_ToSAPMES); + if (ifail == 0) { + printf("עɹLD_SendECRECN_ToSAPMES\n"); + } + else { + printf("עʧ[%d]LD_SendECRECN_ToSAPMES\n", ifail); + } + + //LD_GYLXFrozen + ifail = EPM_register_action_handler("LD_GYLXFrozen", "", (EPM_action_handler_t)LD_GYLXFrozen); + if (ifail == 0) { + printf("עɹLD_GYLXFrozen\n"); + } + else { + printf("עʧ[%d]LD_GYLXFrozen\n", ifail); + } + + //дʱ + + ifail = EPM_register_action_handler("LD_CompletionDate", "", (EPM_action_handler_t)LD_CompletionDate); + if (ifail == 0) { + printf("עɹLD_CompletionDate\n"); + } + else { + printf("עʧ[%d]LD_CompletionDate\n", ifail); + } + + + //дʱ + ifail = EPM_register_action_handler("LD_TaskAssignmentDate", "", (EPM_action_handler_t)LD_TaskAssignmentDate); + if (ifail == 0) { + printf("עɹLD_TaskAssignmentDate\n"); + } + else { + printf("עʧ[%d]LD_TaskAssignmentDate\n", ifail); + } + //(ifail = EPM_register_action_handler("Supor_signoff_rev", "ǩϢ¼", (EPM_action_handler_t)Connor_signoff_rev)); + //if (ifail == 0) + //{ + // printf("Registering action handler Supor_signoff_rev success\n"); + //} + //else + //{ + // printf("Registering action handler Supor_signoff_rev failed\n"); + //} + + + + //handler + ITKCALL(ifail = EPM_register_action_handler("TEST", "TEST", (EPM_action_handler_t)TEST)); + if (ifail == ITK_ok) + { + printf("register TEST success \n"); + } + else + { + printf("register TEST failed \n"); + } + + //Զʼ + (ifail = EPM_register_action_handler("SH_PLM_Email", "SH_PLM_Email", (EPM_action_handler_t)SH_PLM_Email)); + if (ifail == 0) { + printf("Registering action handler SH_PLM_Email successful\n"); + } + else { + printf("Registering action handler SH_PLM_Email failed %d\n", ifail); + } + + // + METHOD_id_t mth_tag; + ifail = METHOD_find_method("ItemRevision", ITEM_deep_copy_msg, &mth_tag);//1֧ͣԭͿƻģ2 + if (mth_tag.id != 0) { + ifail = METHOD_add_action(mth_tag, METHOD_post_action_type, reviseDesignPost, NULL);//2ִвʱ̣֧ǰͺ + fprintf(stdout, "regist reviseDesignPost post_action successfully \n"); + } + else { + fprintf(stdout, "regist reviseDesignPost post_action failed \n"); + } + + + return ifail; +} + +int Connor_open_bypass(void* returnValue) +{ + POM_AM__set_application_bypass(true); + return 0; +} + +int Connor_close_bypass(void* returnValue) +{ + POM_AM__set_application_bypass(false); + return 0; +} + +extern DLLAPI int K_register_methods() +{ + int ifail = ITK_ok; + METHOD_id_t mth_tag; + int + status = ITK_ok, + numberOfArguments = 0, + returnValueType = USERARG_STRING_TYPE, + *argumentList = NULL; + USER_function_t functionPtr; + + //޶ + //{ + // ifail = METHOD_find_method("ItemRevision", ITEM_deep_copy_msg, &mth_tag); + // if (mth_tag.id != 0) { + // METHOD_add_action(mth_tag, METHOD_pre_action_type, ML_ItemRevPreUpdate, NULL); + // printf("עItemRevisionɹ\n"); + // } + //} + + //ifail = METHOD_find_method("ItemRevision", "ITEM_deep_copy", &mth_tag); + //if (mth_tag.id != 0) { + // ifail = METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)CONNOR_REVISE_CLEAR_FORM, NULL); + // if (ifail == 0) { + // printf("Registering method CONNOR_REVISE_CLEAR_FORM successful\n"); + // } + // else { + // printf("Registering method CONNOR_REVISE_CLEAR_FORM failed %d\n", ifail); + // } + //} + + //· + { + numberOfArguments = 1; + functionPtr = Connor_open_bypass; + argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_STRING_TYPE; + returnValueType = USERARG_VOID_TYPE; + char* mth_name = (char*)malloc(1 + sizeof(char) * strlen("CONNOR_open_bypass")); + tc_strcpy(mth_name, "CONNOR_open_bypass"); + ITKCALL(status = USERSERVICE_register_method(mth_name, functionPtr, numberOfArguments, + argumentList, returnValueType)); + MEM_free(argumentList); + if (status == ITK_ok) + { + printf("Method: %s\n", mth_name); + } + else + { + printf("Method register failed [%d]: %s\n", status, mth_name); + } + } + { + ifail = METHOD_find_method("ItemRevision", TC_save_msg, &mth_tag); + if (mth_tag.id != 0) { + METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)ML_ItemRevSave, NULL); + printf("עItemRevisionɹ\n"); + } + } + + ////ļк + //{ + // ifail = METHOD_find_method("Folder", TC_save_msg, &mth_tag); + // if (mth_tag.id != 0) { + // METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)LD6_CusProdFolderSave, NULL); + // printf("עLD6_CusProdFolderSaveɹ\n"); + // } + //} + + + //· + { + numberOfArguments = 1; + functionPtr = Connor_close_bypass; + argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_STRING_TYPE; + returnValueType = USERARG_VOID_TYPE; + char* mth_name = (char*)malloc(1 + sizeof(char) * strlen("CONNOR_close_bypass")); + tc_strcpy(mth_name, "CONNOR_close_bypass"); + ITKCALL(status = USERSERVICE_register_method(mth_name, functionPtr, numberOfArguments, + argumentList, returnValueType)); + MEM_free(argumentList); + if (status == ITK_ok) + { + printf("Method: %s\n", mth_name); + } + else + { + printf("Method register failed [%d]: %s\n", status, mth_name); + } + } + + //ֻԵֵ + { + numberOfArguments = 3; + functionPtr = connor_set_prop_value; + argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_STRING_TYPE; + argumentList[1] = USERARG_STRING_TYPE; + argumentList[2] = USERARG_TAG_TYPE; + returnValueType = USERARG_STRING_TYPE; + char* mth_name = (char*)malloc(1 + sizeof(char) * strlen("Connor_Set_Prop_Value")); + tc_strcpy(mth_name, "Connor_Set_Prop_Value"); + ITKCALL(status = USERSERVICE_register_method(mth_name, functionPtr, numberOfArguments, + argumentList, returnValueType)); + MEM_free(argumentList); + if (status == ITK_ok) + { + printf("Method: %s\n", mth_name); + } + else + { + printf("Method register failed [%d]: %s\n", status, mth_name); + } + } + + { + numberOfArguments = 3; + returnValueType = USERARG_STRING_TYPE; + functionPtr = uploadFile; + argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_STRING_TYPE; + argumentList[1] = USERARG_STRING_TYPE; + argumentList[2] = USERARG_STRING_TYPE; + status = USERSERVICE_register_method("uploadFile", functionPtr, numberOfArguments, argumentList, returnValueType); + if (status == ITK_ok) + { + printf("Registering uploadFile finished\n"); + } + else + { + printf("Registering uploadFile failed %d\n", status); + } + MEM_free(argumentList); + } + + /*int + status = ITK_ok, + numberOfArguments = 0, + returnValueType = USERARG_STRING_TYPE, + *argumentList = NULL; + USER_function_t functionPtr; + + + METHOD_id_t mth_tag; + + ITKCALL(ifail = METHOD_find_method ( "Schedule", TC_save_msg, &mth_tag ) ); + if ( mth_tag.id != NULLTAG ) + { + ITKCALL(ifail = METHOD_add_action( mth_tag, METHOD_post_action_type, (METHOD_function_t)Save_Schedule_Post_Action, NULL ) ); + if(ifail==0) { + printf("Register method Save_Schedule_Post_Action success\n"); + } else { + printf("Register method Save_Schedule_Post_Action failed %d\n", ifail); + } + }*/ + + return ITK_ok; + } + +//extern DLLAPI int F_register_handlers(int *decision, va_list args) +// { +// int ifail = ITK_ok; +// +// // +// METHOD_id_t mth_tag; +// ifail = METHOD_find_method("Design Revision", ITEM_deep_copy_msg, &mth_tag);//1֧ͣԭͿƻģ2 +// if (mth_tag.id != 0) { +// ifail = METHOD_add_action(mth_tag, METHOD_post_action_type, reviseDesignPost, NULL);//2ִвʱ̣֧ǰͺ +// fprintf(stdout, "regist reviseDesignPost post_action successfully \n"); +// } +// else { +// fprintf(stdout, "regist reviseDesignPost post_action failed \n"); +// } +// return ifail; +// } diff --git a/connor_signature/raycus_itk.h b/connor_signature/raycus_itk.h new file mode 100644 index 0000000..a1e9928 --- /dev/null +++ b/connor_signature/raycus_itk.h @@ -0,0 +1,8 @@ +#include +#include +#include +#include +#include + +extern DLLAPI int K_register_handlers(int *, va_list); +extern DLLAPI int K_register_methods(); \ No newline at end of file diff --git a/connor_signature/reader.h b/connor_signature/reader.h new file mode 100644 index 0000000..ee1d6a2 --- /dev/null +++ b/connor_signature/reader.h @@ -0,0 +1,196 @@ +#ifndef CPPTL_JSON_READER_H_INCLUDED +# define CPPTL_JSON_READER_H_INCLUDED + +# include "features.h" +# include "value.h" +# include +# include +# include +# include + +namespace Json { + + /** \brief Unserialize a JSON document into a Value. + * + */ + class JSON_API Reader + { + public: + typedef char Char; + typedef const Char *Location; + + /** \brief Constructs a Reader allowing all features + * for parsing. + */ + Reader(); + + /** \brief Constructs a Reader allowing the specified feature set + * for parsing. + */ + Reader( const Features &features ); + + /** \brief Read a Value from a JSON document. + * \param document UTF-8 encoded string containing the document to read. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them back during + * serialization, \c false to discard comments. + * This parameter is ignored if Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an error occurred. + */ + bool parse( const std::string &document, + Value &root, + bool collectComments = true ); + + /** \brief Read a Value from a JSON document. + * \param document UTF-8 encoded string containing the document to read. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them back during + * serialization, \c false to discard comments. + * This parameter is ignored if Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an error occurred. + */ + bool parse( const char *beginDoc, const char *endDoc, + Value &root, + bool collectComments = true ); + + /// \brief Parse from input stream. + /// \see Json::operator>>(std::istream&, Json::Value&). + bool parse( std::istream &is, + Value &root, + bool collectComments = true ); + + /** \brief Returns a user friendly string that list errors in the parsed document. + * \return Formatted error message with the list of errors with their location in + * the parsed document. An empty string is returned if no error occurred + * during parsing. + */ + std::string getFormatedErrorMessages() const; + + private: + enum TokenType + { + tokenEndOfStream = 0, + tokenObjectBegin, + tokenObjectEnd, + tokenArrayBegin, + tokenArrayEnd, + tokenString, + tokenNumber, + tokenTrue, + tokenFalse, + tokenNull, + tokenArraySeparator, + tokenMemberSeparator, + tokenComment, + tokenError + }; + + class Token + { + public: + TokenType type_; + Location start_; + Location end_; + }; + + class ErrorInfo + { + public: + Token token_; + std::string message_; + Location extra_; + }; + + typedef std::deque Errors; + + bool expectToken( TokenType type, Token &token, const char *message ); + bool readToken( Token &token ); + void skipSpaces(); + bool match( Location pattern, + int patternLength ); + bool readComment(); + bool readCStyleComment(); + bool readCppStyleComment(); + bool readString(); + void readNumber(); + bool readValue(); + bool readObject( Token &token ); + bool readArray( Token &token ); + bool decodeNumber( Token &token ); + bool decodeString( Token &token ); + bool decodeString( Token &token, std::string &decoded ); + bool decodeDouble( Token &token ); + bool decodeUnicodeCodePoint( Token &token, + Location ¤t, + Location end, + unsigned int &unicode ); + bool decodeUnicodeEscapeSequence( Token &token, + Location ¤t, + Location end, + unsigned int &unicode ); + bool addError( const std::string &message, + Token &token, + Location extra = 0 ); + bool recoverFromError( TokenType skipUntilToken ); + bool addErrorAndRecover( const std::string &message, + Token &token, + TokenType skipUntilToken ); + void skipUntilSpace(); + Value ¤tValue(); + Char getNextChar(); + void getLocationLineAndColumn( Location location, + int &line, + int &column ) const; + std::string getLocationLineAndColumn( Location location ) const; + void addComment( Location begin, + Location end, + CommentPlacement placement ); + void skipCommentTokens( Token &token ); + + typedef std::stack Nodes; + Nodes nodes_; + Errors errors_; + std::string document_; + Location begin_; + Location end_; + Location current_; + Location lastValueEnd_; + Value *lastValue_; + std::string commentsBefore_; + Features features_; + bool collectComments_; + }; + + /** \brief Read from 'sin' into 'root'. + + Always keep comments from the input JSON. + + This can be used to read a file into a particular sub-object. + For example: + \code + Json::Value root; + cin >> root["dir"]["file"]; + cout << root; + \endcode + Result: + \verbatim + { + "dir": { + "file": { + // The input stream JSON would be nested here. + } + } + } + \endverbatim + \throw std::exception on parse error. + \see Json::operator<<() + */ + std::istream& operator>>( std::istream&, Value& ); + +} // namespace Json + +#endif // CPPTL_JSON_READER_H_INCLUDED diff --git a/connor_signature/sconscript b/connor_signature/sconscript new file mode 100644 index 0000000..6e7c6c8 --- /dev/null +++ b/connor_signature/sconscript @@ -0,0 +1,8 @@ +Import( 'env buildLibrary' ) + +buildLibrary( env, Split( """ + json_reader.cpp + json_value.cpp + json_writer.cpp + """ ), + 'json' ) diff --git a/connor_signature/value.h b/connor_signature/value.h new file mode 100644 index 0000000..58bfd88 --- /dev/null +++ b/connor_signature/value.h @@ -0,0 +1,1069 @@ +#ifndef CPPTL_JSON_H_INCLUDED +# define CPPTL_JSON_H_INCLUDED + +# include "forwards.h" +# include +# include + +# ifndef JSON_USE_CPPTL_SMALLMAP +# include +# else +# include +# endif +# ifdef JSON_USE_CPPTL +# include +# endif + +/** \brief JSON (JavaScript Object Notation). + */ +namespace Json { + + /** \brief Type of the value held by a Value object. + */ + enum ValueType + { + nullValue = 0, ///< 'null' value + intValue, ///< signed integer value + uintValue, ///< unsigned integer value + realValue, ///< double value + stringValue, ///< UTF-8 string value + booleanValue, ///< bool value + arrayValue, ///< array value (ordered list) + objectValue ///< object value (collection of name/value pairs). + }; + + enum CommentPlacement + { + commentBefore = 0, ///< a comment placed on the line before a value + commentAfterOnSameLine, ///< a comment just after a value on the same line + commentAfter, ///< a comment on the line after a value (only make sense for root value) + numberOfCommentPlacement + }; + +//# ifdef JSON_USE_CPPTL +// typedef CppTL::AnyEnumerator EnumMemberNames; +// typedef CppTL::AnyEnumerator EnumValues; +//# endif + + /** \brief Lightweight wrapper to tag static string. + * + * Value constructor and objectValue member assignement takes advantage of the + * StaticString and avoid the cost of string duplication when storing the + * string or the member name. + * + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ + class JSON_API StaticString + { + public: + explicit StaticString( const char *czstring ) + : str_( czstring ) + { + } + + operator const char *() const + { + return str_; + } + + const char *c_str() const + { + return str_; + } + + private: + const char *str_; + }; + + /** \brief Represents a JSON value. + * + * This class is a discriminated union wrapper that can represents a: + * - signed integer [range: Value::minInt - Value::maxInt] + * - unsigned integer (range: 0 - Value::maxUInt) + * - double + * - UTF-8 string + * - boolean + * - 'null' + * - an ordered list of Value + * - collection of name/value pairs (javascript object) + * + * The type of the held value is represented by a #ValueType and + * can be obtained using type(). + * + * values of an #objectValue or #arrayValue can be accessed using operator[]() methods. + * Non const methods will automatically create the a #nullValue element + * if it does not exist. + * The sequence of an #arrayValue will be automatically resize and initialized + * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. + * + * The get() methods can be used to obtanis default value in the case the required element + * does not exist. + * + * It is possible to iterate over the list of a #objectValue values using + * the getMemberNames() method. + */ + class JSON_API Value + { + friend class ValueIteratorBase; +# ifdef JSON_VALUE_USE_INTERNAL_MAP + friend class ValueInternalLink; + friend class ValueInternalMap; +# endif + public: + typedef std::vector Members; + typedef ValueIterator iterator; + typedef ValueConstIterator const_iterator; + typedef Json::UInt UInt; + typedef Json::Int Int; + typedef UInt ArrayIndex; + + static const Value null; + static const Int minInt; + static const Int maxInt; + static const UInt maxUInt; + + private: +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION +# ifndef JSON_VALUE_USE_INTERNAL_MAP + class CZString + { + public: + enum DuplicationPolicy + { + noDuplication = 0, + duplicate, + duplicateOnCopy + }; + CZString( int index ); + CZString( const char *cstr, DuplicationPolicy allocate ); + CZString( const CZString &other ); + ~CZString(); + CZString &operator =( const CZString &other ); + bool operator<( const CZString &other ) const; + bool operator==( const CZString &other ) const; + int index() const; + const char *c_str() const; + bool isStaticString() const; + private: + void swap( CZString &other ); + const char *cstr_; + int index_; + }; + + public: +# ifndef JSON_USE_CPPTL_SMALLMAP + typedef std::map ObjectValues; +# else + typedef CppTL::SmallMap ObjectValues; +# endif // ifndef JSON_USE_CPPTL_SMALLMAP +# endif // ifndef JSON_VALUE_USE_INTERNAL_MAP +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + + public: + /** \brief Create a default Value of the given type. + + This is a very useful constructor. + To create an empty array, pass arrayValue. + To create an empty object, pass objectValue. + Another Value can then be set to this one by assignment. + This is useful since clear() and resize() will not alter types. + + Examples: + \code + Json::Value null_value; // null + Json::Value arr_value(Json::arrayValue); // [] + Json::Value obj_value(Json::objectValue); // {} + \endcode + */ + Value( ValueType type = nullValue ); + Value( Int value ); + Value( UInt value ); + Value( double value ); + Value( const char *value ); + Value( const char *beginValue, const char *endValue ); + /** \brief Constructs a value from a static string. + + * Like other value string constructor but do not duplicate the string for + * internal storage. The given string must remain alive after the call to this + * constructor. + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * \endcode + */ + Value( const StaticString &value ); + Value( const std::string &value ); +# ifdef JSON_USE_CPPTL + Value( const CppTL::ConstString &value ); +# endif + Value( bool value ); + Value( const Value &other ); + ~Value(); + + Value &operator=( const Value &other ); + /// Swap values. + /// \note Currently, comments are intentionally not swapped, for + /// both logic and efficiency. + void swap( Value &other ); + + ValueType type() const; + + bool operator <( const Value &other ) const; + bool operator <=( const Value &other ) const; + bool operator >=( const Value &other ) const; + bool operator >( const Value &other ) const; + + bool operator ==( const Value &other ) const; + bool operator !=( const Value &other ) const; + + int compare( const Value &other ); + + const char *asCString() const; + std::string asString() const; +# ifdef JSON_USE_CPPTL + CppTL::ConstString asConstString() const; +# endif + Int asInt() const; + UInt asUInt() const; + double asDouble() const; + bool asBool() const; + + bool isNull() const; + bool isBool() const; + bool isInt() const; + bool isUInt() const; + bool isIntegral() const; + bool isDouble() const; + bool isNumeric() const; + bool isString() const; + bool isArray() const; + bool isObject() const; + + bool isConvertibleTo( ValueType other ) const; + + /// Number of values in array or object + UInt size() const; + + /// \brief Return true if empty array, empty object, or null; + /// otherwise, false. + bool empty() const; + + /// Return isNull() + bool operator!() const; + + /// Remove all object members and array elements. + /// \pre type() is arrayValue, objectValue, or nullValue + /// \post type() is unchanged + void clear(); + + /// Resize the array to size elements. + /// New elements are initialized to null. + /// May only be called on nullValue or arrayValue. + /// \pre type() is arrayValue or nullValue + /// \post type() is arrayValue + void resize( UInt size ); + + /// Access an array element (zero based index ). + /// If the array contains less than index element, then null value are inserted + /// in the array so that its size is index+1. + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + Value &operator[]( UInt index ); + /// Access an array element (zero based index ) + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + const Value &operator[]( UInt index ) const; + /// If the array contains at least index+1 elements, returns the element value, + /// otherwise returns defaultValue. + Value get( UInt index, + const Value &defaultValue ) const; + /// Return true if index < size(). + bool isValidIndex( UInt index ) const; + /// \brief Append value to array at the end. + /// + /// Equivalent to jsonvalue[jsonvalue.size()] = value; + Value &append( const Value &value ); + + /// Access an object value by name, create a null member if it does not exist. + Value &operator[]( const char *key ); + /// Access an object value by name, returns null if there is no member with that name. + const Value &operator[]( const char *key ) const; + /// Access an object value by name, create a null member if it does not exist. + Value &operator[]( const std::string &key ); + /// Access an object value by name, returns null if there is no member with that name. + const Value &operator[]( const std::string &key ) const; + /** \brief Access an object value by name, create a null member if it does not exist. + + * If the object as no entry for that name, then the member name used to store + * the new entry is not duplicated. + * Example of use: + * \code + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ + Value &operator[]( const StaticString &key ); +# ifdef JSON_USE_CPPTL + /// Access an object value by name, create a null member if it does not exist. + Value &operator[]( const CppTL::ConstString &key ); + /// Access an object value by name, returns null if there is no member with that name. + const Value &operator[]( const CppTL::ConstString &key ) const; +# endif + /// Return the member named key if it exist, defaultValue otherwise. + Value get( const char *key, + const Value &defaultValue ) const; + /// Return the member named key if it exist, defaultValue otherwise. + Value get( const std::string &key, + const Value &defaultValue ) const; +# ifdef JSON_USE_CPPTL + /// Return the member named key if it exist, defaultValue otherwise. + Value get( const CppTL::ConstString &key, + const Value &defaultValue ) const; +# endif + /// \brief Remove and return the named member. + /// + /// Do nothing if it did not exist. + /// \return the removed Value, or null. + /// \pre type() is objectValue or nullValue + /// \post type() is unchanged + Value removeMember( const char* key ); + /// Same as removeMember(const char*) + Value removeMember( const std::string &key ); + + /// Return true if the object has a member named key. + bool isMember( const char *key ) const; + /// Return true if the object has a member named key. + bool isMember( const std::string &key ) const; +# ifdef JSON_USE_CPPTL + /// Return true if the object has a member named key. + bool isMember( const CppTL::ConstString &key ) const; +# endif + + /// \brief Return a list of the member names. + /// + /// If null, return an empty list. + /// \pre type() is objectValue or nullValue + /// \post if type() was nullValue, it remains nullValue + Members getMemberNames() const; + +//# ifdef JSON_USE_CPPTL +// EnumMemberNames enumMemberNames() const; +// EnumValues enumValues() const; +//# endif + + /// Comments must be //... or /* ... */ + void setComment( const char *comment, + CommentPlacement placement ); + /// Comments must be //... or /* ... */ + void setComment( const std::string &comment, + CommentPlacement placement ); + bool hasComment( CommentPlacement placement ) const; + /// Include delimiters and embedded newlines. + std::string getComment( CommentPlacement placement ) const; + + std::string toStyledString() const; + + const_iterator begin() const; + const_iterator end() const; + + iterator begin(); + iterator end(); + + private: + Value &resolveReference( const char *key, + bool isStatic ); + +# ifdef JSON_VALUE_USE_INTERNAL_MAP + inline bool isItemAvailable() const + { + return itemIsUsed_ == 0; + } + + inline void setItemUsed( bool isUsed = true ) + { + itemIsUsed_ = isUsed ? 1 : 0; + } + + inline bool isMemberNameStatic() const + { + return memberNameIsStatic_ == 0; + } + + inline void setMemberNameIsStatic( bool isStatic ) + { + memberNameIsStatic_ = isStatic ? 1 : 0; + } +# endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP + + private: + struct CommentInfo + { + CommentInfo(); + ~CommentInfo(); + + void setComment( const char *text ); + + char *comment_; + }; + + //struct MemberNamesTransform + //{ + // typedef const char *result_type; + // const char *operator()( const CZString &name ) const + // { + // return name.c_str(); + // } + //}; + + union ValueHolder + { + Int int_; + UInt uint_; + double real_; + bool bool_; + char *string_; +# ifdef JSON_VALUE_USE_INTERNAL_MAP + ValueInternalArray *array_; + ValueInternalMap *map_; +#else + ObjectValues *map_; +# endif + } value_; + ValueType type_ : 8; + int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. +# ifdef JSON_VALUE_USE_INTERNAL_MAP + unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. + int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. +# endif + CommentInfo *comments_; + }; + + + /** \brief Experimental and untested: represents an element of the "path" to access a node. + */ + class PathArgument + { + public: + friend class Path; + + PathArgument(); + PathArgument( UInt index ); + PathArgument( const char *key ); + PathArgument( const std::string &key ); + + private: + enum Kind + { + kindNone = 0, + kindIndex, + kindKey + }; + std::string key_; + UInt index_; + Kind kind_; + }; + + /** \brief Experimental and untested: represents a "path" to access a node. + * + * Syntax: + * - "." => root node + * - ".[n]" => elements at index 'n' of root node (an array value) + * - ".name" => member named 'name' of root node (an object value) + * - ".name1.name2.name3" + * - ".[0][1][2].name1[3]" + * - ".%" => member name is provided as parameter + * - ".[%]" => index is provied as parameter + */ + class Path + { + public: + Path( const std::string &path, + const PathArgument &a1 = PathArgument(), + const PathArgument &a2 = PathArgument(), + const PathArgument &a3 = PathArgument(), + const PathArgument &a4 = PathArgument(), + const PathArgument &a5 = PathArgument() ); + + const Value &resolve( const Value &root ) const; + Value resolve( const Value &root, + const Value &defaultValue ) const; + /// Creates the "path" to access the specified node and returns a reference on the node. + Value &make( Value &root ) const; + + private: + typedef std::vector InArgs; + typedef std::vector Args; + + void makePath( const std::string &path, + const InArgs &in ); + void addPathInArg( const std::string &path, + const InArgs &in, + InArgs::const_iterator &itInArg, + PathArgument::Kind kind ); + void invalidPath( const std::string &path, + int location ); + + Args args_; + }; + + /** \brief Experimental do not use: Allocator to customize member name and string value memory management done by Value. + * + * - makeMemberName() and releaseMemberName() are called to respectively duplicate and + * free an Json::objectValue member name. + * - duplicateStringValue() and releaseStringValue() are called similarly to + * duplicate and free a Json::stringValue value. + */ + class ValueAllocator + { + public: + enum { unknown = (unsigned)-1 }; + + virtual ~ValueAllocator(); + + virtual char *makeMemberName( const char *memberName ) = 0; + virtual void releaseMemberName( char *memberName ) = 0; + virtual char *duplicateStringValue( const char *value, + unsigned int length = unknown ) = 0; + virtual void releaseStringValue( char *value ) = 0; + }; + +#ifdef JSON_VALUE_USE_INTERNAL_MAP + /** \brief Allocator to customize Value internal map. + * Below is an example of a simple implementation (default implementation actually + * use memory pool for speed). + * \code + class DefaultValueMapAllocator : public ValueMapAllocator + { + public: // overridden from ValueMapAllocator + virtual ValueInternalMap *newMap() + { + return new ValueInternalMap(); + } + + virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) + { + return new ValueInternalMap( other ); + } + + virtual void destructMap( ValueInternalMap *map ) + { + delete map; + } + + virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) + { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets( ValueInternalLink *links ) + { + delete [] links; + } + + virtual ValueInternalLink *allocateMapLink() + { + return new ValueInternalLink(); + } + + virtual void releaseMapLink( ValueInternalLink *link ) + { + delete link; + } + }; + * \endcode + */ + class JSON_API ValueMapAllocator + { + public: + virtual ~ValueMapAllocator(); + virtual ValueInternalMap *newMap() = 0; + virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) = 0; + virtual void destructMap( ValueInternalMap *map ) = 0; + virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) = 0; + virtual void releaseMapBuckets( ValueInternalLink *links ) = 0; + virtual ValueInternalLink *allocateMapLink() = 0; + virtual void releaseMapLink( ValueInternalLink *link ) = 0; + }; + + /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). + * \internal previous_ & next_ allows for bidirectional traversal. + */ + class JSON_API ValueInternalLink + { + public: + enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. + enum InternalFlags { + flagAvailable = 0, + flagUsed = 1 + }; + + ValueInternalLink(); + + ~ValueInternalLink(); + + Value items_[itemPerLink]; + char *keys_[itemPerLink]; + ValueInternalLink *previous_; + ValueInternalLink *next_; + }; + + + /** \brief A linked page based hash-table implementation used internally by Value. + * \internal ValueInternalMap is a tradional bucket based hash-table, with a linked + * list in each bucket to handle collision. There is an addional twist in that + * each node of the collision linked list is a page containing a fixed amount of + * value. This provides a better compromise between memory usage and speed. + * + * Each bucket is made up of a chained list of ValueInternalLink. The last + * link of a given bucket can be found in the 'previous_' field of the following bucket. + * The last link of the last bucket is stored in tailLink_ as it has no following bucket. + * Only the last link of a bucket may contains 'available' item. The last link always + * contains at least one element unless is it the bucket one very first link. + */ + class JSON_API ValueInternalMap + { + friend class ValueIteratorBase; + friend class Value; + public: + typedef unsigned int HashKey; + typedef unsigned int BucketIndex; + +# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState + { + IteratorState() + : map_(0) + , link_(0) + , itemIndex_(0) + , bucketIndex_(0) + { + } + ValueInternalMap *map_; + ValueInternalLink *link_; + BucketIndex itemIndex_; + BucketIndex bucketIndex_; + }; +# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + + ValueInternalMap(); + ValueInternalMap( const ValueInternalMap &other ); + ValueInternalMap &operator =( const ValueInternalMap &other ); + ~ValueInternalMap(); + + void swap( ValueInternalMap &other ); + + BucketIndex size() const; + + void clear(); + + bool reserveDelta( BucketIndex growth ); + + bool reserve( BucketIndex newItemCount ); + + const Value *find( const char *key ) const; + + Value *find( const char *key ); + + Value &resolveReference( const char *key, + bool isStatic ); + + void remove( const char *key ); + + void doActualRemove( ValueInternalLink *link, + BucketIndex index, + BucketIndex bucketIndex ); + + ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex ); + + Value &setNewItem( const char *key, + bool isStatic, + ValueInternalLink *link, + BucketIndex index ); + + Value &unsafeAdd( const char *key, + bool isStatic, + HashKey hashedKey ); + + HashKey hash( const char *key ) const; + + int compare( const ValueInternalMap &other ) const; + + private: + void makeBeginIterator( IteratorState &it ) const; + void makeEndIterator( IteratorState &it ) const; + static bool equals( const IteratorState &x, const IteratorState &other ); + static void increment( IteratorState &iterator ); + static void incrementBucket( IteratorState &iterator ); + static void decrement( IteratorState &iterator ); + static const char *key( const IteratorState &iterator ); + static const char *key( const IteratorState &iterator, bool &isStatic ); + static Value &value( const IteratorState &iterator ); + static int distance( const IteratorState &x, const IteratorState &y ); + + private: + ValueInternalLink *buckets_; + ValueInternalLink *tailLink_; + BucketIndex bucketsSize_; + BucketIndex itemCount_; + }; + + /** \brief A simplified deque implementation used internally by Value. + * \internal + * It is based on a list of fixed "page", each page contains a fixed number of items. + * Instead of using a linked-list, a array of pointer is used for fast item look-up. + * Look-up for an element is as follow: + * - compute page index: pageIndex = itemIndex / itemsPerPage + * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] + * + * Insertion is amortized constant time (only the array containing the index of pointers + * need to be reallocated when items are appended). + */ + class JSON_API ValueInternalArray + { + friend class Value; + friend class ValueIteratorBase; + public: + enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. + typedef Value::ArrayIndex ArrayIndex; + typedef unsigned int PageIndex; + +# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState // Must be a POD + { + IteratorState() + : array_(0) + , currentPageIndex_(0) + , currentItemIndex_(0) + { + } + ValueInternalArray *array_; + Value **currentPageIndex_; + unsigned int currentItemIndex_; + }; +# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + + ValueInternalArray(); + ValueInternalArray( const ValueInternalArray &other ); + ValueInternalArray &operator =( const ValueInternalArray &other ); + ~ValueInternalArray(); + void swap( ValueInternalArray &other ); + + void clear(); + void resize( ArrayIndex newSize ); + + Value &resolveReference( ArrayIndex index ); + + Value *find( ArrayIndex index ) const; + + ArrayIndex size() const; + + int compare( const ValueInternalArray &other ) const; + + private: + static bool equals( const IteratorState &x, const IteratorState &other ); + static void increment( IteratorState &iterator ); + static void decrement( IteratorState &iterator ); + static Value &dereference( const IteratorState &iterator ); + static Value &unsafeDereference( const IteratorState &iterator ); + static int distance( const IteratorState &x, const IteratorState &y ); + static ArrayIndex indexOf( const IteratorState &iterator ); + void makeBeginIterator( IteratorState &it ) const; + void makeEndIterator( IteratorState &it ) const; + void makeIterator( IteratorState &it, ArrayIndex index ) const; + + void makeIndexValid( ArrayIndex index ); + + Value **pages_; + ArrayIndex size_; + PageIndex pageCount_; + }; + + /** \brief Experimental: do not use. Allocator to customize Value internal array. + * Below is an example of a simple implementation (actual implementation use + * memory pool). + \code +class DefaultValueArrayAllocator : public ValueArrayAllocator +{ +public: // overridden from ValueArrayAllocator + virtual ~DefaultValueArrayAllocator() + { + } + + virtual ValueInternalArray *newArray() + { + return new ValueInternalArray(); + } + + virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) + { + return new ValueInternalArray( other ); + } + + virtual void destruct( ValueInternalArray *array ) + { + delete array; + } + + virtual void reallocateArrayPageIndex( Value **&indexes, + ValueInternalArray::PageIndex &indexCount, + ValueInternalArray::PageIndex minNewIndexCount ) + { + ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; + if ( minNewIndexCount > newIndexCount ) + newIndexCount = minNewIndexCount; + void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); + if ( !newIndexes ) + throw std::bad_alloc(); + indexCount = newIndexCount; + indexes = static_cast( newIndexes ); + } + virtual void releaseArrayPageIndex( Value **indexes, + ValueInternalArray::PageIndex indexCount ) + { + if ( indexes ) + free( indexes ); + } + + virtual Value *allocateArrayPage() + { + return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); + } + + virtual void releaseArrayPage( Value *value ) + { + if ( value ) + free( value ); + } +}; + \endcode + */ + class JSON_API ValueArrayAllocator + { + public: + virtual ~ValueArrayAllocator(); + virtual ValueInternalArray *newArray() = 0; + virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) = 0; + virtual void destructArray( ValueInternalArray *array ) = 0; + /** \brief Reallocate array page index. + * Reallocates an array of pointer on each page. + * \param indexes [input] pointer on the current index. May be \c NULL. + * [output] pointer on the new index of at least + * \a minNewIndexCount pages. + * \param indexCount [input] current number of pages in the index. + * [output] number of page the reallocated index can handle. + * \b MUST be >= \a minNewIndexCount. + * \param minNewIndexCount Minimum number of page the new index must be able to + * handle. + */ + virtual void reallocateArrayPageIndex( Value **&indexes, + ValueInternalArray::PageIndex &indexCount, + ValueInternalArray::PageIndex minNewIndexCount ) = 0; + virtual void releaseArrayPageIndex( Value **indexes, + ValueInternalArray::PageIndex indexCount ) = 0; + virtual Value *allocateArrayPage() = 0; + virtual void releaseArrayPage( Value *value ) = 0; + }; +#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP + + + /** \brief base class for Value iterators. + * + */ + class ValueIteratorBase + { + public: + typedef unsigned int size_t; + typedef int difference_type; + typedef ValueIteratorBase SelfType; + + ValueIteratorBase(); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueIteratorBase( const Value::ObjectValues::iterator ¤t ); +#else + ValueIteratorBase( const ValueInternalArray::IteratorState &state ); + ValueIteratorBase( const ValueInternalMap::IteratorState &state ); +#endif + + bool operator ==( const SelfType &other ) const + { + return isEqual( other ); + } + + bool operator !=( const SelfType &other ) const + { + return !isEqual( other ); + } + + difference_type operator -( const SelfType &other ) const + { + return computeDistance( other ); + } + + /// Return either the index or the member name of the referenced value as a Value. + Value key() const; + + /// Return the index of the referenced Value. -1 if it is not an arrayValue. + UInt index() const; + + /// Return the member name of the referenced Value. "" if it is not an objectValue. + const char *memberName() const; + + protected: + Value &deref() const; + + void increment(); + + void decrement(); + + difference_type computeDistance( const SelfType &other ) const; + + bool isEqual( const SelfType &other ) const; + + void copy( const SelfType &other ); + + private: +#ifndef JSON_VALUE_USE_INTERNAL_MAP + Value::ObjectValues::iterator current_; + // Indicates that iterator is for a null value. + bool isNull_; +#else + union + { + ValueInternalArray::IteratorState array_; + ValueInternalMap::IteratorState map_; + } iterator_; + bool isArray_; +#endif + }; + + /** \brief const iterator for object and array value. + * + */ + class ValueConstIterator : public ValueIteratorBase + { + friend class Value; + public: + typedef unsigned int size_t; + typedef int difference_type; + typedef const Value &reference; + typedef const Value *pointer; + typedef ValueConstIterator SelfType; + + ValueConstIterator(); + private: + /*! \internal Use by Value to create an iterator. + */ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueConstIterator( const Value::ObjectValues::iterator ¤t ); +#else + ValueConstIterator( const ValueInternalArray::IteratorState &state ); + ValueConstIterator( const ValueInternalMap::IteratorState &state ); +#endif + public: + SelfType &operator =( const ValueIteratorBase &other ); + + SelfType operator++( int ) + { + SelfType temp( *this ); + ++*this; + return temp; + } + + SelfType operator--( int ) + { + SelfType temp( *this ); + --*this; + return temp; + } + + SelfType &operator--() + { + decrement(); + return *this; + } + + SelfType &operator++() + { + increment(); + return *this; + } + + reference operator *() const + { + return deref(); + } + }; + + + /** \brief Iterator for object and array value. + */ + class ValueIterator : public ValueIteratorBase + { + friend class Value; + public: + typedef unsigned int size_t; + typedef int difference_type; + typedef Value &reference; + typedef Value *pointer; + typedef ValueIterator SelfType; + + ValueIterator(); + ValueIterator( const ValueConstIterator &other ); + ValueIterator( const ValueIterator &other ); + private: + /*! \internal Use by Value to create an iterator. + */ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueIterator( const Value::ObjectValues::iterator ¤t ); +#else + ValueIterator( const ValueInternalArray::IteratorState &state ); + ValueIterator( const ValueInternalMap::IteratorState &state ); +#endif + public: + + SelfType &operator =( const SelfType &other ); + + SelfType operator++( int ) + { + SelfType temp( *this ); + ++*this; + return temp; + } + + SelfType operator--( int ) + { + SelfType temp( *this ); + --*this; + return temp; + } + + SelfType &operator--() + { + decrement(); + return *this; + } + + SelfType &operator++() + { + increment(); + return *this; + } + + reference operator *() const + { + return deref(); + } + }; + + +} // namespace Json + + +#endif // CPPTL_JSON_H_INCLUDED diff --git a/connor_signature/writer.h b/connor_signature/writer.h new file mode 100644 index 0000000..5f4b83b --- /dev/null +++ b/connor_signature/writer.h @@ -0,0 +1,174 @@ +#ifndef JSON_WRITER_H_INCLUDED +# define JSON_WRITER_H_INCLUDED + +# include "value.h" +# include +# include +# include + +namespace Json { + + class Value; + + /** \brief Abstract class for writers. + */ + class JSON_API Writer + { + public: + virtual ~Writer(); + + virtual std::string write( const Value &root ) = 0; + }; + + /** \brief Outputs a Value in JSON format without formatting (not human friendly). + * + * The JSON document is written in a single line. It is not intended for 'human' consumption, + * but may be usefull to support feature such as RPC where bandwith is limited. + * \sa Reader, Value + */ + class JSON_API FastWriter : public Writer + { + public: + FastWriter(); + virtual ~FastWriter(){} + + void enableYAMLCompatibility(); + + public: // overridden from Writer + virtual std::string write( const Value &root ); + + private: + void writeValue( const Value &value ); + + std::string document_; + bool yamlCompatiblityEnabled_; + }; + + /** \brief Writes a Value in JSON format in a human friendly way. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per line + * and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value types, + * and all the values fit on one lines, then print the array on a single line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * If the Value have comments then they are outputed according to their #CommentPlacement. + * + * \sa Reader, Value, Value::setComment() + */ + class JSON_API StyledWriter: public Writer + { + public: + StyledWriter(); + virtual ~StyledWriter(){} + + public: // overridden from Writer + /** \brief Serialize a Value in JSON format. + * \param root Value to serialize. + * \return String containing the JSON document that represents the root value. + */ + virtual std::string write( const Value &root ); + + private: + void writeValue( const Value &value ); + void writeArrayValue( const Value &value ); + bool isMultineArray( const Value &value ); + void pushValue( const std::string &value ); + void writeIndent(); + void writeWithIndent( const std::string &value ); + void indent(); + void unindent(); + void writeCommentBeforeValue( const Value &root ); + void writeCommentAfterValueOnSameLine( const Value &root ); + bool hasCommentForValue( const Value &value ); + static std::string normalizeEOL( const std::string &text ); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::string document_; + std::string indentString_; + int rightMargin_; + int indentSize_; + bool addChildValues_; + }; + + /** \brief Writes a Value in JSON format in a human friendly way, + to a stream rather than to a string. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per line + * and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value types, + * and all the values fit on one lines, then print the array on a single line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * If the Value have comments then they are outputed according to their #CommentPlacement. + * + * \param indentation Each level will be indented by this amount extra. + * \sa Reader, Value, Value::setComment() + */ + class JSON_API StyledStreamWriter + { + public: + StyledStreamWriter( std::string indentation="\t" ); + ~StyledStreamWriter(){} + + public: + /** \brief Serialize a Value in JSON format. + * \param out Stream to write to. (Can be ostringstream, e.g.) + * \param root Value to serialize. + * \note There is no point in deriving from Writer, since write() should not return a value. + */ + void write( std::ostream &out, const Value &root ); + + private: + void writeValue( const Value &value ); + void writeArrayValue( const Value &value ); + bool isMultineArray( const Value &value ); + void pushValue( const std::string &value ); + void writeIndent(); + void writeWithIndent( const std::string &value ); + void indent(); + void unindent(); + void writeCommentBeforeValue( const Value &root ); + void writeCommentAfterValueOnSameLine( const Value &root ); + bool hasCommentForValue( const Value &value ); + static std::string normalizeEOL( const std::string &text ); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::ostream* document_; + std::string indentString_; + int rightMargin_; + std::string indentation_; + bool addChildValues_; + }; + + std::string JSON_API valueToString( Int value ); + std::string JSON_API valueToString( UInt value ); + std::string JSON_API valueToString( double value ); + std::string JSON_API valueToString( bool value ); + std::string JSON_API valueToQuotedString( const char *value ); + + /// \brief Output using the StyledStreamWriter. + /// \see Json::operator>>() + std::ostream& operator<<( std::ostream&, const Value &root ); + +} // namespace Json + + + +#endif // JSON_WRITER_H_INCLUDED diff --git a/connor_signature/x64/Release/Connor_ElevateTask.obj b/connor_signature/x64/Release/Connor_ElevateTask.obj new file mode 100644 index 0000000..51295e5 Binary files /dev/null and b/connor_signature/x64/Release/Connor_ElevateTask.obj differ diff --git a/connor_signature/x64/Release/Connor_Review_Person.obj b/connor_signature/x64/Release/Connor_Review_Person.obj new file mode 100644 index 0000000..2d5e3bc Binary files /dev/null and b/connor_signature/x64/Release/Connor_Review_Person.obj differ diff --git a/connor_signature/x64/Release/Connor_allow_Workflow.obj b/connor_signature/x64/Release/Connor_allow_Workflow.obj new file mode 100644 index 0000000..ed639e2 Binary files /dev/null and b/connor_signature/x64/Release/Connor_allow_Workflow.obj differ diff --git a/connor_signature/x64/Release/LD_AutoAssign.obj b/connor_signature/x64/Release/LD_AutoAssign.obj new file mode 100644 index 0000000..2170ec1 Binary files /dev/null and b/connor_signature/x64/Release/LD_AutoAssign.obj differ diff --git a/connor_signature/x64/Release/LD_CompletionDate.obj b/connor_signature/x64/Release/LD_CompletionDate.obj new file mode 100644 index 0000000..fe85f69 Binary files /dev/null and b/connor_signature/x64/Release/LD_CompletionDate.obj differ diff --git a/connor_signature/x64/Release/LD_ECN01_SetCICNFormProperty.obj b/connor_signature/x64/Release/LD_ECN01_SetCICNFormProperty.obj new file mode 100644 index 0000000..3683390 Binary files /dev/null and b/connor_signature/x64/Release/LD_ECN01_SetCICNFormProperty.obj differ diff --git a/connor_signature/x64/Release/LD_FormAttrToExcel.obj b/connor_signature/x64/Release/LD_FormAttrToExcel.obj new file mode 100644 index 0000000..5f8b776 Binary files /dev/null and b/connor_signature/x64/Release/LD_FormAttrToExcel.obj differ diff --git a/connor_signature/x64/Release/LD_GYLXFrozen.obj b/connor_signature/x64/Release/LD_GYLXFrozen.obj new file mode 100644 index 0000000..05d94d9 Binary files /dev/null and b/connor_signature/x64/Release/LD_GYLXFrozen.obj differ diff --git a/connor_signature/x64/Release/LD_PartChange.obj b/connor_signature/x64/Release/LD_PartChange.obj new file mode 100644 index 0000000..3558034 Binary files /dev/null and b/connor_signature/x64/Release/LD_PartChange.obj differ diff --git a/connor_signature/x64/Release/LD_PartCompFLAG.obj b/connor_signature/x64/Release/LD_PartCompFLAG.obj new file mode 100644 index 0000000..d206a42 Binary files /dev/null and b/connor_signature/x64/Release/LD_PartCompFLAG.obj differ diff --git a/connor_signature/x64/Release/LD_SendDJJDD_To_MES.obj b/connor_signature/x64/Release/LD_SendDJJDD_To_MES.obj new file mode 100644 index 0000000..49b3f17 Binary files /dev/null and b/connor_signature/x64/Release/LD_SendDJJDD_To_MES.obj differ diff --git a/connor_signature/x64/Release/LD_SendECRECN_ToSAPMES.obj b/connor_signature/x64/Release/LD_SendECRECN_ToSAPMES.obj new file mode 100644 index 0000000..b3095e0 Binary files /dev/null and b/connor_signature/x64/Release/LD_SendECRECN_ToSAPMES.obj differ diff --git a/connor_signature/x64/Release/LD_TaskAssignmentDate.obj b/connor_signature/x64/Release/LD_TaskAssignmentDate.obj new file mode 100644 index 0000000..40adebf Binary files /dev/null and b/connor_signature/x64/Release/LD_TaskAssignmentDate.obj differ diff --git a/connor_signature/x64/Release/SH_PLM_Email.obj b/connor_signature/x64/Release/SH_PLM_Email.obj new file mode 100644 index 0000000..c4ec8a7 Binary files /dev/null and b/connor_signature/x64/Release/SH_PLM_Email.obj differ diff --git a/connor_signature/x64/Release/Send_Sap_Bom.obj b/connor_signature/x64/Release/Send_Sap_Bom.obj new file mode 100644 index 0000000..5727bec Binary files /dev/null and b/connor_signature/x64/Release/Send_Sap_Bom.obj differ diff --git a/connor_signature/x64/Release/Send_Sap_material.cpp.obj b/connor_signature/x64/Release/Send_Sap_material.cpp.obj new file mode 100644 index 0000000..e81e72f Binary files /dev/null and b/connor_signature/x64/Release/Send_Sap_material.cpp.obj differ diff --git a/connor_signature/x64/Release/TEST.obj b/connor_signature/x64/Release/TEST.obj new file mode 100644 index 0000000..d0621ed Binary files /dev/null and b/connor_signature/x64/Release/TEST.obj differ diff --git a/connor_signature/x64/Release/UpgradeTask.obj b/connor_signature/x64/Release/UpgradeTask.obj new file mode 100644 index 0000000..e219a3e Binary files /dev/null and b/connor_signature/x64/Release/UpgradeTask.obj differ diff --git a/connor_signature/x64/Release/a.obj b/connor_signature/x64/Release/a.obj new file mode 100644 index 0000000..757e515 Binary files /dev/null and b/connor_signature/x64/Release/a.obj differ diff --git a/connor_signature/x64/Release/addLb.obj b/connor_signature/x64/Release/addLb.obj new file mode 100644 index 0000000..34ce6d7 Binary files /dev/null and b/connor_signature/x64/Release/addLb.obj differ diff --git a/connor_signature/x64/Release/ado.obj b/connor_signature/x64/Release/ado.obj new file mode 100644 index 0000000..84e606f Binary files /dev/null and b/connor_signature/x64/Release/ado.obj differ diff --git a/connor_signature/x64/Release/connor_signature.Build.CppClean.log b/connor_signature/x64/Release/connor_signature.Build.CppClean.log new file mode 100644 index 0000000..41e6d3c --- /dev/null +++ b/connor_signature/x64/Release/connor_signature.Build.CppClean.log @@ -0,0 +1,19 @@ +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\vc140.pdb +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\qf8_handlers.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\kutil.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_sign_pre_revision.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_sign_master.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_sign_dataset.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_signature.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_revise_clear_master.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_avic_catiasign.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_add_release_status.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\ado.obj +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\msado15.tli +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\msado15.tlh +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_signature.tlog\cl.command.1.tlog +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_signature.tlog\cl.read.1.tlog +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_signature.tlog\cl.write.1.tlog +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_signature.tlog\link.command.1.tlog +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_signature.tlog\link.read.1.tlog +c:\users\89512\desktop\美菱\meling_itk\connor_signature\x64\release\connor_signature.tlog\link.write.1.tlog diff --git a/connor_signature/x64/Release/connor_signature.lastbuildstate b/connor_signature/x64/Release/connor_signature.lastbuildstate new file mode 100644 index 0000000..ee130fd --- /dev/null +++ b/connor_signature/x64/Release/connor_signature.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v110:false +Release|x64|C:\code\connor_signature\| diff --git a/connor_signature/x64/Release/connor_signature.log b/connor_signature/x64/Release/connor_signature.log new file mode 100644 index 0000000..b66b010 --- /dev/null +++ b/connor_signature/x64/Release/connor_signature.log @@ -0,0 +1,195 @@ +C:\VS2019\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(513,5): warning MSB8028: 中间目录(x64\Release\)包含从另一个项目(connor_signature.vcxproj, meling_itk.vcxproj, raycus_itk.vcxproj, raycus_itk2.vcxproj, raycus_itk_c.vcxproj)共享的文件。 这会导致错误的清除和重新生成行为。 + a.cpp + addLb.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\addLb.cpp(179,11): warning C4834: 放弃具有 "nodiscard" 属性的函数的返回值 +D:\source\联德\itk\ld_itk(1)\connor_signature\addLb.cpp(138,6): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\addLb.cpp(222,5): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. + ado.cxx + Connor_allow_Workflow.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\Connor_allow_Workflow.cpp(56,9): warning C4477: “printf”: 格式字符串“%d”需要类型“int”的参数,但可变参数 1 拥有了类型“unsigned __int64” +D:\source\联德\itk\ld_itk(1)\connor_signature\Connor_allow_Workflow.cpp(56,9): message : 请考虑在格式字符串中使用“%zd” + Connor_Review_Person.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\Connor_Review_Person.cpp(199,9): warning C4477: “printf”: 格式字符串“%d”需要类型“int”的参数,但可变参数 1 拥有了类型“unsigned __int64” +D:\source\联德\itk\ld_itk(1)\connor_signature\Connor_Review_Person.cpp(199,9): message : 请考虑在格式字符串中使用“%zd” + json_reader.cpp + json_value.cpp + json_writer.cpp +D:\source\联德\itk\ld_itk(1)\connor_signature\json_writer.cpp(119,42): warning C4267: “初始化”: 从“size_t”转换到“unsigned int”,可能丢失数据 + Connor_ElevateTask.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + LD_AutoAssign.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_AutoAssign.cpp(18,13): warning C4101: “file_descriptor”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_AutoAssign.cpp(20,8): warning C4101: “new_file_name”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_AutoAssign.cpp(71,85): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 + LD_ECN01_SetCICNFormProperty.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_ECN01_SetCICNFormProperty.cpp(215,12): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_ECN01_SetCICNFormProperty.cpp(230,7): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_ECN01_SetCICNFormProperty.cpp(505,12): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_ECN01_SetCICNFormProperty.cpp(520,7): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_ECN01_SetCICNFormProperty.cpp(347,11): warning C4101: “fathnum”: 未引用的局部变量 + LD_CompletionDate.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + The contents of are available only with C++17 or later. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_CompletionDate.cpp(61,10): warning C4101: “itemObjId”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_CompletionDate.cpp(63,10): warning C4101: “revision_id”: 未引用的局部变量 + LD_FormAttrToExcel.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_FormAttrToExcel.cpp(49,25): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_FormAttrToExcel.cpp(50,25): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_FormAttrToExcel.cpp(207,29): warning C4474: printf: 格式字符串中传递的参数太多 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_FormAttrToExcel.cpp(207,29): message : 占位符和其参数预计 0 可变参数,但提供的却是 1 参数 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_FormAttrToExcel.cpp(208,25): warning C4474: printf: 格式字符串中传递的参数太多 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_FormAttrToExcel.cpp(208,25): message : 占位符和其参数预计 0 可变参数,但提供的却是 1 参数 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_FormAttrToExcel.cpp(229,13): warning C4101: “serial_num”: 未引用的局部变量 + LD_GYLXFrozen.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + The contents of are available only with C++17 or later. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_GYLXFrozen.cpp(76,16): warning C4834: 放弃具有 "nodiscard" 属性的函数的返回值 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_GYLXFrozen.cpp(167,7): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_GYLXFrozen.cpp(182,7): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. + LD_PartChange.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_PartChange.cpp(57,24): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_PartChange.cpp(194,6): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_PartChange.cpp(233,6): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_PartChange.cpp(140,34): warning C4101: “e”: 未引用的局部变量 + LD_PartCompFLAG.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_PartCompFLAG.cpp(73,24): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_PartCompFLAG.cpp(263,9): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_PartCompFLAG.cpp(311,6): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_PartCompFLAG.cpp(166,34): warning C4101: “e”: 未引用的局部变量 + LD_SendDJJDD_To_MES.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + The contents of are available only with C++17 or later. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_SendDJJDD_To_MES.cpp(63,24): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 + LD_SendECRECN_ToSAPMES.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + The contents of are available only with C++17 or later. + LD_TaskAssignmentDate.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + The contents of are available only with C++17 or later. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_TaskAssignmentDate.cpp(58,10): warning C4101: “itemObjId”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_TaskAssignmentDate.cpp(60,10): warning C4101: “revision_id”: 未引用的局部变量 + ocilib.cpp +D:\source\联德\itk\ld_itk(1)\connor_signature\ocilib.cpp(158,5): warning C4267: “参数”: 从“size_t”转换到“ub4”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\ocilib.cpp(181,5): warning C4267: “参数”: 从“size_t”转换到“ub4”,可能丢失数据 + 正在编译... + raycus_itk.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + kutil.cpp +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(118,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(130,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(142,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(154,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(405,88): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(436,6): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(438,3): warning C4996: 'mkdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _mkdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(480,9): warning C4101: “now”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(479,7): warning C4101: “date_string”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(481,13): warning C4101: “p”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(546,6): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(548,3): warning C4996: 'mkdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _mkdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(609,6): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(611,3): warning C4996: 'mkdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _mkdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(682,6): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(690,7): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(767,6): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(774,7): warning C4996: 'chdir': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _chdir. See online help for details. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(904,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(913,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(916,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(942,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(952,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(954,2): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1011,24): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1021,24): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1033,24): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1061,39): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1062,39): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1250,31): warning C4101: “old_scope”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1271,31): warning C4101: “old_scope”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1306,13): warning C4101: “file_descriptor”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1308,8): warning C4101: “new_file_name”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1367,13): warning C4101: “file_descriptor”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1369,8): warning C4101: “new_file_name”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1417,13): warning C4101: “file_descriptor”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\kutil.cpp(1419,8): warning C4101: “new_file_name”: 未引用的局部变量 + Send_Sap_Bom.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(232,4): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(263,6): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(276,5): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(657,4): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(688,6): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(701,5): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(895,4): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(926,6): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(939,5): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(807,28): warning C4101: “revisions”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(1127,4): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(1158,6): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(1171,5): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(958,88): warning C4101: “bom_window_tag”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(1250,43): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_Bom.cpp(1343,17): warning C4244: “=”: 从“double”转换到“float”,可能丢失数据 + Send_Sap_material.cpp.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(120,39): warning C4267: “初始化”: 从“size_t”转换到“unsigned int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(125,10): warning C4477: “printf”: 格式字符串“%s”需要类型“char *”的参数,但可变参数 1 拥有了类型“std::string” +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(112,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(152,5): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(172,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(204,4): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(225,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(359,39): warning C4267: “初始化”: 从“size_t”转换到“unsigned int”,可能丢失数据 +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(364,10): warning C4477: “printf”: 格式字符串“%s”需要类型“char *”的参数,但可变参数 1 拥有了类型“std::string” +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(351,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(391,5): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(411,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(443,4): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. +D:\source\联德\itk\ld_itk(1)\connor_signature\Send_Sap_material.cpp.cpp(464,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. + SH_PLM_Email.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\SH_PLM_Email.cpp(95,30): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 + TEST.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\source\联德\itk\ld_itk(1)\connor_signature\TEST.cpp(76,52): warning C4101: “rootTask_tag”: 未引用的局部变量 +D:\source\联德\itk\ld_itk(1)\connor_signature\TEST.cpp(147,3): warning C4996: 'AOM_save': "AOM_save" deprecated in Teamcenter "11.2"; Use "AOM_save_with_extensions or AOM_save_without_extensions" instead. + UpgradeTask.cpp +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(806,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc13ITK\include\pom\pom\pom.h(5417,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + The contents of are available only with C++17 or later. + 正在创建库 D:\source\联德\itk\ld_itk(1)\x64\Release\ld_itk_c.lib 和对象 D:\source\联德\itk\ld_itk(1)\x64\Release\ld_itk_c.exp + 正在生成代码 + Previous IPDB not found, fall back to full compilation. +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_GYLXFrozen.cpp(194): warning C4715: “LD_GYLXFrozen”: 不是所有的控件路径都返回值 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_SendECRECN_ToSAPMES.cpp(839): warning C4715: “LD_SendECRECN_ToSAPMES”: 不是所有的控件路径都返回值 +D:\source\联德\itk\ld_itk(1)\connor_signature\LD_SendDJJDD_To_MES.cpp(297): warning C4715: “LD_SendDJJDD_To_MES”: 不是所有的控件路径都返回值 + All 1967 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. + 已完成代码的生成 + connor_signature.vcxproj -> D:\source\联德\itk\ld_itk(1)\x64\Release\ld_itk_c.dll diff --git a/connor_signature/x64/Release/connor_signature.tlog/CL.command.1.tlog b/connor_signature/x64/Release/connor_signature.tlog/CL.command.1.tlog new file mode 100644 index 0000000..e9ce065 Binary files /dev/null and b/connor_signature/x64/Release/connor_signature.tlog/CL.command.1.tlog differ diff --git a/connor_signature/x64/Release/connor_signature.tlog/CL.read.1.tlog b/connor_signature/x64/Release/connor_signature.tlog/CL.read.1.tlog new file mode 100644 index 0000000..a6c68f6 Binary files /dev/null and b/connor_signature/x64/Release/connor_signature.tlog/CL.read.1.tlog differ diff --git a/connor_signature/x64/Release/connor_signature.tlog/CL.write.1.tlog b/connor_signature/x64/Release/connor_signature.tlog/CL.write.1.tlog new file mode 100644 index 0000000..7ba76c6 Binary files /dev/null and b/connor_signature/x64/Release/connor_signature.tlog/CL.write.1.tlog differ diff --git a/connor_signature/x64/Release/connor_signature.tlog/connor_signature.lastbuildstate b/connor_signature/x64/Release/connor_signature.tlog/connor_signature.lastbuildstate new file mode 100644 index 0000000..3a432ea --- /dev/null +++ b/connor_signature/x64/Release/connor_signature.tlog/connor_signature.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1 +Release|x64|C:\Users\89512\Desktop\美菱\meling_itk\| diff --git a/connor_signature/x64/Release/connor_signature.tlog/connor_signature.write.1u.tlog b/connor_signature/x64/Release/connor_signature.tlog/connor_signature.write.1u.tlog new file mode 100644 index 0000000..fb5d860 Binary files /dev/null and b/connor_signature/x64/Release/connor_signature.tlog/connor_signature.write.1u.tlog differ diff --git a/connor_signature/x64/Release/connor_signature.tlog/link.command.1.tlog b/connor_signature/x64/Release/connor_signature.tlog/link.command.1.tlog new file mode 100644 index 0000000..3c90fa3 Binary files /dev/null and b/connor_signature/x64/Release/connor_signature.tlog/link.command.1.tlog differ diff --git a/connor_signature/x64/Release/connor_signature.tlog/link.read.1.tlog b/connor_signature/x64/Release/connor_signature.tlog/link.read.1.tlog new file mode 100644 index 0000000..71664f2 Binary files /dev/null and b/connor_signature/x64/Release/connor_signature.tlog/link.read.1.tlog differ diff --git a/connor_signature/x64/Release/connor_signature.tlog/link.write.1.tlog b/connor_signature/x64/Release/connor_signature.tlog/link.write.1.tlog new file mode 100644 index 0000000..4f398ee Binary files /dev/null and b/connor_signature/x64/Release/connor_signature.tlog/link.write.1.tlog differ diff --git a/connor_signature/x64/Release/connor_signature.vcxproj.FileListAbsolute.txt b/connor_signature/x64/Release/connor_signature.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/connor_signature/x64/Release/json_reader.obj b/connor_signature/x64/Release/json_reader.obj new file mode 100644 index 0000000..3296863 Binary files /dev/null and b/connor_signature/x64/Release/json_reader.obj differ diff --git a/connor_signature/x64/Release/json_value.obj b/connor_signature/x64/Release/json_value.obj new file mode 100644 index 0000000..ecb14b9 Binary files /dev/null and b/connor_signature/x64/Release/json_value.obj differ diff --git a/connor_signature/x64/Release/json_writer.obj b/connor_signature/x64/Release/json_writer.obj new file mode 100644 index 0000000..2fdd9f0 Binary files /dev/null and b/connor_signature/x64/Release/json_writer.obj differ diff --git a/connor_signature/x64/Release/kutil.obj b/connor_signature/x64/Release/kutil.obj new file mode 100644 index 0000000..5d618d2 Binary files /dev/null and b/connor_signature/x64/Release/kutil.obj differ diff --git a/connor_signature/x64/Release/ld_itk_c.Build.CppClean.log b/connor_signature/x64/Release/ld_itk_c.Build.CppClean.log new file mode 100644 index 0000000..ec1738f --- /dev/null +++ b/connor_signature/x64/Release/ld_itk_c.Build.CppClean.log @@ -0,0 +1,43 @@ +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\vc142.pdb +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ocilib.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_taskassignmentdate.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_sendecrecn_tosapmes.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_senddjjdd_to_mes.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_partcompflag.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_partchange.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_gylxfrozen.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_formattrtoexcel.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_completiondate.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_ecn01_setcicnformproperty.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_autoassign.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\connor_elevatetask.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\json_writer.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\json_value.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\json_reader.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\connor_review_person.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\connor_allow_workflow.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ado.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\addlb.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\a.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\upgradetask.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\test.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\sh_plm_email.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\send_sap_material.cpp.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\send_sap_bom.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\kutil.obj +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\raycus_itk.obj +d:\source\联德\itk\ld_itk(1)\x64\release\ld_itk_c.lib +d:\source\联德\itk\ld_itk(1)\x64\release\ld_itk_c.exp +d:\source\联德\itk\ld_itk(1)\x64\release\ld_itk_c.dll +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_itk_c.ipdb +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_itk_c.iobj +d:\source\联德\itk\ld_itk(1)\x64\release\ld_itk_c.pdb +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\msado15.tli +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\msado15.tlh +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_itk_c.tlog\cl.command.1.tlog +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_itk_c.tlog\cl.read.1.tlog +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_itk_c.tlog\cl.write.1.tlog +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_itk_c.tlog\ld_itk_c.write.1u.tlog +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_itk_c.tlog\link.command.1.tlog +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_itk_c.tlog\link.read.1.tlog +d:\source\联德\itk\ld_itk(1)\connor_signature\x64\release\ld_itk_c.tlog\link.write.1.tlog diff --git a/connor_signature/x64/Release/ld_itk_c.dll.recipe b/connor_signature/x64/Release/ld_itk_c.dll.recipe new file mode 100644 index 0000000..2e2b716 --- /dev/null +++ b/connor_signature/x64/Release/ld_itk_c.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\source\联德\itk\ld_itk(1)\x64\Release\ld_itk_c.dll + + + + + + \ No newline at end of file diff --git a/connor_signature/x64/Release/ld_itk_c.iobj b/connor_signature/x64/Release/ld_itk_c.iobj new file mode 100644 index 0000000..1c9c65d Binary files /dev/null and b/connor_signature/x64/Release/ld_itk_c.iobj differ diff --git a/connor_signature/x64/Release/ld_itk_c.ipdb b/connor_signature/x64/Release/ld_itk_c.ipdb new file mode 100644 index 0000000..8fc49b8 Binary files /dev/null and b/connor_signature/x64/Release/ld_itk_c.ipdb differ diff --git a/connor_signature/x64/Release/ld_itk_c.tlog/CL.command.1.tlog b/connor_signature/x64/Release/ld_itk_c.tlog/CL.command.1.tlog new file mode 100644 index 0000000..fcb5f58 Binary files /dev/null and b/connor_signature/x64/Release/ld_itk_c.tlog/CL.command.1.tlog differ diff --git a/connor_signature/x64/Release/ld_itk_c.tlog/CL.read.1.tlog b/connor_signature/x64/Release/ld_itk_c.tlog/CL.read.1.tlog new file mode 100644 index 0000000..1bbd929 Binary files /dev/null and b/connor_signature/x64/Release/ld_itk_c.tlog/CL.read.1.tlog differ diff --git a/connor_signature/x64/Release/ld_itk_c.tlog/CL.write.1.tlog b/connor_signature/x64/Release/ld_itk_c.tlog/CL.write.1.tlog new file mode 100644 index 0000000..27701ec Binary files /dev/null and b/connor_signature/x64/Release/ld_itk_c.tlog/CL.write.1.tlog differ diff --git a/connor_signature/x64/Release/ld_itk_c.tlog/ld_itk_c.lastbuildstate b/connor_signature/x64/Release/ld_itk_c.tlog/ld_itk_c.lastbuildstate new file mode 100644 index 0000000..049a798 --- /dev/null +++ b/connor_signature/x64/Release/ld_itk_c.tlog/ld_itk_c.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:TargetPlatformVersion=10.0.19041.0: +Release|x64|D:\source\联德\itk\ld_itk(1)\| diff --git a/connor_signature/x64/Release/ld_itk_c.tlog/ld_itk_c.write.1u.tlog b/connor_signature/x64/Release/ld_itk_c.tlog/ld_itk_c.write.1u.tlog new file mode 100644 index 0000000..6f82b68 Binary files /dev/null and b/connor_signature/x64/Release/ld_itk_c.tlog/ld_itk_c.write.1u.tlog differ diff --git a/connor_signature/x64/Release/ld_itk_c.tlog/link.command.1.tlog b/connor_signature/x64/Release/ld_itk_c.tlog/link.command.1.tlog new file mode 100644 index 0000000..1c646e5 Binary files /dev/null and b/connor_signature/x64/Release/ld_itk_c.tlog/link.command.1.tlog differ diff --git a/connor_signature/x64/Release/ld_itk_c.tlog/link.read.1.tlog b/connor_signature/x64/Release/ld_itk_c.tlog/link.read.1.tlog new file mode 100644 index 0000000..89f2cf5 Binary files /dev/null and b/connor_signature/x64/Release/ld_itk_c.tlog/link.read.1.tlog differ diff --git a/connor_signature/x64/Release/ld_itk_c.tlog/link.write.1.tlog b/connor_signature/x64/Release/ld_itk_c.tlog/link.write.1.tlog new file mode 100644 index 0000000..b8830bf Binary files /dev/null and b/connor_signature/x64/Release/ld_itk_c.tlog/link.write.1.tlog differ diff --git a/connor_signature/x64/Release/meling_itk.tlog/CL.command.1.tlog b/connor_signature/x64/Release/meling_itk.tlog/CL.command.1.tlog new file mode 100644 index 0000000..deeffb6 Binary files /dev/null and b/connor_signature/x64/Release/meling_itk.tlog/CL.command.1.tlog differ diff --git a/connor_signature/x64/Release/meling_itk.tlog/CL.read.1.tlog b/connor_signature/x64/Release/meling_itk.tlog/CL.read.1.tlog new file mode 100644 index 0000000..01f8551 Binary files /dev/null and b/connor_signature/x64/Release/meling_itk.tlog/CL.read.1.tlog differ diff --git a/connor_signature/x64/Release/meling_itk.tlog/CL.write.1.tlog b/connor_signature/x64/Release/meling_itk.tlog/CL.write.1.tlog new file mode 100644 index 0000000..391b28f Binary files /dev/null and b/connor_signature/x64/Release/meling_itk.tlog/CL.write.1.tlog differ diff --git a/connor_signature/x64/Release/meling_itk.tlog/link.command.1.tlog b/connor_signature/x64/Release/meling_itk.tlog/link.command.1.tlog new file mode 100644 index 0000000..bf64c83 Binary files /dev/null and b/connor_signature/x64/Release/meling_itk.tlog/link.command.1.tlog differ diff --git a/connor_signature/x64/Release/meling_itk.tlog/link.read.1.tlog b/connor_signature/x64/Release/meling_itk.tlog/link.read.1.tlog new file mode 100644 index 0000000..c45b4ac Binary files /dev/null and b/connor_signature/x64/Release/meling_itk.tlog/link.read.1.tlog differ diff --git a/connor_signature/x64/Release/meling_itk.tlog/link.write.1.tlog b/connor_signature/x64/Release/meling_itk.tlog/link.write.1.tlog new file mode 100644 index 0000000..27d9c8e Binary files /dev/null and b/connor_signature/x64/Release/meling_itk.tlog/link.write.1.tlog differ diff --git a/connor_signature/x64/Release/meling_itk.tlog/meling_itk.lastbuildstate b/connor_signature/x64/Release/meling_itk.tlog/meling_itk.lastbuildstate new file mode 100644 index 0000000..3a432ea --- /dev/null +++ b/connor_signature/x64/Release/meling_itk.tlog/meling_itk.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1 +Release|x64|C:\Users\89512\Desktop\美菱\meling_itk\| diff --git a/connor_signature/x64/Release/meling_itk.tlog/meling_itk.write.1u.tlog b/connor_signature/x64/Release/meling_itk.tlog/meling_itk.write.1u.tlog new file mode 100644 index 0000000..a09f3aa Binary files /dev/null and b/connor_signature/x64/Release/meling_itk.tlog/meling_itk.write.1u.tlog differ diff --git a/connor_signature/x64/Release/msado15.tlh b/connor_signature/x64/Release/msado15.tlh new file mode 100644 index 0000000..7ce12bf --- /dev/null +++ b/connor_signature/x64/Release/msado15.tlh @@ -0,0 +1,5027 @@ +// Created by Microsoft (R) C/C++ Compiler Version 14.29.30151.0 (073fa26b). +// +// D:\source\联德\itk\ld_itk(1)\connor_signature\x64\Release\msado15.tlh +// +// C++ source equivalent of type library C:/Program Files/Common Files/System/ado/msado15.dll +// compiler-generated file created 01/13/25 at 10:58:00 - DO NOT EDIT! + +#pragma once +#pragma pack(push, 8) + +#include + +// +// Forward references and typedefs +// + +struct __declspec(uuid("b691e011-1797-432e-907a-4d8c69339129")) +/* LIBID */ __ADODB; +enum CursorTypeEnum; +enum CursorOptionEnum; +enum LockTypeEnum; +enum ExecuteOptionEnum; +enum ConnectOptionEnum; +enum ObjectStateEnum; +enum CursorLocationEnum; +enum DataTypeEnum; +enum FieldAttributeEnum; +enum EditModeEnum; +enum RecordStatusEnum; +enum GetRowsOptionEnum; +enum PositionEnum; +enum BookmarkEnum; +enum MarshalOptionsEnum; +enum AffectEnum; +enum ResyncEnum; +enum CompareEnum; +enum FilterGroupEnum; +enum SearchDirectionEnum; +enum PersistFormatEnum; +enum StringFormatEnum; +enum ConnectPromptEnum; +enum ConnectModeEnum; +enum RecordCreateOptionsEnum; +enum RecordOpenOptionsEnum; +enum IsolationLevelEnum; +enum XactAttributeEnum; +enum PropertyAttributesEnum; +enum ErrorValueEnum; +enum ParameterAttributesEnum; +enum ParameterDirectionEnum; +enum CommandTypeEnum; +enum EventStatusEnum; +enum EventReasonEnum; +enum SchemaEnum; +enum FieldStatusEnum; +enum SeekEnum; +enum ADCPROP_UPDATECRITERIA_ENUM; +enum ADCPROP_ASYNCTHREADPRIORITY_ENUM; +enum ADCPROP_AUTORECALC_ENUM; +enum ADCPROP_UPDATERESYNC_ENUM; +enum MoveRecordOptionsEnum; +enum CopyRecordOptionsEnum; +enum StreamTypeEnum; +enum LineSeparatorEnum; +enum StreamOpenOptionsEnum; +enum StreamWriteEnum; +enum SaveOptionsEnum; +enum FieldEnum; +enum StreamReadEnum; +enum RecordTypeEnum; +struct __declspec(uuid("00000512-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Collection; +struct __declspec(uuid("00000513-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _DynaCollection; +struct __declspec(uuid("00000534-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _ADO; +struct __declspec(uuid("00000504-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Properties; +struct __declspec(uuid("00000503-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Property; +struct __declspec(uuid("00000500-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Error; +struct __declspec(uuid("00000501-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Errors; +struct __declspec(uuid("00001508-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command15; +struct __declspec(uuid("00001550-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Connection; +struct __declspec(uuid("00001515-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Connection15; +struct __declspec(uuid("00001556-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Recordset; +struct __declspec(uuid("00001555-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset21; +struct __declspec(uuid("0000154f-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset20; +struct __declspec(uuid("0000150e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset15; +struct __declspec(uuid("00001564-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields; +struct __declspec(uuid("0000154d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields20; +struct __declspec(uuid("00001506-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields15; +struct __declspec(uuid("00001569-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field; +struct __declspec(uuid("0000154c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field20; +struct __declspec(uuid("0000150c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Parameter; +struct __declspec(uuid("0000150d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Parameters; +struct __declspec(uuid("0000154e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command25; +struct __declspec(uuid("986761e8-7269-4890-aa65-ad7c03697a6d")) +/* dual interface */ _Command; +struct __declspec(uuid("00001402-0000-0010-8000-00aa006d2ea4")) +/* interface */ ConnectionEventsVt; +struct __declspec(uuid("00001403-0000-0010-8000-00aa006d2ea4")) +/* interface */ RecordsetEventsVt; +struct __declspec(uuid("00001400-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ ConnectionEvents; +struct __declspec(uuid("00001266-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ RecordsetEvents; +struct __declspec(uuid("00000516-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOConnectionConstruction15; +struct __declspec(uuid("00000551-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOConnectionConstruction; +struct /* coclass */ Connection; +struct __declspec(uuid("00001562-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Record; +struct /* coclass */ Record; +struct __declspec(uuid("00001565-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Stream; +struct /* coclass */ Stream; +struct __declspec(uuid("00000567-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADORecordConstruction; +struct __declspec(uuid("00000568-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOStreamConstruction; +struct __declspec(uuid("00000517-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOCommandConstruction; +struct /* coclass */ Command; +struct /* coclass */ Recordset; +struct __declspec(uuid("00000283-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADORecordsetConstruction; +struct __declspec(uuid("00001505-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field15; +struct /* coclass */ Parameter; +struct __declspec(uuid("00000402-0000-0010-8000-00aa006d2ea4")) +/* interface */ ConnectionEventsVt_Deprecated; +struct __declspec(uuid("00000550-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Connection_Deprecated; +struct __declspec(uuid("00000515-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Connection15_Deprecated; +struct __declspec(uuid("00000556-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Recordset_Deprecated; +struct __declspec(uuid("00000555-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset21_Deprecated; +struct __declspec(uuid("0000054f-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset20_Deprecated; +struct __declspec(uuid("0000050e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset15_Deprecated; +struct __declspec(uuid("00000564-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields_Deprecated; +struct __declspec(uuid("0000054d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields20_Deprecated; +struct __declspec(uuid("00000506-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields15_Deprecated; +struct __declspec(uuid("00000569-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field_Deprecated; +struct __declspec(uuid("0000054c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field20_Deprecated; +struct __declspec(uuid("b08400bd-f9d1-4d02-b856-71d5dba123e9")) +/* dual interface */ _Command_Deprecated; +struct __declspec(uuid("0000054e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command25_Deprecated; +struct __declspec(uuid("00000508-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command15_Deprecated; +struct __declspec(uuid("0000050c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Parameter_Deprecated; +struct __declspec(uuid("0000050d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Parameters_Deprecated; +struct __declspec(uuid("00000403-0000-0010-8000-00aa006d2ea4")) +/* interface */ RecordsetEventsVt_Deprecated; +struct __declspec(uuid("00000400-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ ConnectionEvents_Deprecated; +struct __declspec(uuid("00000266-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ RecordsetEvents_Deprecated; +struct __declspec(uuid("00000562-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Record_Deprecated; +struct __declspec(uuid("00000565-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Stream_Deprecated; +struct __declspec(uuid("00000505-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field15_Deprecated; +typedef __int64 PositionEnum_Param; +typedef enum SearchDirectionEnum SearchDirection; +typedef __int64 ADO_LONGPTR; + +// +// Smart pointer typedef declarations +// + +_COM_SMARTPTR_TYPEDEF(_Collection, __uuidof(_Collection)); +_COM_SMARTPTR_TYPEDEF(_DynaCollection, __uuidof(_DynaCollection)); +_COM_SMARTPTR_TYPEDEF(Property, __uuidof(Property)); +_COM_SMARTPTR_TYPEDEF(Properties, __uuidof(Properties)); +_COM_SMARTPTR_TYPEDEF(_ADO, __uuidof(_ADO)); +_COM_SMARTPTR_TYPEDEF(Error, __uuidof(Error)); +_COM_SMARTPTR_TYPEDEF(Errors, __uuidof(Errors)); +_COM_SMARTPTR_TYPEDEF(Field20, __uuidof(Field20)); +_COM_SMARTPTR_TYPEDEF(Field, __uuidof(Field)); +_COM_SMARTPTR_TYPEDEF(Fields15, __uuidof(Fields15)); +_COM_SMARTPTR_TYPEDEF(Fields20, __uuidof(Fields20)); +_COM_SMARTPTR_TYPEDEF(Fields, __uuidof(Fields)); +_COM_SMARTPTR_TYPEDEF(_Parameter, __uuidof(_Parameter)); +_COM_SMARTPTR_TYPEDEF(Parameters, __uuidof(Parameters)); +_COM_SMARTPTR_TYPEDEF(ConnectionEvents, __uuidof(ConnectionEvents)); +_COM_SMARTPTR_TYPEDEF(RecordsetEvents, __uuidof(RecordsetEvents)); +_COM_SMARTPTR_TYPEDEF(ADOConnectionConstruction15, __uuidof(ADOConnectionConstruction15)); +_COM_SMARTPTR_TYPEDEF(ADOConnectionConstruction, __uuidof(ADOConnectionConstruction)); +_COM_SMARTPTR_TYPEDEF(_Stream, __uuidof(_Stream)); +_COM_SMARTPTR_TYPEDEF(ADORecordConstruction, __uuidof(ADORecordConstruction)); +_COM_SMARTPTR_TYPEDEF(ADOStreamConstruction, __uuidof(ADOStreamConstruction)); +_COM_SMARTPTR_TYPEDEF(ADOCommandConstruction, __uuidof(ADOCommandConstruction)); +_COM_SMARTPTR_TYPEDEF(ADORecordsetConstruction, __uuidof(ADORecordsetConstruction)); +_COM_SMARTPTR_TYPEDEF(Field15, __uuidof(Field15)); +_COM_SMARTPTR_TYPEDEF(Field20_Deprecated, __uuidof(Field20_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Field_Deprecated, __uuidof(Field_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Fields15_Deprecated, __uuidof(Fields15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Fields20_Deprecated, __uuidof(Fields20_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Fields_Deprecated, __uuidof(Fields_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Parameter_Deprecated, __uuidof(_Parameter_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Parameters_Deprecated, __uuidof(Parameters_Deprecated)); +_COM_SMARTPTR_TYPEDEF(ConnectionEvents_Deprecated, __uuidof(ConnectionEvents_Deprecated)); +_COM_SMARTPTR_TYPEDEF(RecordsetEvents_Deprecated, __uuidof(RecordsetEvents_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Stream_Deprecated, __uuidof(_Stream_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Field15_Deprecated, __uuidof(Field15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Command15, __uuidof(Command15)); +_COM_SMARTPTR_TYPEDEF(Command25, __uuidof(Command25)); +_COM_SMARTPTR_TYPEDEF(_Command, __uuidof(_Command)); +_COM_SMARTPTR_TYPEDEF(Connection15, __uuidof(Connection15)); +_COM_SMARTPTR_TYPEDEF(_Connection, __uuidof(_Connection)); +_COM_SMARTPTR_TYPEDEF(Recordset15, __uuidof(Recordset15)); +_COM_SMARTPTR_TYPEDEF(Recordset20, __uuidof(Recordset20)); +_COM_SMARTPTR_TYPEDEF(Recordset21, __uuidof(Recordset21)); +_COM_SMARTPTR_TYPEDEF(_Recordset, __uuidof(_Recordset)); +_COM_SMARTPTR_TYPEDEF(ConnectionEventsVt, __uuidof(ConnectionEventsVt)); +_COM_SMARTPTR_TYPEDEF(RecordsetEventsVt, __uuidof(RecordsetEventsVt)); +_COM_SMARTPTR_TYPEDEF(_Record, __uuidof(_Record)); +_COM_SMARTPTR_TYPEDEF(ConnectionEventsVt_Deprecated, __uuidof(ConnectionEventsVt_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Connection15_Deprecated, __uuidof(Connection15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Connection_Deprecated, __uuidof(_Connection_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Recordset15_Deprecated, __uuidof(Recordset15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Recordset20_Deprecated, __uuidof(Recordset20_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Recordset21_Deprecated, __uuidof(Recordset21_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Recordset_Deprecated, __uuidof(_Recordset_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Command15_Deprecated, __uuidof(Command15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Command25_Deprecated, __uuidof(Command25_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Command_Deprecated, __uuidof(_Command_Deprecated)); +_COM_SMARTPTR_TYPEDEF(RecordsetEventsVt_Deprecated, __uuidof(RecordsetEventsVt_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Record_Deprecated, __uuidof(_Record_Deprecated)); + +// +// Type library items +// + +enum __declspec(uuid("0000051b-0000-0010-8000-00aa006d2ea4")) +CursorTypeEnum +{ + adOpenUnspecified = -1, + adOpenForwardOnly = 0, + adOpenKeyset = 1, + adOpenDynamic = 2, + adOpenStatic = 3 +}; + +enum __declspec(uuid("0000051c-0000-0010-8000-00aa006d2ea4")) +CursorOptionEnum +{ + adHoldRecords = 256, + adMovePrevious = 512, + adAddNew = 16778240, + adDelete = 16779264, + adUpdate = 16809984, + adBookmark = 8192, + adApproxPosition = 16384, + adUpdateBatch = 65536, + adResync = 131072, + adNotify = 262144, + adFind = 524288, + adSeek = 4194304, + adIndex = 8388608 +}; + +enum __declspec(uuid("0000051d-0000-0010-8000-00aa006d2ea4")) +LockTypeEnum +{ + adLockUnspecified = -1, + adLockReadOnly = 1, + adLockPessimistic = 2, + adLockOptimistic = 3, + adLockBatchOptimistic = 4 +}; + +enum __declspec(uuid("0000051e-0000-0010-8000-00aa006d2ea4")) +ExecuteOptionEnum +{ + adOptionUnspecified = -1, + adAsyncExecute = 16, + adAsyncFetch = 32, + adAsyncFetchNonBlocking = 64, + adExecuteNoRecords = 128, + adExecuteStream = 1024, + adExecuteRecord = 2048 +}; + +enum __declspec(uuid("00000541-0000-0010-8000-00aa006d2ea4")) +ConnectOptionEnum +{ + adConnectUnspecified = -1, + adAsyncConnect = 16 +}; + +enum __declspec(uuid("00000532-0000-0010-8000-00aa006d2ea4")) +ObjectStateEnum +{ + adStateClosed = 0, + adStateOpen = 1, + adStateConnecting = 2, + adStateExecuting = 4, + adStateFetching = 8 +}; + +enum __declspec(uuid("0000052f-0000-0010-8000-00aa006d2ea4")) +CursorLocationEnum +{ + adUseNone = 1, + adUseServer = 2, + adUseClient = 3, + adUseClientBatch = 3 +}; + +enum __declspec(uuid("0000051f-0000-0010-8000-00aa006d2ea4")) +DataTypeEnum +{ + adEmpty = 0, + adTinyInt = 16, + adSmallInt = 2, + adInteger = 3, + adBigInt = 20, + adUnsignedTinyInt = 17, + adUnsignedSmallInt = 18, + adUnsignedInt = 19, + adUnsignedBigInt = 21, + adSingle = 4, + adDouble = 5, + adCurrency = 6, + adDecimal = 14, + adNumeric = 131, + adBoolean = 11, + adError = 10, + adUserDefined = 132, + adVariant = 12, + adIDispatch = 9, + adIUnknown = 13, + adGUID = 72, + adDate = 7, + adDBDate = 133, + adDBTime = 134, + adDBTimeStamp = 135, + adBSTR = 8, + adChar = 129, + adVarChar = 200, + adLongVarChar = 201, + adWChar = 130, + adVarWChar = 202, + adLongVarWChar = 203, + adBinary = 128, + adVarBinary = 204, + adLongVarBinary = 205, + adChapter = 136, + adFileTime = 64, + adPropVariant = 138, + adVarNumeric = 139, + adArray = 8192 +}; + +enum __declspec(uuid("00000525-0000-0010-8000-00aa006d2ea4")) +FieldAttributeEnum +{ + adFldUnspecified = -1, + adFldMayDefer = 2, + adFldUpdatable = 4, + adFldUnknownUpdatable = 8, + adFldFixed = 16, + adFldIsNullable = 32, + adFldMayBeNull = 64, + adFldLong = 128, + adFldRowID = 256, + adFldRowVersion = 512, + adFldCacheDeferred = 4096, + adFldIsChapter = 8192, + adFldNegativeScale = 16384, + adFldKeyColumn = 32768, + adFldIsRowURL = 65536, + adFldIsDefaultStream = 131072, + adFldIsCollection = 262144 +}; + +enum __declspec(uuid("00000526-0000-0010-8000-00aa006d2ea4")) +EditModeEnum +{ + adEditNone = 0, + adEditInProgress = 1, + adEditAdd = 2, + adEditDelete = 4 +}; + +enum __declspec(uuid("00000527-0000-0010-8000-00aa006d2ea4")) +RecordStatusEnum +{ + adRecOK = 0, + adRecNew = 1, + adRecModified = 2, + adRecDeleted = 4, + adRecUnmodified = 8, + adRecInvalid = 16, + adRecMultipleChanges = 64, + adRecPendingChanges = 128, + adRecCanceled = 256, + adRecCantRelease = 1024, + adRecConcurrencyViolation = 2048, + adRecIntegrityViolation = 4096, + adRecMaxChangesExceeded = 8192, + adRecObjectOpen = 16384, + adRecOutOfMemory = 32768, + adRecPermissionDenied = 65536, + adRecSchemaViolation = 131072, + adRecDBDeleted = 262144 +}; + +enum __declspec(uuid("00000542-0000-0010-8000-00aa006d2ea4")) +GetRowsOptionEnum +{ + adGetRowsRest = -1 +}; + +enum __declspec(uuid("00000528-0000-0010-8000-00aa006d2ea4")) +PositionEnum +{ + adPosUnknown = -1, + adPosBOF = -2, + adPosEOF = -3 +}; + +enum BookmarkEnum +{ + adBookmarkCurrent = 0, + adBookmarkFirst = 1, + adBookmarkLast = 2 +}; + +enum __declspec(uuid("00000540-0000-0010-8000-00aa006d2ea4")) +MarshalOptionsEnum +{ + adMarshalAll = 0, + adMarshalModifiedOnly = 1 +}; + +enum __declspec(uuid("00000543-0000-0010-8000-00aa006d2ea4")) +AffectEnum +{ + adAffectCurrent = 1, + adAffectGroup = 2, + adAffectAll = 3, + adAffectAllChapters = 4 +}; + +enum __declspec(uuid("00000544-0000-0010-8000-00aa006d2ea4")) +ResyncEnum +{ + adResyncUnderlyingValues = 1, + adResyncAllValues = 2 +}; + +enum __declspec(uuid("00000545-0000-0010-8000-00aa006d2ea4")) +CompareEnum +{ + adCompareLessThan = 0, + adCompareEqual = 1, + adCompareGreaterThan = 2, + adCompareNotEqual = 3, + adCompareNotComparable = 4 +}; + +enum __declspec(uuid("00000546-0000-0010-8000-00aa006d2ea4")) +FilterGroupEnum +{ + adFilterNone = 0, + adFilterPendingRecords = 1, + adFilterAffectedRecords = 2, + adFilterFetchedRecords = 3, + adFilterPredicate = 4, + adFilterConflictingRecords = 5 +}; + +enum __declspec(uuid("00000547-0000-0010-8000-00aa006d2ea4")) +SearchDirectionEnum +{ + adSearchForward = 1, + adSearchBackward = -1 +}; + +enum __declspec(uuid("00000548-0000-0010-8000-00aa006d2ea4")) +PersistFormatEnum +{ + adPersistADTG = 0, + adPersistXML = 1 +}; + +enum __declspec(uuid("00000549-0000-0010-8000-00aa006d2ea4")) +StringFormatEnum +{ + adClipString = 2 +}; + +enum __declspec(uuid("00000520-0000-0010-8000-00aa006d2ea4")) +ConnectPromptEnum +{ + adPromptAlways = 1, + adPromptComplete = 2, + adPromptCompleteRequired = 3, + adPromptNever = 4 +}; + +enum __declspec(uuid("00000521-0000-0010-8000-00aa006d2ea4")) +ConnectModeEnum +{ + adModeUnknown = 0, + adModeRead = 1, + adModeWrite = 2, + adModeReadWrite = 3, + adModeShareDenyRead = 4, + adModeShareDenyWrite = 8, + adModeShareExclusive = 12, + adModeShareDenyNone = 16, + adModeRecursive = 4194304 +}; + +enum __declspec(uuid("00000570-0000-0010-8000-00aa006d2ea4")) +RecordCreateOptionsEnum +{ + adCreateCollection = 8192, + adCreateStructDoc = 0x80000000, + adCreateNonCollection = 0, + adOpenIfExists = 33554432, + adCreateOverwrite = 67108864, + adFailIfNotExists = -1 +}; + +enum __declspec(uuid("00000571-0000-0010-8000-00aa006d2ea4")) +RecordOpenOptionsEnum +{ + adOpenRecordUnspecified = -1, + adOpenSource = 8388608, + adOpenOutput = 8388608, + adOpenAsync = 4096, + adDelayFetchStream = 16384, + adDelayFetchFields = 32768, + adOpenExecuteCommand = 65536 +}; + +enum __declspec(uuid("00000523-0000-0010-8000-00aa006d2ea4")) +IsolationLevelEnum +{ + adXactUnspecified = -1, + adXactChaos = 16, + adXactReadUncommitted = 256, + adXactBrowse = 256, + adXactCursorStability = 4096, + adXactReadCommitted = 4096, + adXactRepeatableRead = 65536, + adXactSerializable = 1048576, + adXactIsolated = 1048576 +}; + +enum __declspec(uuid("00000524-0000-0010-8000-00aa006d2ea4")) +XactAttributeEnum +{ + adXactCommitRetaining = 131072, + adXactAbortRetaining = 262144, + adXactAsyncPhaseOne = 524288, + adXactSyncPhaseOne = 1048576 +}; + +enum __declspec(uuid("00000529-0000-0010-8000-00aa006d2ea4")) +PropertyAttributesEnum +{ + adPropNotSupported = 0, + adPropRequired = 1, + adPropOptional = 2, + adPropRead = 512, + adPropWrite = 1024 +}; + +enum __declspec(uuid("0000052a-0000-0010-8000-00aa006d2ea4")) +ErrorValueEnum +{ + adErrProviderFailed = 3000, + adErrInvalidArgument = 3001, + adErrOpeningFile = 3002, + adErrReadFile = 3003, + adErrWriteFile = 3004, + adErrNoCurrentRecord = 3021, + adErrIllegalOperation = 3219, + adErrCantChangeProvider = 3220, + adErrInTransaction = 3246, + adErrFeatureNotAvailable = 3251, + adErrItemNotFound = 3265, + adErrObjectInCollection = 3367, + adErrObjectNotSet = 3420, + adErrDataConversion = 3421, + adErrObjectClosed = 3704, + adErrObjectOpen = 3705, + adErrProviderNotFound = 3706, + adErrBoundToCommand = 3707, + adErrInvalidParamInfo = 3708, + adErrInvalidConnection = 3709, + adErrNotReentrant = 3710, + adErrStillExecuting = 3711, + adErrOperationCancelled = 3712, + adErrStillConnecting = 3713, + adErrInvalidTransaction = 3714, + adErrNotExecuting = 3715, + adErrUnsafeOperation = 3716, + adwrnSecurityDialog = 3717, + adwrnSecurityDialogHeader = 3718, + adErrIntegrityViolation = 3719, + adErrPermissionDenied = 3720, + adErrDataOverflow = 3721, + adErrSchemaViolation = 3722, + adErrSignMismatch = 3723, + adErrCantConvertvalue = 3724, + adErrCantCreate = 3725, + adErrColumnNotOnThisRow = 3726, + adErrURLDoesNotExist = 3727, + adErrTreePermissionDenied = 3728, + adErrInvalidURL = 3729, + adErrResourceLocked = 3730, + adErrResourceExists = 3731, + adErrCannotComplete = 3732, + adErrVolumeNotFound = 3733, + adErrOutOfSpace = 3734, + adErrResourceOutOfScope = 3735, + adErrUnavailable = 3736, + adErrURLNamedRowDoesNotExist = 3737, + adErrDelResOutOfScope = 3738, + adErrPropInvalidColumn = 3739, + adErrPropInvalidOption = 3740, + adErrPropInvalidValue = 3741, + adErrPropConflicting = 3742, + adErrPropNotAllSettable = 3743, + adErrPropNotSet = 3744, + adErrPropNotSettable = 3745, + adErrPropNotSupported = 3746, + adErrCatalogNotSet = 3747, + adErrCantChangeConnection = 3748, + adErrFieldsUpdateFailed = 3749, + adErrDenyNotSupported = 3750, + adErrDenyTypeNotSupported = 3751, + adErrProviderNotSpecified = 3753, + adErrConnectionStringTooLong = 3754 +}; + +enum __declspec(uuid("0000052b-0000-0010-8000-00aa006d2ea4")) +ParameterAttributesEnum +{ + adParamSigned = 16, + adParamNullable = 64, + adParamLong = 128 +}; + +enum __declspec(uuid("0000052c-0000-0010-8000-00aa006d2ea4")) +ParameterDirectionEnum +{ + adParamUnknown = 0, + adParamInput = 1, + adParamOutput = 2, + adParamInputOutput = 3, + adParamReturnValue = 4 +}; + +enum __declspec(uuid("0000052e-0000-0010-8000-00aa006d2ea4")) +CommandTypeEnum +{ + adCmdUnspecified = -1, + adCmdUnknown = 8, + adCmdText = 1, + adCmdTable = 2, + adCmdStoredProc = 4, + adCmdFile = 256, + adCmdTableDirect = 512 +}; + +enum __declspec(uuid("00000530-0000-0010-8000-00aa006d2ea4")) +EventStatusEnum +{ + adStatusOK = 1, + adStatusErrorsOccurred = 2, + adStatusCantDeny = 3, + adStatusCancel = 4, + adStatusUnwantedEvent = 5 +}; + +enum __declspec(uuid("00000531-0000-0010-8000-00aa006d2ea4")) +EventReasonEnum +{ + adRsnAddNew = 1, + adRsnDelete = 2, + adRsnUpdate = 3, + adRsnUndoUpdate = 4, + adRsnUndoAddNew = 5, + adRsnUndoDelete = 6, + adRsnRequery = 7, + adRsnResynch = 8, + adRsnClose = 9, + adRsnMove = 10, + adRsnFirstChange = 11, + adRsnMoveFirst = 12, + adRsnMoveNext = 13, + adRsnMovePrevious = 14, + adRsnMoveLast = 15 +}; + +enum __declspec(uuid("00000533-0000-0010-8000-00aa006d2ea4")) +SchemaEnum +{ + adSchemaProviderSpecific = -1, + adSchemaAsserts = 0, + adSchemaCatalogs = 1, + adSchemaCharacterSets = 2, + adSchemaCollations = 3, + adSchemaColumns = 4, + adSchemaCheckConstraints = 5, + adSchemaConstraintColumnUsage = 6, + adSchemaConstraintTableUsage = 7, + adSchemaKeyColumnUsage = 8, + adSchemaReferentialContraints = 9, + adSchemaReferentialConstraints = 9, + adSchemaTableConstraints = 10, + adSchemaColumnsDomainUsage = 11, + adSchemaIndexes = 12, + adSchemaColumnPrivileges = 13, + adSchemaTablePrivileges = 14, + adSchemaUsagePrivileges = 15, + adSchemaProcedures = 16, + adSchemaSchemata = 17, + adSchemaSQLLanguages = 18, + adSchemaStatistics = 19, + adSchemaTables = 20, + adSchemaTranslations = 21, + adSchemaProviderTypes = 22, + adSchemaViews = 23, + adSchemaViewColumnUsage = 24, + adSchemaViewTableUsage = 25, + adSchemaProcedureParameters = 26, + adSchemaForeignKeys = 27, + adSchemaPrimaryKeys = 28, + adSchemaProcedureColumns = 29, + adSchemaDBInfoKeywords = 30, + adSchemaDBInfoLiterals = 31, + adSchemaCubes = 32, + adSchemaDimensions = 33, + adSchemaHierarchies = 34, + adSchemaLevels = 35, + adSchemaMeasures = 36, + adSchemaProperties = 37, + adSchemaMembers = 38, + adSchemaTrustees = 39, + adSchemaFunctions = 40, + adSchemaActions = 41, + adSchemaCommands = 42, + adSchemaSets = 43 +}; + +enum __declspec(uuid("0000057e-0000-0010-8000-00aa006d2ea4")) +FieldStatusEnum +{ + adFieldOK = 0, + adFieldCantConvertValue = 2, + adFieldIsNull = 3, + adFieldTruncated = 4, + adFieldSignMismatch = 5, + adFieldDataOverflow = 6, + adFieldCantCreate = 7, + adFieldUnavailable = 8, + adFieldPermissionDenied = 9, + adFieldIntegrityViolation = 10, + adFieldSchemaViolation = 11, + adFieldBadStatus = 12, + adFieldDefault = 13, + adFieldIgnore = 15, + adFieldDoesNotExist = 16, + adFieldInvalidURL = 17, + adFieldResourceLocked = 18, + adFieldResourceExists = 19, + adFieldCannotComplete = 20, + adFieldVolumeNotFound = 21, + adFieldOutOfSpace = 22, + adFieldCannotDeleteSource = 23, + adFieldReadOnly = 24, + adFieldResourceOutOfScope = 25, + adFieldAlreadyExists = 26, + adFieldPendingInsert = 65536, + adFieldPendingDelete = 131072, + adFieldPendingChange = 262144, + adFieldPendingUnknown = 524288, + adFieldPendingUnknownDelete = 1048576 +}; + +enum __declspec(uuid("00000552-0000-0010-8000-00aa006d2ea4")) +SeekEnum +{ + adSeekFirstEQ = 1, + adSeekLastEQ = 2, + adSeekAfterEQ = 4, + adSeekAfter = 8, + adSeekBeforeEQ = 16, + adSeekBefore = 32 +}; + +enum __declspec(uuid("0000054a-0000-0010-8000-00aa006d2ea4")) +ADCPROP_UPDATECRITERIA_ENUM +{ + adCriteriaKey = 0, + adCriteriaAllCols = 1, + adCriteriaUpdCols = 2, + adCriteriaTimeStamp = 3 +}; + +enum __declspec(uuid("0000054b-0000-0010-8000-00aa006d2ea4")) +ADCPROP_ASYNCTHREADPRIORITY_ENUM +{ + adPriorityLowest = 1, + adPriorityBelowNormal = 2, + adPriorityNormal = 3, + adPriorityAboveNormal = 4, + adPriorityHighest = 5 +}; + +enum __declspec(uuid("00000554-0000-0010-8000-00aa006d2ea4")) +ADCPROP_AUTORECALC_ENUM +{ + adRecalcUpFront = 0, + adRecalcAlways = 1 +}; + +enum __declspec(uuid("00000553-0000-0010-8000-00aa006d2ea4")) +ADCPROP_UPDATERESYNC_ENUM +{ + adResyncNone = 0, + adResyncAutoIncrement = 1, + adResyncConflicts = 2, + adResyncUpdates = 4, + adResyncInserts = 8, + adResyncAll = 15 +}; + +enum __declspec(uuid("00000573-0000-0010-8000-00aa006d2ea4")) +MoveRecordOptionsEnum +{ + adMoveUnspecified = -1, + adMoveOverWrite = 1, + adMoveDontUpdateLinks = 2, + adMoveAllowEmulation = 4 +}; + +enum __declspec(uuid("00000574-0000-0010-8000-00aa006d2ea4")) +CopyRecordOptionsEnum +{ + adCopyUnspecified = -1, + adCopyOverWrite = 1, + adCopyAllowEmulation = 4, + adCopyNonRecursive = 2 +}; + +enum __declspec(uuid("00000576-0000-0010-8000-00aa006d2ea4")) +StreamTypeEnum +{ + adTypeBinary = 1, + adTypeText = 2 +}; + +enum __declspec(uuid("00000577-0000-0010-8000-00aa006d2ea4")) +LineSeparatorEnum +{ + adLF = 10, + adCR = 13, + adCRLF = -1 +}; + +enum __declspec(uuid("0000057a-0000-0010-8000-00aa006d2ea4")) +StreamOpenOptionsEnum +{ + adOpenStreamUnspecified = -1, + adOpenStreamAsync = 1, + adOpenStreamFromRecord = 4 +}; + +enum __declspec(uuid("0000057b-0000-0010-8000-00aa006d2ea4")) +StreamWriteEnum +{ + adWriteChar = 0, + adWriteLine = 1, + stWriteChar = 0, + stWriteLine = 1 +}; + +enum __declspec(uuid("0000057c-0000-0010-8000-00aa006d2ea4")) +SaveOptionsEnum +{ + adSaveCreateNotExist = 1, + adSaveCreateOverWrite = 2 +}; + +enum FieldEnum +{ + adDefaultStream = -1, + adRecordURL = -2 +}; + +enum StreamReadEnum +{ + adReadAll = -1, + adReadLine = -2 +}; + +enum __declspec(uuid("0000057d-0000-0010-8000-00aa006d2ea4")) +RecordTypeEnum +{ + adSimpleRecord = 0, + adCollectionRecord = 1, + adStructDoc = 2 +}; + +struct __declspec(uuid("00000512-0000-0010-8000-00aa006d2ea4")) +_Collection : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetCount)) + long Count; + + // + // Wrapper methods for error-handling + // + + long GetCount ( ); + IUnknownPtr _NewEnum ( ); + HRESULT Refresh ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Count ( + /*[out,retval]*/ long * c ) = 0; + virtual HRESULT __stdcall raw__NewEnum ( + /*[out,retval]*/ IUnknown * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Refresh ( ) = 0; +}; + +struct __declspec(uuid("00000513-0000-0010-8000-00aa006d2ea4")) +_DynaCollection : _Collection +{ + // + // Wrapper methods for error-handling + // + + HRESULT Append ( + IDispatch * Object ); + HRESULT Delete ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Append ( + /*[in]*/ IDispatch * Object ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ VARIANT Index ) = 0; +}; + +struct __declspec(uuid("00000503-0000-0010-8000-00aa006d2ea4")) +Property : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType)) + enum DataTypeEnum Type; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pval ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + long GetAttributes ( ); + void PutAttributes ( + long plAttributes ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pval ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pval ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plAttributes ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plAttributes ) = 0; +}; + +struct __declspec(uuid("00000504-0000-0010-8000-00aa006d2ea4")) +Properties : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + PropertyPtr Item[]; + + // + // Wrapper methods for error-handling + // + + PropertyPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Property * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00000534-0000-0010-8000-00aa006d2ea4")) +_ADO : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetProperties)) + PropertiesPtr Properties; + + // + // Wrapper methods for error-handling + // + + PropertiesPtr GetProperties ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Properties ( + /*[out,retval]*/ struct Properties * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00000500-0000-0010-8000-00aa006d2ea4")) +Error : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetDescription)) + _bstr_t Description; + __declspec(property(get=GetNumber)) + long Number; + __declspec(property(get=GetSource)) + _bstr_t Source; + __declspec(property(get=GetHelpFile)) + _bstr_t HelpFile; + __declspec(property(get=GetHelpContext)) + long HelpContext; + __declspec(property(get=GetSQLState)) + _bstr_t SQLState; + __declspec(property(get=GetNativeError)) + long NativeError; + + // + // Wrapper methods for error-handling + // + + long GetNumber ( ); + _bstr_t GetSource ( ); + _bstr_t GetDescription ( ); + _bstr_t GetHelpFile ( ); + long GetHelpContext ( ); + _bstr_t GetSQLState ( ); + long GetNativeError ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Number ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Description ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_HelpFile ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_HelpContext ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_SQLState ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_NativeError ( + /*[out,retval]*/ long * pl ) = 0; +}; + +struct __declspec(uuid("00000501-0000-0010-8000-00aa006d2ea4")) +Errors : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + ErrorPtr Item[]; + + // + // Wrapper methods for error-handling + // + + ErrorPtr GetItem ( + const _variant_t & Index ); + HRESULT Clear ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Error * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Clear ( ) = 0; +}; + +struct __declspec(uuid("0000154c-0000-0010-8000-00aa006d2ea4")) +Field20 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize,put=PutDefinedSize)) + long DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + long ActualSize; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetDataFormat,put=PutRefDataFormat)) + IUnknownPtr DataFormat; + + // + // Wrapper methods for error-handling + // + + long GetActualSize ( ); + long GetAttributes ( ); + long GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + IUnknownPtr GetDataFormat ( ); + void PutRefDataFormat ( + IUnknown * ppiDF ); + void PutPrecision ( + unsigned char pbPrecision ); + void PutNumericScale ( + unsigned char pbNumericScale ); + void PutType ( + enum DataTypeEnum pDataType ); + void PutDefinedSize ( + long pl ); + void PutAttributes ( + long pl ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_DataFormat ( + /*[out,retval]*/ IUnknown * * ppiDF ) = 0; + virtual HRESULT __stdcall putref_DataFormat ( + /*[in]*/ IUnknown * ppiDF ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbNumericScale ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum pDataType ) = 0; + virtual HRESULT __stdcall put_DefinedSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long pl ) = 0; +}; + +struct __declspec(uuid("00001569-0000-0010-8000-00aa006d2ea4")) +Field : Field20 +{ + // + // Property data + // + + __declspec(property(get=GetStatus)) + long Status; + + // + // Wrapper methods for error-handling + // + + long GetStatus ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pFStatus ) = 0; +}; + +struct __declspec(uuid("00001506-0000-0010-8000-00aa006d2ea4")) +Fields15 : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + FieldPtr Item[]; + + // + // Wrapper methods for error-handling + // + + FieldPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Field * * ppvObject ) = 0; +}; + +struct __declspec(uuid("0000154d-0000-0010-8000-00aa006d2ea4")) +Fields20 : Fields15 +{ + // + // Wrapper methods for error-handling + // + + HRESULT _Append ( + _bstr_t Name, + enum DataTypeEnum Type, + long DefinedSize, + enum FieldAttributeEnum Attrib ); + HRESULT Delete ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw__Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ long DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ VARIANT Index ) = 0; +}; + +struct __declspec(uuid("00001564-0000-0010-8000-00aa006d2ea4")) +Fields : Fields20 +{ + // + // Wrapper methods for error-handling + // + + HRESULT Append ( + _bstr_t Name, + enum DataTypeEnum Type, + long DefinedSize, + enum FieldAttributeEnum Attrib, + const _variant_t & FieldValue = vtMissing ); + HRESULT Update ( ); + HRESULT Resync ( + enum ResyncEnum ResyncValues ); + HRESULT CancelUpdate ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ long DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib, + /*[in]*/ VARIANT FieldValue = vtMissing ) = 0; + virtual HRESULT __stdcall raw_Update ( ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; +}; + +struct __declspec(uuid("0000150c-0000-0010-8000-00aa006d2ea4")) +_Parameter : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDirection,put=PutDirection)) + enum ParameterDirectionEnum Direction; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetSize,put=PutSize)) + long Size; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstr ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + enum DataTypeEnum GetType ( ); + void PutType ( + enum DataTypeEnum psDataType ); + void PutDirection ( + enum ParameterDirectionEnum plParmDirection ); + enum ParameterDirectionEnum GetDirection ( ); + void PutPrecision ( + unsigned char pbPrecision ); + unsigned char GetPrecision ( ); + void PutNumericScale ( + unsigned char pbScale ); + unsigned char GetNumericScale ( ); + void PutSize ( + long pl ); + long GetSize ( ); + HRESULT AppendChunk ( + const _variant_t & Val ); + long GetAttributes ( ); + void PutAttributes ( + long plParmAttribs ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * psDataType ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum psDataType ) = 0; + virtual HRESULT __stdcall put_Direction ( + /*[in]*/ enum ParameterDirectionEnum plParmDirection ) = 0; + virtual HRESULT __stdcall get_Direction ( + /*[out,retval]*/ enum ParameterDirectionEnum * plParmDirection ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbScale ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbScale ) = 0; + virtual HRESULT __stdcall put_Size ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Val ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plParmAttribs ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plParmAttribs ) = 0; +}; + +struct __declspec(uuid("0000150d-0000-0010-8000-00aa006d2ea4")) +Parameters : _DynaCollection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + _ParameterPtr Item[]; + + // + // Wrapper methods for error-handling + // + + _ParameterPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct _Parameter * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00001400-0000-0010-8000-00aa006d2ea4")) +ConnectionEvents : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); +}; + +struct __declspec(uuid("00001266-0000-0010-8000-00aa006d2ea4")) +RecordsetEvents : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); +}; + +struct __declspec(uuid("00000516-0000-0010-8000-00aa006d2ea4")) +ADOConnectionConstruction15 : IUnknown +{ + // + // Property data + // + + __declspec(property(get=GetDSO)) + IUnknownPtr DSO; + __declspec(property(get=GetSession)) + IUnknownPtr Session; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetDSO ( ); + IUnknownPtr GetSession ( ); + HRESULT WrapDSOandSession ( + IUnknown * pDSO, + IUnknown * pSession ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_DSO ( + /*[out,retval]*/ IUnknown * * ppDSO ) = 0; + virtual HRESULT __stdcall get_Session ( + /*[out,retval]*/ IUnknown * * ppSession ) = 0; + virtual HRESULT __stdcall raw_WrapDSOandSession ( + /*[in]*/ IUnknown * pDSO, + /*[in]*/ IUnknown * pSession ) = 0; +}; + +struct __declspec(uuid("00000551-0000-0010-8000-00aa006d2ea4")) +ADOConnectionConstruction : ADOConnectionConstruction15 +{}; + +struct __declspec(uuid("00000514-0000-0010-8000-00aa006d2ea4")) +Connection; + // [ default ] interface _Connection + // [ default, source ] dispinterface ConnectionEvents + +struct __declspec(uuid("00000560-0000-0010-8000-00aa006d2ea4")) +Record; + // [ default ] interface _Record + +struct __declspec(uuid("00001565-0000-0010-8000-00aa006d2ea4")) +_Stream : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetSize)) + long Size; + __declspec(property(get=GetEOS)) + VARIANT_BOOL EOS; + __declspec(property(get=GetPosition,put=PutPosition)) + long Position; + __declspec(property(get=GetType,put=PutType)) + enum StreamTypeEnum Type; + __declspec(property(get=GetLineSeparator,put=PutLineSeparator)) + enum LineSeparatorEnum LineSeparator; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetCharset,put=PutCharset)) + _bstr_t Charset; + + // + // Wrapper methods for error-handling + // + + long GetSize ( ); + VARIANT_BOOL GetEOS ( ); + long GetPosition ( ); + void PutPosition ( + long pPos ); + enum StreamTypeEnum GetType ( ); + void PutType ( + enum StreamTypeEnum ptype ); + enum LineSeparatorEnum GetLineSeparator ( ); + void PutLineSeparator ( + enum LineSeparatorEnum pLS ); + enum ObjectStateEnum GetState ( ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetCharset ( ); + void PutCharset ( + _bstr_t pbstrCharset ); + _variant_t Read ( + long NumBytes ); + HRESULT Open ( + const _variant_t & Source, + enum ConnectModeEnum Mode, + enum StreamOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + HRESULT SkipLine ( ); + HRESULT Write ( + const _variant_t & Buffer ); + HRESULT SetEOS ( ); + HRESULT CopyTo ( + struct _Stream * DestStream, + long CharNumber ); + HRESULT Flush ( ); + HRESULT SaveToFile ( + _bstr_t FileName, + enum SaveOptionsEnum Options ); + HRESULT LoadFromFile ( + _bstr_t FileName ); + _bstr_t ReadText ( + long NumChars ); + HRESULT WriteText ( + _bstr_t Data, + enum StreamWriteEnum Options ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ long * pSize ) = 0; + virtual HRESULT __stdcall get_EOS ( + /*[out,retval]*/ VARIANT_BOOL * pEOS ) = 0; + virtual HRESULT __stdcall get_Position ( + /*[out,retval]*/ long * pPos ) = 0; + virtual HRESULT __stdcall put_Position ( + /*[in]*/ long pPos ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum StreamTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum StreamTypeEnum ptype ) = 0; + virtual HRESULT __stdcall get_LineSeparator ( + /*[out,retval]*/ enum LineSeparatorEnum * pLS ) = 0; + virtual HRESULT __stdcall put_LineSeparator ( + /*[in]*/ enum LineSeparatorEnum pLS ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_Charset ( + /*[out,retval]*/ BSTR * pbstrCharset ) = 0; + virtual HRESULT __stdcall put_Charset ( + /*[in]*/ BSTR pbstrCharset ) = 0; + virtual HRESULT __stdcall raw_Read ( + /*[in]*/ long NumBytes, + /*[out,retval]*/ VARIANT * pval ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum StreamOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_SkipLine ( ) = 0; + virtual HRESULT __stdcall raw_Write ( + /*[in]*/ VARIANT Buffer ) = 0; + virtual HRESULT __stdcall raw_SetEOS ( ) = 0; + virtual HRESULT __stdcall raw_CopyTo ( + /*[in]*/ struct _Stream * DestStream, + /*[in]*/ long CharNumber ) = 0; + virtual HRESULT __stdcall raw_Flush ( ) = 0; + virtual HRESULT __stdcall raw_SaveToFile ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum SaveOptionsEnum Options ) = 0; + virtual HRESULT __stdcall raw_LoadFromFile ( + /*[in]*/ BSTR FileName ) = 0; + virtual HRESULT __stdcall raw_ReadText ( + /*[in]*/ long NumChars, + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_WriteText ( + /*[in]*/ BSTR Data, + /*[in]*/ enum StreamWriteEnum Options ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("00000566-0000-0010-8000-00aa006d2ea4")) +Stream; + // [ default ] interface _Stream + +struct __declspec(uuid("00000567-0000-0010-8000-00aa006d2ea4")) +ADORecordConstruction : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetRow,put=PutRow)) + IUnknownPtr Row; + __declspec(property(put=PutParentRow)) + IUnknownPtr ParentRow; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetRow ( ); + void PutRow ( + IUnknown * ppRow ); + void PutParentRow ( + IUnknown * _arg1 ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Row ( + /*[out,retval]*/ IUnknown * * ppRow ) = 0; + virtual HRESULT __stdcall put_Row ( + /*[in]*/ IUnknown * ppRow ) = 0; + virtual HRESULT __stdcall put_ParentRow ( + /*[in]*/ IUnknown * _arg1 ) = 0; +}; + +struct __declspec(uuid("00000568-0000-0010-8000-00aa006d2ea4")) +ADOStreamConstruction : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetStream,put=PutStream)) + IUnknownPtr Stream; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetStream ( ); + void PutStream ( + IUnknown * ppStm ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Stream ( + /*[out,retval]*/ IUnknown * * ppStm ) = 0; + virtual HRESULT __stdcall put_Stream ( + /*[in]*/ IUnknown * ppStm ) = 0; +}; + +struct __declspec(uuid("00000517-0000-0010-8000-00aa006d2ea4")) +ADOCommandConstruction : IUnknown +{ + // + // Property data + // + + __declspec(property(get=GetOLEDBCommand,put=PutOLEDBCommand)) + IUnknownPtr OLEDBCommand; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetOLEDBCommand ( ); + void PutOLEDBCommand ( + IUnknown * ppOLEDBCommand ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_OLEDBCommand ( + /*[out,retval]*/ IUnknown * * ppOLEDBCommand ) = 0; + virtual HRESULT __stdcall put_OLEDBCommand ( + /*[in]*/ IUnknown * ppOLEDBCommand ) = 0; +}; + +struct __declspec(uuid("00000507-0000-0010-8000-00aa006d2ea4")) +Command; + // [ default ] interface _Command + +struct __declspec(uuid("00000535-0000-0010-8000-00aa006d2ea4")) +Recordset; + // [ default ] interface _Recordset + // [ default, source ] dispinterface RecordsetEvents + +struct __declspec(uuid("00000283-0000-0010-8000-00aa006d2ea4")) +ADORecordsetConstruction : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetRowset,put=PutRowset)) + IUnknownPtr Rowset; + __declspec(property(get=GetChapter,put=PutChapter)) + ADO_LONGPTR Chapter; + __declspec(property(get=GetRowPosition,put=PutRowPosition)) + IUnknownPtr RowPosition; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetRowset ( ); + void PutRowset ( + IUnknown * ppRowset ); + ADO_LONGPTR GetChapter ( ); + void PutChapter ( + ADO_LONGPTR plChapter ); + IUnknownPtr GetRowPosition ( ); + void PutRowPosition ( + IUnknown * ppRowPos ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Rowset ( + /*[out,retval]*/ IUnknown * * ppRowset ) = 0; + virtual HRESULT __stdcall put_Rowset ( + /*[in]*/ IUnknown * ppRowset ) = 0; + virtual HRESULT __stdcall get_Chapter ( + /*[out,retval]*/ ADO_LONGPTR * plChapter ) = 0; + virtual HRESULT __stdcall put_Chapter ( + /*[in]*/ ADO_LONGPTR plChapter ) = 0; + virtual HRESULT __stdcall get_RowPosition ( + /*[out,retval]*/ IUnknown * * ppRowPos ) = 0; + virtual HRESULT __stdcall put_RowPosition ( + /*[in]*/ IUnknown * ppRowPos ) = 0; +}; + +struct __declspec(uuid("00001505-0000-0010-8000-00aa006d2ea4")) +Field15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize)) + long DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + long ActualSize; + __declspec(property(get=GetPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + long GetActualSize ( ); + long GetAttributes ( ); + long GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; +}; + +struct __declspec(uuid("0000050b-0000-0010-8000-00aa006d2ea4")) +Parameter; + // [ default ] interface _Parameter + +struct __declspec(uuid("0000054c-0000-0010-8000-00aa006d2ea4")) +Field20_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize,put=PutDefinedSize)) + ADO_LONGPTR DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + ADO_LONGPTR ActualSize; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetDataFormat,put=PutRefDataFormat)) + IUnknownPtr DataFormat; + + // + // Wrapper methods for error-handling + // + + ADO_LONGPTR GetActualSize ( ); + long GetAttributes ( ); + ADO_LONGPTR GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + IUnknownPtr GetDataFormat ( ); + void PutRefDataFormat ( + IUnknown * ppiDF ); + void PutPrecision ( + unsigned char pbPrecision ); + void PutNumericScale ( + unsigned char pbNumericScale ); + void PutType ( + enum DataTypeEnum pDataType ); + void PutDefinedSize ( + ADO_LONGPTR pl ); + void PutAttributes ( + long pl ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_DataFormat ( + /*[out,retval]*/ IUnknown * * ppiDF ) = 0; + virtual HRESULT __stdcall putref_DataFormat ( + /*[in]*/ IUnknown * ppiDF ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbNumericScale ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum pDataType ) = 0; + virtual HRESULT __stdcall put_DefinedSize ( + /*[in]*/ ADO_LONGPTR pl ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long pl ) = 0; +}; + +struct __declspec(uuid("00000569-0000-0010-8000-00aa006d2ea4")) +Field_Deprecated : Field20_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetStatus)) + long Status; + + // + // Wrapper methods for error-handling + // + + long GetStatus ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pFStatus ) = 0; +}; + +struct __declspec(uuid("00000506-0000-0010-8000-00aa006d2ea4")) +Fields15_Deprecated : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + Field_DeprecatedPtr Item[]; + + // + // Wrapper methods for error-handling + // + + Field_DeprecatedPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Field_Deprecated * * ppvObject ) = 0; +}; + +struct __declspec(uuid("0000054d-0000-0010-8000-00aa006d2ea4")) +Fields20_Deprecated : Fields15_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT _Append ( + _bstr_t Name, + enum DataTypeEnum Type, + ADO_LONGPTR DefinedSize, + enum FieldAttributeEnum Attrib ); + HRESULT Delete ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw__Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ ADO_LONGPTR DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ VARIANT Index ) = 0; +}; + +struct __declspec(uuid("00000564-0000-0010-8000-00aa006d2ea4")) +Fields_Deprecated : Fields20_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT Append ( + _bstr_t Name, + enum DataTypeEnum Type, + ADO_LONGPTR DefinedSize, + enum FieldAttributeEnum Attrib, + const _variant_t & FieldValue = vtMissing ); + HRESULT Update ( ); + HRESULT Resync ( + enum ResyncEnum ResyncValues ); + HRESULT CancelUpdate ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ ADO_LONGPTR DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib, + /*[in]*/ VARIANT FieldValue = vtMissing ) = 0; + virtual HRESULT __stdcall raw_Update ( ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; +}; + +struct __declspec(uuid("0000050c-0000-0010-8000-00aa006d2ea4")) +_Parameter_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDirection,put=PutDirection)) + enum ParameterDirectionEnum Direction; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetSize,put=PutSize)) + ADO_LONGPTR Size; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstr ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + enum DataTypeEnum GetType ( ); + void PutType ( + enum DataTypeEnum psDataType ); + void PutDirection ( + enum ParameterDirectionEnum plParmDirection ); + enum ParameterDirectionEnum GetDirection ( ); + void PutPrecision ( + unsigned char pbPrecision ); + unsigned char GetPrecision ( ); + void PutNumericScale ( + unsigned char pbScale ); + unsigned char GetNumericScale ( ); + void PutSize ( + ADO_LONGPTR pl ); + ADO_LONGPTR GetSize ( ); + HRESULT AppendChunk ( + const _variant_t & Val ); + long GetAttributes ( ); + void PutAttributes ( + long plParmAttribs ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * psDataType ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum psDataType ) = 0; + virtual HRESULT __stdcall put_Direction ( + /*[in]*/ enum ParameterDirectionEnum plParmDirection ) = 0; + virtual HRESULT __stdcall get_Direction ( + /*[out,retval]*/ enum ParameterDirectionEnum * plParmDirection ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbScale ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbScale ) = 0; + virtual HRESULT __stdcall put_Size ( + /*[in]*/ ADO_LONGPTR pl ) = 0; + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Val ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plParmAttribs ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plParmAttribs ) = 0; +}; + +struct __declspec(uuid("0000050d-0000-0010-8000-00aa006d2ea4")) +Parameters_Deprecated : _DynaCollection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + _Parameter_DeprecatedPtr Item[]; + + // + // Wrapper methods for error-handling + // + + _Parameter_DeprecatedPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct _Parameter_Deprecated * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00000400-0000-0010-8000-00aa006d2ea4")) +ConnectionEvents_Deprecated : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); +}; + +struct __declspec(uuid("00000266-0000-0010-8000-00aa006d2ea4")) +RecordsetEvents_Deprecated : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); +}; + +struct __declspec(uuid("00000565-0000-0010-8000-00aa006d2ea4")) +_Stream_Deprecated : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetSize)) + ADO_LONGPTR Size; + __declspec(property(get=GetEOS)) + VARIANT_BOOL EOS; + __declspec(property(get=GetPosition,put=PutPosition)) + ADO_LONGPTR Position; + __declspec(property(get=GetType,put=PutType)) + enum StreamTypeEnum Type; + __declspec(property(get=GetLineSeparator,put=PutLineSeparator)) + enum LineSeparatorEnum LineSeparator; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetCharset,put=PutCharset)) + _bstr_t Charset; + + // + // Wrapper methods for error-handling + // + + ADO_LONGPTR GetSize ( ); + VARIANT_BOOL GetEOS ( ); + ADO_LONGPTR GetPosition ( ); + void PutPosition ( + ADO_LONGPTR pPos ); + enum StreamTypeEnum GetType ( ); + void PutType ( + enum StreamTypeEnum ptype ); + enum LineSeparatorEnum GetLineSeparator ( ); + void PutLineSeparator ( + enum LineSeparatorEnum pLS ); + enum ObjectStateEnum GetState ( ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetCharset ( ); + void PutCharset ( + _bstr_t pbstrCharset ); + _variant_t Read ( + long NumBytes ); + HRESULT Open ( + const _variant_t & Source, + enum ConnectModeEnum Mode, + enum StreamOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + HRESULT SkipLine ( ); + HRESULT Write ( + const _variant_t & Buffer ); + HRESULT SetEOS ( ); + HRESULT CopyTo ( + struct _Stream_Deprecated * DestStream, + ADO_LONGPTR CharNumber ); + HRESULT Flush ( ); + HRESULT SaveToFile ( + _bstr_t FileName, + enum SaveOptionsEnum Options ); + HRESULT LoadFromFile ( + _bstr_t FileName ); + _bstr_t ReadText ( + long NumChars ); + HRESULT WriteText ( + _bstr_t Data, + enum StreamWriteEnum Options ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ ADO_LONGPTR * pSize ) = 0; + virtual HRESULT __stdcall get_EOS ( + /*[out,retval]*/ VARIANT_BOOL * pEOS ) = 0; + virtual HRESULT __stdcall get_Position ( + /*[out,retval]*/ ADO_LONGPTR * pPos ) = 0; + virtual HRESULT __stdcall put_Position ( + /*[in]*/ ADO_LONGPTR pPos ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum StreamTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum StreamTypeEnum ptype ) = 0; + virtual HRESULT __stdcall get_LineSeparator ( + /*[out,retval]*/ enum LineSeparatorEnum * pLS ) = 0; + virtual HRESULT __stdcall put_LineSeparator ( + /*[in]*/ enum LineSeparatorEnum pLS ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_Charset ( + /*[out,retval]*/ BSTR * pbstrCharset ) = 0; + virtual HRESULT __stdcall put_Charset ( + /*[in]*/ BSTR pbstrCharset ) = 0; + virtual HRESULT __stdcall raw_Read ( + /*[in]*/ long NumBytes, + /*[out,retval]*/ VARIANT * pval ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum StreamOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_SkipLine ( ) = 0; + virtual HRESULT __stdcall raw_Write ( + /*[in]*/ VARIANT Buffer ) = 0; + virtual HRESULT __stdcall raw_SetEOS ( ) = 0; + virtual HRESULT __stdcall raw_CopyTo ( + /*[in]*/ struct _Stream_Deprecated * DestStream, + /*[in]*/ ADO_LONGPTR CharNumber ) = 0; + virtual HRESULT __stdcall raw_Flush ( ) = 0; + virtual HRESULT __stdcall raw_SaveToFile ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum SaveOptionsEnum Options ) = 0; + virtual HRESULT __stdcall raw_LoadFromFile ( + /*[in]*/ BSTR FileName ) = 0; + virtual HRESULT __stdcall raw_ReadText ( + /*[in]*/ long NumChars, + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_WriteText ( + /*[in]*/ BSTR Data, + /*[in]*/ enum StreamWriteEnum Options ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("00000505-0000-0010-8000-00aa006d2ea4")) +Field15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize)) + ADO_LONGPTR DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + ADO_LONGPTR ActualSize; + __declspec(property(get=GetPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + ADO_LONGPTR GetActualSize ( ); + long GetAttributes ( ); + ADO_LONGPTR GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; +}; + +struct __declspec(uuid("00001508-0000-0010-8000-00aa006d2ea4")) +Command15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetParameters)) + ParametersPtr Parameters; + __declspec(property(get=GetActiveConnection,put=PutRefActiveConnection)) + _ConnectionPtr ActiveConnection; + __declspec(property(get=GetCommandText,put=PutCommandText)) + _bstr_t CommandText; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetPrepared,put=PutPrepared)) + VARIANT_BOOL Prepared; + __declspec(property(get=GetCommandType,put=PutCommandType)) + enum CommandTypeEnum CommandType; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + + // + // Wrapper methods for error-handling + // + + _ConnectionPtr GetActiveConnection ( ); + void PutRefActiveConnection ( + struct _Connection * ppvObject ); + void PutActiveConnection ( + const _variant_t & ppvObject ); + _bstr_t GetCommandText ( ); + void PutCommandText ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long pl ); + VARIANT_BOOL GetPrepared ( ); + void PutPrepared ( + VARIANT_BOOL pfPrepared ); + _RecordsetPtr Execute ( + VARIANT * RecordsAffected, + VARIANT * Parameters, + long Options ); + _ParameterPtr CreateParameter ( + _bstr_t Name, + enum DataTypeEnum Type, + enum ParameterDirectionEnum Direction, + long Size, + const _variant_t & Value = vtMissing ); + ParametersPtr GetParameters ( ); + void PutCommandType ( + enum CommandTypeEnum plCmdType ); + enum CommandTypeEnum GetCommandType ( ); + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstrName ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ struct _Connection * * ppvObject ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection * ppvObject ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT ppvObject ) = 0; + virtual HRESULT __stdcall get_CommandText ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_CommandText ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Prepared ( + /*[out,retval]*/ VARIANT_BOOL * pfPrepared ) = 0; + virtual HRESULT __stdcall put_Prepared ( + /*[in]*/ VARIANT_BOOL pfPrepared ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ VARIANT * Parameters, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_CreateParameter ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ enum ParameterDirectionEnum Direction, + /*[in]*/ long Size, + /*[in]*/ VARIANT Value, + /*[out,retval]*/ struct _Parameter * * ppiprm ) = 0; + virtual HRESULT __stdcall get_Parameters ( + /*[out,retval]*/ struct Parameters * * ppvObject ) = 0; + virtual HRESULT __stdcall put_CommandType ( + /*[in]*/ enum CommandTypeEnum plCmdType ) = 0; + virtual HRESULT __stdcall get_CommandType ( + /*[out,retval]*/ enum CommandTypeEnum * plCmdType ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstrName ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstrName ) = 0; +}; + +struct __declspec(uuid("0000154e-0000-0010-8000-00aa006d2ea4")) +Command25 : Command15 +{ + // + // Property data + // + + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + long GetState ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("986761e8-7269-4890-aa65-ad7c03697a6d")) +_Command : Command25 +{ + // + // Property data + // + + __declspec(property(get=GetDialect,put=PutDialect)) + _bstr_t Dialect; + __declspec(property(get=GetNamedParameters,put=PutNamedParameters)) + VARIANT_BOOL NamedParameters; + + // + // Wrapper methods for error-handling + // + + void PutRefCommandStream ( + IUnknown * pvStream ); + _variant_t GetCommandStream ( ); + void PutDialect ( + _bstr_t pbstrDialect ); + _bstr_t GetDialect ( ); + void PutNamedParameters ( + VARIANT_BOOL pfNamedParameters ); + VARIANT_BOOL GetNamedParameters ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall putref_CommandStream ( + /*[in]*/ IUnknown * pvStream ) = 0; + virtual HRESULT __stdcall get_CommandStream ( + /*[out,retval]*/ VARIANT * pvStream ) = 0; + virtual HRESULT __stdcall put_Dialect ( + /*[in]*/ BSTR pbstrDialect ) = 0; + virtual HRESULT __stdcall get_Dialect ( + /*[out,retval]*/ BSTR * pbstrDialect ) = 0; + virtual HRESULT __stdcall put_NamedParameters ( + /*[in]*/ VARIANT_BOOL pfNamedParameters ) = 0; + virtual HRESULT __stdcall get_NamedParameters ( + /*[out,retval]*/ VARIANT_BOOL * pfNamedParameters ) = 0; +}; + +struct __declspec(uuid("00001515-0000-0010-8000-00aa006d2ea4")) +Connection15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetConnectionString,put=PutConnectionString)) + _bstr_t ConnectionString; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetConnectionTimeout,put=PutConnectionTimeout)) + long ConnectionTimeout; + __declspec(property(get=GetVersion)) + _bstr_t Version; + __declspec(property(get=GetErrors)) + ErrorsPtr Errors; + __declspec(property(get=GetDefaultDatabase,put=PutDefaultDatabase)) + _bstr_t DefaultDatabase; + __declspec(property(get=GetIsolationLevel,put=PutIsolationLevel)) + enum IsolationLevelEnum IsolationLevel; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetProvider,put=PutProvider)) + _bstr_t Provider; + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetConnectionString ( ); + void PutConnectionString ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long plTimeout ); + long GetConnectionTimeout ( ); + void PutConnectionTimeout ( + long plTimeout ); + _bstr_t GetVersion ( ); + HRESULT Close ( ); + _RecordsetPtr Execute ( + _bstr_t CommandText, + VARIANT * RecordsAffected, + long Options ); + long BeginTrans ( ); + HRESULT CommitTrans ( ); + HRESULT RollbackTrans ( ); + HRESULT Open ( + _bstr_t ConnectionString, + _bstr_t UserID, + _bstr_t Password, + long Options ); + ErrorsPtr GetErrors ( ); + _bstr_t GetDefaultDatabase ( ); + void PutDefaultDatabase ( + _bstr_t pbstr ); + enum IsolationLevelEnum GetIsolationLevel ( ); + void PutIsolationLevel ( + enum IsolationLevelEnum Level ); + long GetAttributes ( ); + void PutAttributes ( + long plAttr ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum plMode ); + _bstr_t GetProvider ( ); + void PutProvider ( + _bstr_t pbstr ); + long GetState ( ); + _RecordsetPtr OpenSchema ( + enum SchemaEnum Schema, + const _variant_t & Restrictions = vtMissing, + const _variant_t & SchemaID = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ConnectionString ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_ConnectionString ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_ConnectionTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_ConnectionTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_Version ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[in]*/ BSTR CommandText, + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset * * ppiRset ) = 0; + virtual HRESULT __stdcall raw_BeginTrans ( + /*[out,retval]*/ long * TransactionLevel ) = 0; + virtual HRESULT __stdcall raw_CommitTrans ( ) = 0; + virtual HRESULT __stdcall raw_RollbackTrans ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ BSTR ConnectionString, + /*[in]*/ BSTR UserID, + /*[in]*/ BSTR Password, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall get_Errors ( + /*[out,retval]*/ struct Errors * * ppvObject ) = 0; + virtual HRESULT __stdcall get_DefaultDatabase ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_DefaultDatabase ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_IsolationLevel ( + /*[out,retval]*/ enum IsolationLevelEnum * Level ) = 0; + virtual HRESULT __stdcall put_IsolationLevel ( + /*[in]*/ enum IsolationLevelEnum Level ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plAttr ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plAttr ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * plMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum plMode ) = 0; + virtual HRESULT __stdcall get_Provider ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Provider ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_OpenSchema ( + /*[in]*/ enum SchemaEnum Schema, + /*[in]*/ VARIANT Restrictions, + /*[in]*/ VARIANT SchemaID, + /*[out,retval]*/ struct _Recordset * * pprset ) = 0; +}; + +struct __declspec(uuid("00001550-0000-0010-8000-00aa006d2ea4")) +_Connection : Connection15 +{ + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("0000150e-0000-0010-8000-00aa006d2ea4")) +Recordset15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + FieldsPtr Fields; + __declspec(property(get=GetPageSize,put=PutPageSize)) + long PageSize; + __declspec(property(get=GetPageCount)) + long PageCount; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetState)) + long State; + __declspec(property(get=GetMarshalOptions,put=PutMarshalOptions)) + enum MarshalOptionsEnum MarshalOptions; + __declspec(property(get=GetCollect,put=PutCollect)) + _variant_t Collect[]; + __declspec(property(get=GetEditMode)) + enum EditModeEnum EditMode; + __declspec(property(get=GetStatus)) + long Status; + __declspec(property(get=GetFilter,put=PutFilter)) + _variant_t Filter; + __declspec(property(get=GetSort,put=PutSort)) + _bstr_t Sort; + __declspec(property(get=GetAbsolutePosition,put=PutAbsolutePosition)) + enum PositionEnum AbsolutePosition; + __declspec(property(get=GetBOF)) + VARIANT_BOOL BOF; + __declspec(property(get=GetBookmark,put=PutBookmark)) + _variant_t Bookmark; + __declspec(property(get=GetCacheSize,put=PutCacheSize)) + long CacheSize; + __declspec(property(get=GetCursorType,put=PutCursorType)) + enum CursorTypeEnum CursorType; + __declspec(property(get=GetadoEOF)) + VARIANT_BOOL adoEOF; + __declspec(property(get=GetAbsolutePage,put=PutAbsolutePage)) + enum PositionEnum AbsolutePage; + __declspec(property(get=GetLockType,put=PutLockType)) + enum LockTypeEnum LockType; + __declspec(property(get=GetMaxRecords,put=PutMaxRecords)) + long MaxRecords; + __declspec(property(get=GetRecordCount)) + long RecordCount; + + // + // Wrapper methods for error-handling + // + + enum PositionEnum GetAbsolutePosition ( ); + void PutAbsolutePosition ( + enum PositionEnum pl ); + void PutRefActiveConnection ( + IDispatch * pvar ); + void PutActiveConnection ( + const _variant_t & pvar ); + _variant_t GetActiveConnection ( ); + VARIANT_BOOL GetBOF ( ); + _variant_t GetBookmark ( ); + void PutBookmark ( + const _variant_t & pvBookmark ); + long GetCacheSize ( ); + void PutCacheSize ( + long pl ); + enum CursorTypeEnum GetCursorType ( ); + void PutCursorType ( + enum CursorTypeEnum plCursorType ); + VARIANT_BOOL GetadoEOF ( ); + FieldsPtr GetFields ( ); + enum LockTypeEnum GetLockType ( ); + void PutLockType ( + enum LockTypeEnum plLockType ); + long GetMaxRecords ( ); + void PutMaxRecords ( + long plMaxRecords ); + long GetRecordCount ( ); + void PutRefSource ( + IDispatch * pvSource ); + void PutSource ( + _bstr_t pvSource ); + _variant_t GetSource ( ); + HRESULT AddNew ( + const _variant_t & FieldList = vtMissing, + const _variant_t & Values = vtMissing ); + HRESULT CancelUpdate ( ); + HRESULT Close ( ); + HRESULT Delete ( + enum AffectEnum AffectRecords ); + _variant_t GetRows ( + long Rows, + const _variant_t & Start = vtMissing, + const _variant_t & Fields = vtMissing ); + HRESULT Move ( + long NumRecords, + const _variant_t & Start = vtMissing ); + HRESULT MoveNext ( ); + HRESULT MovePrevious ( ); + HRESULT MoveFirst ( ); + HRESULT MoveLast ( ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum CursorTypeEnum CursorType, + enum LockTypeEnum LockType, + long Options ); + HRESULT Requery ( + long Options ); + HRESULT _xResync ( + enum AffectEnum AffectRecords ); + HRESULT Update ( + const _variant_t & Fields = vtMissing, + const _variant_t & Values = vtMissing ); + enum PositionEnum GetAbsolutePage ( ); + void PutAbsolutePage ( + enum PositionEnum pl ); + enum EditModeEnum GetEditMode ( ); + _variant_t GetFilter ( ); + void PutFilter ( + const _variant_t & Criteria ); + long GetPageCount ( ); + long GetPageSize ( ); + void PutPageSize ( + long pl ); + _bstr_t GetSort ( ); + void PutSort ( + _bstr_t Criteria ); + long GetStatus ( ); + long GetState ( ); + _RecordsetPtr _xClone ( ); + HRESULT UpdateBatch ( + enum AffectEnum AffectRecords ); + HRESULT CancelBatch ( + enum AffectEnum AffectRecords ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + _RecordsetPtr NextRecordset ( + VARIANT * RecordsAffected ); + VARIANT_BOOL Supports ( + enum CursorOptionEnum CursorOptions ); + _variant_t GetCollect ( + const _variant_t & Index ); + void PutCollect ( + const _variant_t & Index, + const _variant_t & pvar ); + enum MarshalOptionsEnum GetMarshalOptions ( ); + void PutMarshalOptions ( + enum MarshalOptionsEnum peMarshal ); + HRESULT Find ( + _bstr_t Criteria, + long SkipRecords, + enum SearchDirectionEnum SearchDirection, + const _variant_t & Start = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_AbsolutePosition ( + /*[out,retval]*/ enum PositionEnum * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePosition ( + /*[in]*/ enum PositionEnum pl ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_BOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Bookmark ( + /*[out,retval]*/ VARIANT * pvBookmark ) = 0; + virtual HRESULT __stdcall put_Bookmark ( + /*[in]*/ VARIANT pvBookmark ) = 0; + virtual HRESULT __stdcall get_CacheSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CacheSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_CursorType ( + /*[out,retval]*/ enum CursorTypeEnum * plCursorType ) = 0; + virtual HRESULT __stdcall put_CursorType ( + /*[in]*/ enum CursorTypeEnum plCursorType ) = 0; + virtual HRESULT __stdcall get_adoEOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields * * ppvObject ) = 0; + virtual HRESULT __stdcall get_LockType ( + /*[out,retval]*/ enum LockTypeEnum * plLockType ) = 0; + virtual HRESULT __stdcall put_LockType ( + /*[in]*/ enum LockTypeEnum plLockType ) = 0; + virtual HRESULT __stdcall get_MaxRecords ( + /*[out,retval]*/ long * plMaxRecords ) = 0; + virtual HRESULT __stdcall put_MaxRecords ( + /*[in]*/ long plMaxRecords ) = 0; + virtual HRESULT __stdcall get_RecordCount ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvSource ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvSource ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvSource ) = 0; + virtual HRESULT __stdcall raw_AddNew ( + /*[in]*/ VARIANT FieldList = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_GetRows ( + /*[in]*/ long Rows, + /*[in]*/ VARIANT Start, + /*[in]*/ VARIANT Fields, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall raw_Move ( + /*[in]*/ long NumRecords, + /*[in]*/ VARIANT Start = vtMissing ) = 0; + virtual HRESULT __stdcall raw_MoveNext ( ) = 0; + virtual HRESULT __stdcall raw_MovePrevious ( ) = 0; + virtual HRESULT __stdcall raw_MoveFirst ( ) = 0; + virtual HRESULT __stdcall raw_MoveLast ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum CursorTypeEnum CursorType, + /*[in]*/ enum LockTypeEnum LockType, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw_Requery ( + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw__xResync ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_Update ( + /*[in]*/ VARIANT Fields = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall get_AbsolutePage ( + /*[out,retval]*/ enum PositionEnum * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePage ( + /*[in]*/ enum PositionEnum pl ) = 0; + virtual HRESULT __stdcall get_EditMode ( + /*[out,retval]*/ enum EditModeEnum * pl ) = 0; + virtual HRESULT __stdcall get_Filter ( + /*[out,retval]*/ VARIANT * Criteria ) = 0; + virtual HRESULT __stdcall put_Filter ( + /*[in]*/ VARIANT Criteria ) = 0; + virtual HRESULT __stdcall get_PageCount ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_PageSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_PageSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Sort ( + /*[out,retval]*/ BSTR * Criteria ) = 0; + virtual HRESULT __stdcall put_Sort ( + /*[in]*/ BSTR Criteria ) = 0; + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw__xClone ( + /*[out,retval]*/ struct _Recordset * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_UpdateBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_CancelBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall raw_NextRecordset ( + /*[out]*/ VARIANT * RecordsAffected, + /*[out,retval]*/ struct _Recordset * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_Supports ( + /*[in]*/ enum CursorOptionEnum CursorOptions, + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Collect ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Collect ( + /*[in]*/ VARIANT Index, + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_MarshalOptions ( + /*[out,retval]*/ enum MarshalOptionsEnum * peMarshal ) = 0; + virtual HRESULT __stdcall put_MarshalOptions ( + /*[in]*/ enum MarshalOptionsEnum peMarshal ) = 0; + virtual HRESULT __stdcall raw_Find ( + /*[in]*/ BSTR Criteria, + /*[in]*/ long SkipRecords, + /*[in]*/ enum SearchDirectionEnum SearchDirection, + /*[in]*/ VARIANT Start = vtMissing ) = 0; +}; + +struct __declspec(uuid("0000154f-0000-0010-8000-00aa006d2ea4")) +Recordset20 : Recordset15 +{ + // + // Property data + // + + __declspec(property(get=GetDataSource,put=PutRefDataSource)) + IUnknownPtr DataSource; + __declspec(property(get=GetActiveCommand)) + IDispatchPtr ActiveCommand; + __declspec(property(get=GetStayInSync,put=PutStayInSync)) + VARIANT_BOOL StayInSync; + __declspec(property(get=GetDataMember,put=PutDataMember)) + _bstr_t DataMember; + + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + IUnknownPtr GetDataSource ( ); + void PutRefDataSource ( + IUnknown * ppunkDataSource ); + HRESULT _xSave ( + _bstr_t FileName, + enum PersistFormatEnum PersistFormat ); + IDispatchPtr GetActiveCommand ( ); + void PutStayInSync ( + VARIANT_BOOL pbStayInSync ); + VARIANT_BOOL GetStayInSync ( ); + _bstr_t GetString ( + enum StringFormatEnum StringFormat, + long NumRows, + _bstr_t ColumnDelimeter, + _bstr_t RowDelimeter, + _bstr_t NullExpr ); + _bstr_t GetDataMember ( ); + void PutDataMember ( + _bstr_t pbstrDataMember ); + enum CompareEnum CompareBookmarks ( + const _variant_t & Bookmark1, + const _variant_t & Bookmark2 ); + _RecordsetPtr Clone ( + enum LockTypeEnum LockType ); + HRESULT Resync ( + enum AffectEnum AffectRecords, + enum ResyncEnum ResyncValues ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; + virtual HRESULT __stdcall get_DataSource ( + /*[out,retval]*/ IUnknown * * ppunkDataSource ) = 0; + virtual HRESULT __stdcall putref_DataSource ( + /*[in]*/ IUnknown * ppunkDataSource ) = 0; + virtual HRESULT __stdcall raw__xSave ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; + virtual HRESULT __stdcall get_ActiveCommand ( + /*[out,retval]*/ IDispatch * * ppCmd ) = 0; + virtual HRESULT __stdcall put_StayInSync ( + /*[in]*/ VARIANT_BOOL pbStayInSync ) = 0; + virtual HRESULT __stdcall get_StayInSync ( + /*[out,retval]*/ VARIANT_BOOL * pbStayInSync ) = 0; + virtual HRESULT __stdcall raw_GetString ( + /*[in]*/ enum StringFormatEnum StringFormat, + /*[in]*/ long NumRows, + /*[in]*/ BSTR ColumnDelimeter, + /*[in]*/ BSTR RowDelimeter, + /*[in]*/ BSTR NullExpr, + /*[out,retval]*/ BSTR * pRetString ) = 0; + virtual HRESULT __stdcall get_DataMember ( + /*[out,retval]*/ BSTR * pbstrDataMember ) = 0; + virtual HRESULT __stdcall put_DataMember ( + /*[in]*/ BSTR pbstrDataMember ) = 0; + virtual HRESULT __stdcall raw_CompareBookmarks ( + /*[in]*/ VARIANT Bookmark1, + /*[in]*/ VARIANT Bookmark2, + /*[out,retval]*/ enum CompareEnum * pCompare ) = 0; + virtual HRESULT __stdcall raw_Clone ( + /*[in]*/ enum LockTypeEnum LockType, + /*[out,retval]*/ struct _Recordset * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum AffectEnum AffectRecords, + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; +}; + +struct __declspec(uuid("00001555-0000-0010-8000-00aa006d2ea4")) +Recordset21 : Recordset20 +{ + // + // Property data + // + + __declspec(property(get=GetIndex,put=PutIndex)) + _bstr_t Index; + + // + // Wrapper methods for error-handling + // + + HRESULT Seek ( + const _variant_t & KeyValues, + enum SeekEnum SeekOption ); + void PutIndex ( + _bstr_t pbstrIndex ); + _bstr_t GetIndex ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Seek ( + /*[in]*/ VARIANT KeyValues, + /*[in]*/ enum SeekEnum SeekOption ) = 0; + virtual HRESULT __stdcall put_Index ( + /*[in]*/ BSTR pbstrIndex ) = 0; + virtual HRESULT __stdcall get_Index ( + /*[out,retval]*/ BSTR * pbstrIndex ) = 0; +}; + +struct __declspec(uuid("00001556-0000-0010-8000-00aa006d2ea4")) +_Recordset : Recordset21 +{ + // + // Wrapper methods for error-handling + // + + HRESULT Save ( + const _variant_t & Destination, + enum PersistFormatEnum PersistFormat ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Save ( + /*[in]*/ VARIANT Destination, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; +}; + +struct __declspec(uuid("00001402-0000-0010-8000-00aa006d2ea4")) +ConnectionEventsVt : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_InfoMessage ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_BeginTransComplete ( + /*[in]*/ long TransactionLevel, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_CommitTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_RollbackTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillExecute ( + /*[in,out]*/ BSTR * Source, + /*[in,out]*/ enum CursorTypeEnum * CursorType, + /*[in,out]*/ enum LockTypeEnum * LockType, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command * pCommand, + /*[in]*/ struct _Recordset * pRecordset, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_ExecuteComplete ( + /*[in]*/ long RecordsAffected, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command * pCommand, + /*[in]*/ struct _Recordset * pRecordset, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillConnect ( + /*[in,out]*/ BSTR * ConnectionString, + /*[in,out]*/ BSTR * UserID, + /*[in,out]*/ BSTR * Password, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_ConnectComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_Disconnect ( + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; +}; + +struct __declspec(uuid("00001403-0000-0010-8000-00aa006d2ea4")) +RecordsetEventsVt : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_WillChangeField ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FieldChangeComplete ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecord ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecordset ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordsetChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillMove ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_MoveComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_EndOfRecordset ( + /*[in,out]*/ VARIANT_BOOL * fMoreData, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchProgress ( + /*[in]*/ long Progress, + /*[in]*/ long MaxProgress, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; +}; + +struct __declspec(uuid("00001562-0000-0010-8000-00aa006d2ea4")) +_Record : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + FieldsPtr Fields; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetParentURL)) + _bstr_t ParentURL; + __declspec(property(get=GetRecordType)) + enum RecordTypeEnum RecordType; + + // + // Wrapper methods for error-handling + // + + _variant_t GetActiveConnection ( ); + void PutActiveConnection ( + _bstr_t pvar ); + void PutRefActiveConnection ( + struct _Connection * pvar ); + enum ObjectStateEnum GetState ( ); + _variant_t GetSource ( ); + void PutSource ( + _bstr_t pvar ); + void PutRefSource ( + IDispatch * pvar ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetParentURL ( ); + _bstr_t MoveRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum MoveRecordOptionsEnum Options, + VARIANT_BOOL Async ); + _bstr_t CopyRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum CopyRecordOptionsEnum Options, + VARIANT_BOOL Async ); + HRESULT DeleteRecord ( + _bstr_t Source, + VARIANT_BOOL Async ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum ConnectModeEnum Mode, + enum RecordCreateOptionsEnum CreateOptions, + enum RecordOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + FieldsPtr GetFields ( ); + enum RecordTypeEnum GetRecordType ( ); + _RecordsetPtr GetChildren ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection * pvar ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_ParentURL ( + /*[out,retval]*/ BSTR * pbstrParentURL ) = 0; + virtual HRESULT __stdcall raw_MoveRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum MoveRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_CopyRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum CopyRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_DeleteRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ VARIANT_BOOL Async ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum RecordCreateOptionsEnum CreateOptions, + /*[in]*/ enum RecordOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields * * ppFlds ) = 0; + virtual HRESULT __stdcall get_RecordType ( + /*[out,retval]*/ enum RecordTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall raw_GetChildren ( + /*[out,retval]*/ struct _Recordset * * pprset ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("00000402-0000-0010-8000-00aa006d2ea4")) +ConnectionEventsVt_Deprecated : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_InfoMessage ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_BeginTransComplete ( + /*[in]*/ long TransactionLevel, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_CommitTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_RollbackTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillExecute ( + /*[in,out]*/ BSTR * Source, + /*[in,out]*/ enum CursorTypeEnum * CursorType, + /*[in,out]*/ enum LockTypeEnum * LockType, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command_Deprecated * pCommand, + /*[in]*/ struct _Recordset_Deprecated * pRecordset, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_ExecuteComplete ( + /*[in]*/ long RecordsAffected, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command_Deprecated * pCommand, + /*[in]*/ struct _Recordset_Deprecated * pRecordset, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillConnect ( + /*[in,out]*/ BSTR * ConnectionString, + /*[in,out]*/ BSTR * UserID, + /*[in,out]*/ BSTR * Password, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_ConnectComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_Disconnect ( + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; +}; + +struct __declspec(uuid("00000515-0000-0010-8000-00aa006d2ea4")) +Connection15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetConnectionString,put=PutConnectionString)) + _bstr_t ConnectionString; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetConnectionTimeout,put=PutConnectionTimeout)) + long ConnectionTimeout; + __declspec(property(get=GetVersion)) + _bstr_t Version; + __declspec(property(get=GetErrors)) + ErrorsPtr Errors; + __declspec(property(get=GetDefaultDatabase,put=PutDefaultDatabase)) + _bstr_t DefaultDatabase; + __declspec(property(get=GetIsolationLevel,put=PutIsolationLevel)) + enum IsolationLevelEnum IsolationLevel; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetProvider,put=PutProvider)) + _bstr_t Provider; + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetConnectionString ( ); + void PutConnectionString ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long plTimeout ); + long GetConnectionTimeout ( ); + void PutConnectionTimeout ( + long plTimeout ); + _bstr_t GetVersion ( ); + HRESULT Close ( ); + _Recordset_DeprecatedPtr Execute ( + _bstr_t CommandText, + VARIANT * RecordsAffected, + long Options ); + long BeginTrans ( ); + HRESULT CommitTrans ( ); + HRESULT RollbackTrans ( ); + HRESULT Open ( + _bstr_t ConnectionString, + _bstr_t UserID, + _bstr_t Password, + long Options ); + ErrorsPtr GetErrors ( ); + _bstr_t GetDefaultDatabase ( ); + void PutDefaultDatabase ( + _bstr_t pbstr ); + enum IsolationLevelEnum GetIsolationLevel ( ); + void PutIsolationLevel ( + enum IsolationLevelEnum Level ); + long GetAttributes ( ); + void PutAttributes ( + long plAttr ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum plMode ); + _bstr_t GetProvider ( ); + void PutProvider ( + _bstr_t pbstr ); + long GetState ( ); + _Recordset_DeprecatedPtr OpenSchema ( + enum SchemaEnum Schema, + const _variant_t & Restrictions = vtMissing, + const _variant_t & SchemaID = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ConnectionString ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_ConnectionString ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_ConnectionTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_ConnectionTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_Version ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[in]*/ BSTR CommandText, + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppiRset ) = 0; + virtual HRESULT __stdcall raw_BeginTrans ( + /*[out,retval]*/ long * TransactionLevel ) = 0; + virtual HRESULT __stdcall raw_CommitTrans ( ) = 0; + virtual HRESULT __stdcall raw_RollbackTrans ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ BSTR ConnectionString, + /*[in]*/ BSTR UserID, + /*[in]*/ BSTR Password, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall get_Errors ( + /*[out,retval]*/ struct Errors * * ppvObject ) = 0; + virtual HRESULT __stdcall get_DefaultDatabase ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_DefaultDatabase ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_IsolationLevel ( + /*[out,retval]*/ enum IsolationLevelEnum * Level ) = 0; + virtual HRESULT __stdcall put_IsolationLevel ( + /*[in]*/ enum IsolationLevelEnum Level ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plAttr ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plAttr ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * plMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum plMode ) = 0; + virtual HRESULT __stdcall get_Provider ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Provider ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_OpenSchema ( + /*[in]*/ enum SchemaEnum Schema, + /*[in]*/ VARIANT Restrictions, + /*[in]*/ VARIANT SchemaID, + /*[out,retval]*/ struct _Recordset_Deprecated * * pprset ) = 0; +}; + +struct __declspec(uuid("00000550-0000-0010-8000-00aa006d2ea4")) +_Connection_Deprecated : Connection15_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("0000050e-0000-0010-8000-00aa006d2ea4")) +Recordset15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + Fields_DeprecatedPtr Fields; + __declspec(property(get=GetPageSize,put=PutPageSize)) + long PageSize; + __declspec(property(get=GetPageCount)) + ADO_LONGPTR PageCount; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetState)) + long State; + __declspec(property(get=GetMarshalOptions,put=PutMarshalOptions)) + enum MarshalOptionsEnum MarshalOptions; + __declspec(property(get=GetCollect,put=PutCollect)) + _variant_t Collect[]; + __declspec(property(get=GetEditMode)) + enum EditModeEnum EditMode; + __declspec(property(get=GetStatus)) + long Status; + __declspec(property(get=GetFilter,put=PutFilter)) + _variant_t Filter; + __declspec(property(get=GetSort,put=PutSort)) + _bstr_t Sort; + __declspec(property(get=GetAbsolutePosition,put=PutAbsolutePosition)) + PositionEnum_Param AbsolutePosition; + __declspec(property(get=GetBOF)) + VARIANT_BOOL BOF; + __declspec(property(get=GetBookmark,put=PutBookmark)) + _variant_t Bookmark; + __declspec(property(get=GetCacheSize,put=PutCacheSize)) + long CacheSize; + __declspec(property(get=GetCursorType,put=PutCursorType)) + enum CursorTypeEnum CursorType; + __declspec(property(get=GetadoEOF)) + VARIANT_BOOL adoEOF; + __declspec(property(get=GetAbsolutePage,put=PutAbsolutePage)) + PositionEnum_Param AbsolutePage; + __declspec(property(get=GetLockType,put=PutLockType)) + enum LockTypeEnum LockType; + __declspec(property(get=GetMaxRecords,put=PutMaxRecords)) + ADO_LONGPTR MaxRecords; + __declspec(property(get=GetRecordCount)) + ADO_LONGPTR RecordCount; + + // + // Wrapper methods for error-handling + // + + PositionEnum_Param GetAbsolutePosition ( ); + void PutAbsolutePosition ( + PositionEnum_Param pl ); + void PutRefActiveConnection ( + IDispatch * pvar ); + void PutActiveConnection ( + const _variant_t & pvar ); + _variant_t GetActiveConnection ( ); + VARIANT_BOOL GetBOF ( ); + _variant_t GetBookmark ( ); + void PutBookmark ( + const _variant_t & pvBookmark ); + long GetCacheSize ( ); + void PutCacheSize ( + long pl ); + enum CursorTypeEnum GetCursorType ( ); + void PutCursorType ( + enum CursorTypeEnum plCursorType ); + VARIANT_BOOL GetadoEOF ( ); + Fields_DeprecatedPtr GetFields ( ); + enum LockTypeEnum GetLockType ( ); + void PutLockType ( + enum LockTypeEnum plLockType ); + ADO_LONGPTR GetMaxRecords ( ); + void PutMaxRecords ( + ADO_LONGPTR plMaxRecords ); + ADO_LONGPTR GetRecordCount ( ); + void PutRefSource ( + IDispatch * pvSource ); + void PutSource ( + _bstr_t pvSource ); + _variant_t GetSource ( ); + HRESULT AddNew ( + const _variant_t & FieldList = vtMissing, + const _variant_t & Values = vtMissing ); + HRESULT CancelUpdate ( ); + HRESULT Close ( ); + HRESULT Delete ( + enum AffectEnum AffectRecords ); + _variant_t GetRows ( + long Rows, + const _variant_t & Start = vtMissing, + const _variant_t & Fields = vtMissing ); + HRESULT Move ( + ADO_LONGPTR NumRecords, + const _variant_t & Start = vtMissing ); + HRESULT MoveNext ( ); + HRESULT MovePrevious ( ); + HRESULT MoveFirst ( ); + HRESULT MoveLast ( ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum CursorTypeEnum CursorType, + enum LockTypeEnum LockType, + long Options ); + HRESULT Requery ( + long Options ); + HRESULT _xResync ( + enum AffectEnum AffectRecords ); + HRESULT Update ( + const _variant_t & Fields = vtMissing, + const _variant_t & Values = vtMissing ); + PositionEnum_Param GetAbsolutePage ( ); + void PutAbsolutePage ( + PositionEnum_Param pl ); + enum EditModeEnum GetEditMode ( ); + _variant_t GetFilter ( ); + void PutFilter ( + const _variant_t & Criteria ); + ADO_LONGPTR GetPageCount ( ); + long GetPageSize ( ); + void PutPageSize ( + long pl ); + _bstr_t GetSort ( ); + void PutSort ( + _bstr_t Criteria ); + long GetStatus ( ); + long GetState ( ); + _Recordset_DeprecatedPtr _xClone ( ); + HRESULT UpdateBatch ( + enum AffectEnum AffectRecords ); + HRESULT CancelBatch ( + enum AffectEnum AffectRecords ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + _Recordset_DeprecatedPtr NextRecordset ( + VARIANT * RecordsAffected ); + VARIANT_BOOL Supports ( + enum CursorOptionEnum CursorOptions ); + _variant_t GetCollect ( + const _variant_t & Index ); + void PutCollect ( + const _variant_t & Index, + const _variant_t & pvar ); + enum MarshalOptionsEnum GetMarshalOptions ( ); + void PutMarshalOptions ( + enum MarshalOptionsEnum peMarshal ); + HRESULT Find ( + _bstr_t Criteria, + ADO_LONGPTR SkipRecords, + enum SearchDirectionEnum SearchDirection, + const _variant_t & Start = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_AbsolutePosition ( + /*[out,retval]*/ PositionEnum_Param * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePosition ( + /*[in]*/ PositionEnum_Param pl ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_BOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Bookmark ( + /*[out,retval]*/ VARIANT * pvBookmark ) = 0; + virtual HRESULT __stdcall put_Bookmark ( + /*[in]*/ VARIANT pvBookmark ) = 0; + virtual HRESULT __stdcall get_CacheSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CacheSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_CursorType ( + /*[out,retval]*/ enum CursorTypeEnum * plCursorType ) = 0; + virtual HRESULT __stdcall put_CursorType ( + /*[in]*/ enum CursorTypeEnum plCursorType ) = 0; + virtual HRESULT __stdcall get_adoEOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall get_LockType ( + /*[out,retval]*/ enum LockTypeEnum * plLockType ) = 0; + virtual HRESULT __stdcall put_LockType ( + /*[in]*/ enum LockTypeEnum plLockType ) = 0; + virtual HRESULT __stdcall get_MaxRecords ( + /*[out,retval]*/ ADO_LONGPTR * plMaxRecords ) = 0; + virtual HRESULT __stdcall put_MaxRecords ( + /*[in]*/ ADO_LONGPTR plMaxRecords ) = 0; + virtual HRESULT __stdcall get_RecordCount ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvSource ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvSource ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvSource ) = 0; + virtual HRESULT __stdcall raw_AddNew ( + /*[in]*/ VARIANT FieldList = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_GetRows ( + /*[in]*/ long Rows, + /*[in]*/ VARIANT Start, + /*[in]*/ VARIANT Fields, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall raw_Move ( + /*[in]*/ ADO_LONGPTR NumRecords, + /*[in]*/ VARIANT Start = vtMissing ) = 0; + virtual HRESULT __stdcall raw_MoveNext ( ) = 0; + virtual HRESULT __stdcall raw_MovePrevious ( ) = 0; + virtual HRESULT __stdcall raw_MoveFirst ( ) = 0; + virtual HRESULT __stdcall raw_MoveLast ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum CursorTypeEnum CursorType, + /*[in]*/ enum LockTypeEnum LockType, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw_Requery ( + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw__xResync ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_Update ( + /*[in]*/ VARIANT Fields = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall get_AbsolutePage ( + /*[out,retval]*/ PositionEnum_Param * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePage ( + /*[in]*/ PositionEnum_Param pl ) = 0; + virtual HRESULT __stdcall get_EditMode ( + /*[out,retval]*/ enum EditModeEnum * pl ) = 0; + virtual HRESULT __stdcall get_Filter ( + /*[out,retval]*/ VARIANT * Criteria ) = 0; + virtual HRESULT __stdcall put_Filter ( + /*[in]*/ VARIANT Criteria ) = 0; + virtual HRESULT __stdcall get_PageCount ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_PageSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_PageSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Sort ( + /*[out,retval]*/ BSTR * Criteria ) = 0; + virtual HRESULT __stdcall put_Sort ( + /*[in]*/ BSTR Criteria ) = 0; + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw__xClone ( + /*[out,retval]*/ struct _Recordset_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_UpdateBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_CancelBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall raw_NextRecordset ( + /*[out]*/ VARIANT * RecordsAffected, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_Supports ( + /*[in]*/ enum CursorOptionEnum CursorOptions, + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Collect ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Collect ( + /*[in]*/ VARIANT Index, + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_MarshalOptions ( + /*[out,retval]*/ enum MarshalOptionsEnum * peMarshal ) = 0; + virtual HRESULT __stdcall put_MarshalOptions ( + /*[in]*/ enum MarshalOptionsEnum peMarshal ) = 0; + virtual HRESULT __stdcall raw_Find ( + /*[in]*/ BSTR Criteria, + /*[in]*/ ADO_LONGPTR SkipRecords, + /*[in]*/ enum SearchDirectionEnum SearchDirection, + /*[in]*/ VARIANT Start = vtMissing ) = 0; +}; + +struct __declspec(uuid("0000054f-0000-0010-8000-00aa006d2ea4")) +Recordset20_Deprecated : Recordset15_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetDataSource,put=PutRefDataSource)) + IUnknownPtr DataSource; + __declspec(property(get=GetActiveCommand)) + IDispatchPtr ActiveCommand; + __declspec(property(get=GetStayInSync,put=PutStayInSync)) + VARIANT_BOOL StayInSync; + __declspec(property(get=GetDataMember,put=PutDataMember)) + _bstr_t DataMember; + + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + IUnknownPtr GetDataSource ( ); + void PutRefDataSource ( + IUnknown * ppunkDataSource ); + HRESULT _xSave ( + _bstr_t FileName, + enum PersistFormatEnum PersistFormat ); + IDispatchPtr GetActiveCommand ( ); + void PutStayInSync ( + VARIANT_BOOL pbStayInSync ); + VARIANT_BOOL GetStayInSync ( ); + _bstr_t GetString ( + enum StringFormatEnum StringFormat, + long NumRows, + _bstr_t ColumnDelimeter, + _bstr_t RowDelimeter, + _bstr_t NullExpr ); + _bstr_t GetDataMember ( ); + void PutDataMember ( + _bstr_t pbstrDataMember ); + enum CompareEnum CompareBookmarks ( + const _variant_t & Bookmark1, + const _variant_t & Bookmark2 ); + _Recordset_DeprecatedPtr Clone ( + enum LockTypeEnum LockType ); + HRESULT Resync ( + enum AffectEnum AffectRecords, + enum ResyncEnum ResyncValues ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; + virtual HRESULT __stdcall get_DataSource ( + /*[out,retval]*/ IUnknown * * ppunkDataSource ) = 0; + virtual HRESULT __stdcall putref_DataSource ( + /*[in]*/ IUnknown * ppunkDataSource ) = 0; + virtual HRESULT __stdcall raw__xSave ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; + virtual HRESULT __stdcall get_ActiveCommand ( + /*[out,retval]*/ IDispatch * * ppCmd ) = 0; + virtual HRESULT __stdcall put_StayInSync ( + /*[in]*/ VARIANT_BOOL pbStayInSync ) = 0; + virtual HRESULT __stdcall get_StayInSync ( + /*[out,retval]*/ VARIANT_BOOL * pbStayInSync ) = 0; + virtual HRESULT __stdcall raw_GetString ( + /*[in]*/ enum StringFormatEnum StringFormat, + /*[in]*/ long NumRows, + /*[in]*/ BSTR ColumnDelimeter, + /*[in]*/ BSTR RowDelimeter, + /*[in]*/ BSTR NullExpr, + /*[out,retval]*/ BSTR * pRetString ) = 0; + virtual HRESULT __stdcall get_DataMember ( + /*[out,retval]*/ BSTR * pbstrDataMember ) = 0; + virtual HRESULT __stdcall put_DataMember ( + /*[in]*/ BSTR pbstrDataMember ) = 0; + virtual HRESULT __stdcall raw_CompareBookmarks ( + /*[in]*/ VARIANT Bookmark1, + /*[in]*/ VARIANT Bookmark2, + /*[out,retval]*/ enum CompareEnum * pCompare ) = 0; + virtual HRESULT __stdcall raw_Clone ( + /*[in]*/ enum LockTypeEnum LockType, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum AffectEnum AffectRecords, + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; +}; + +struct __declspec(uuid("00000555-0000-0010-8000-00aa006d2ea4")) +Recordset21_Deprecated : Recordset20_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetIndex,put=PutIndex)) + _bstr_t Index; + + // + // Wrapper methods for error-handling + // + + HRESULT Seek ( + const _variant_t & KeyValues, + enum SeekEnum SeekOption ); + void PutIndex ( + _bstr_t pbstrIndex ); + _bstr_t GetIndex ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Seek ( + /*[in]*/ VARIANT KeyValues, + /*[in]*/ enum SeekEnum SeekOption ) = 0; + virtual HRESULT __stdcall put_Index ( + /*[in]*/ BSTR pbstrIndex ) = 0; + virtual HRESULT __stdcall get_Index ( + /*[out,retval]*/ BSTR * pbstrIndex ) = 0; +}; + +struct __declspec(uuid("00000556-0000-0010-8000-00aa006d2ea4")) +_Recordset_Deprecated : Recordset21_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT Save ( + const _variant_t & Destination, + enum PersistFormatEnum PersistFormat ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Save ( + /*[in]*/ VARIANT Destination, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; +}; + +struct __declspec(uuid("00000508-0000-0010-8000-00aa006d2ea4")) +Command15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetParameters)) + Parameters_DeprecatedPtr Parameters; + __declspec(property(get=GetActiveConnection,put=PutRefActiveConnection)) + _Connection_DeprecatedPtr ActiveConnection; + __declspec(property(get=GetCommandText,put=PutCommandText)) + _bstr_t CommandText; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetPrepared,put=PutPrepared)) + VARIANT_BOOL Prepared; + __declspec(property(get=GetCommandType,put=PutCommandType)) + enum CommandTypeEnum CommandType; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + + // + // Wrapper methods for error-handling + // + + _Connection_DeprecatedPtr GetActiveConnection ( ); + void PutRefActiveConnection ( + struct _Connection_Deprecated * ppvObject ); + void PutActiveConnection ( + const _variant_t & ppvObject ); + _bstr_t GetCommandText ( ); + void PutCommandText ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long pl ); + VARIANT_BOOL GetPrepared ( ); + void PutPrepared ( + VARIANT_BOOL pfPrepared ); + _Recordset_DeprecatedPtr Execute ( + VARIANT * RecordsAffected, + VARIANT * Parameters, + long Options ); + _Parameter_DeprecatedPtr CreateParameter ( + _bstr_t Name, + enum DataTypeEnum Type, + enum ParameterDirectionEnum Direction, + ADO_LONGPTR Size, + const _variant_t & Value = vtMissing ); + Parameters_DeprecatedPtr GetParameters ( ); + void PutCommandType ( + enum CommandTypeEnum plCmdType ); + enum CommandTypeEnum GetCommandType ( ); + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstrName ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ struct _Connection_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection_Deprecated * ppvObject ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT ppvObject ) = 0; + virtual HRESULT __stdcall get_CommandText ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_CommandText ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Prepared ( + /*[out,retval]*/ VARIANT_BOOL * pfPrepared ) = 0; + virtual HRESULT __stdcall put_Prepared ( + /*[in]*/ VARIANT_BOOL pfPrepared ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ VARIANT * Parameters, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_CreateParameter ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ enum ParameterDirectionEnum Direction, + /*[in]*/ ADO_LONGPTR Size, + /*[in]*/ VARIANT Value, + /*[out,retval]*/ struct _Parameter_Deprecated * * ppiprm ) = 0; + virtual HRESULT __stdcall get_Parameters ( + /*[out,retval]*/ struct Parameters_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall put_CommandType ( + /*[in]*/ enum CommandTypeEnum plCmdType ) = 0; + virtual HRESULT __stdcall get_CommandType ( + /*[out,retval]*/ enum CommandTypeEnum * plCmdType ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstrName ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstrName ) = 0; +}; + +struct __declspec(uuid("0000054e-0000-0010-8000-00aa006d2ea4")) +Command25_Deprecated : Command15_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + long GetState ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("b08400bd-f9d1-4d02-b856-71d5dba123e9")) +_Command_Deprecated : Command25_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetDialect,put=PutDialect)) + _bstr_t Dialect; + __declspec(property(get=GetNamedParameters,put=PutNamedParameters)) + VARIANT_BOOL NamedParameters; + + // + // Wrapper methods for error-handling + // + + void PutRefCommandStream ( + IUnknown * pvStream ); + _variant_t GetCommandStream ( ); + void PutDialect ( + _bstr_t pbstrDialect ); + _bstr_t GetDialect ( ); + void PutNamedParameters ( + VARIANT_BOOL pfNamedParameters ); + VARIANT_BOOL GetNamedParameters ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall putref_CommandStream ( + /*[in]*/ IUnknown * pvStream ) = 0; + virtual HRESULT __stdcall get_CommandStream ( + /*[out,retval]*/ VARIANT * pvStream ) = 0; + virtual HRESULT __stdcall put_Dialect ( + /*[in]*/ BSTR pbstrDialect ) = 0; + virtual HRESULT __stdcall get_Dialect ( + /*[out,retval]*/ BSTR * pbstrDialect ) = 0; + virtual HRESULT __stdcall put_NamedParameters ( + /*[in]*/ VARIANT_BOOL pfNamedParameters ) = 0; + virtual HRESULT __stdcall get_NamedParameters ( + /*[out,retval]*/ VARIANT_BOOL * pfNamedParameters ) = 0; +}; + +struct __declspec(uuid("00000403-0000-0010-8000-00aa006d2ea4")) +RecordsetEventsVt_Deprecated : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_WillChangeField ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FieldChangeComplete ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecord ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecordset ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordsetChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillMove ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_MoveComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_EndOfRecordset ( + /*[in,out]*/ VARIANT_BOOL * fMoreData, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchProgress ( + /*[in]*/ long Progress, + /*[in]*/ long MaxProgress, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; +}; + +struct __declspec(uuid("00000562-0000-0010-8000-00aa006d2ea4")) +_Record_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + Fields_DeprecatedPtr Fields; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetParentURL)) + _bstr_t ParentURL; + __declspec(property(get=GetRecordType)) + enum RecordTypeEnum RecordType; + + // + // Wrapper methods for error-handling + // + + _variant_t GetActiveConnection ( ); + void PutActiveConnection ( + _bstr_t pvar ); + void PutRefActiveConnection ( + struct _Connection_Deprecated * pvar ); + enum ObjectStateEnum GetState ( ); + _variant_t GetSource ( ); + void PutSource ( + _bstr_t pvar ); + void PutRefSource ( + IDispatch * pvar ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetParentURL ( ); + _bstr_t MoveRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum MoveRecordOptionsEnum Options, + VARIANT_BOOL Async ); + _bstr_t CopyRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum CopyRecordOptionsEnum Options, + VARIANT_BOOL Async ); + HRESULT DeleteRecord ( + _bstr_t Source, + VARIANT_BOOL Async ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum ConnectModeEnum Mode, + enum RecordCreateOptionsEnum CreateOptions, + enum RecordOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + Fields_DeprecatedPtr GetFields ( ); + enum RecordTypeEnum GetRecordType ( ); + _Recordset_DeprecatedPtr GetChildren ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection_Deprecated * pvar ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_ParentURL ( + /*[out,retval]*/ BSTR * pbstrParentURL ) = 0; + virtual HRESULT __stdcall raw_MoveRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum MoveRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_CopyRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum CopyRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_DeleteRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ VARIANT_BOOL Async ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum RecordCreateOptionsEnum CreateOptions, + /*[in]*/ enum RecordOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields_Deprecated * * ppFlds ) = 0; + virtual HRESULT __stdcall get_RecordType ( + /*[out,retval]*/ enum RecordTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall raw_GetChildren ( + /*[out,retval]*/ struct _Recordset_Deprecated * * pprset ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +// +// Wrapper method implementations +// + +#include "D:\source\联德\itk\ld_itk(1)\connor_signature\x64\Release\msado15.tli" + +#pragma pack(pop) diff --git a/connor_signature/x64/Release/msado15.tli b/connor_signature/x64/Release/msado15.tli new file mode 100644 index 0000000..3a88ee4 --- /dev/null +++ b/connor_signature/x64/Release/msado15.tli @@ -0,0 +1,3952 @@ +// Created by Microsoft (R) C/C++ Compiler Version 14.29.30151.0 (073fa26b). +// +// D:\source\联德\itk\ld_itk(1)\connor_signature\x64\Release\msado15.tli +// +// Wrapper implementations for type library C:/Program Files/Common Files/System/ado/msado15.dll +// compiler-generated file created 01/13/25 at 10:58:00 - DO NOT EDIT! + +#pragma once + +// +// interface _Collection wrapper method implementations +// + +inline long _Collection::GetCount ( ) { + long _result = 0; + HRESULT _hr = get_Count(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline IUnknownPtr _Collection::_NewEnum ( ) { + IUnknown * _result = 0; + HRESULT _hr = raw__NewEnum(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline HRESULT _Collection::Refresh ( ) { + HRESULT _hr = raw_Refresh(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _DynaCollection wrapper method implementations +// + +inline HRESULT _DynaCollection::Append ( IDispatch * Object ) { + HRESULT _hr = raw_Append(Object); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _DynaCollection::Delete ( const _variant_t & Index ) { + HRESULT _hr = raw_Delete(Index); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Property wrapper method implementations +// + +inline _variant_t Property::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Property::PutValue ( const _variant_t & pval ) { + HRESULT _hr = put_Value(pval); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Property::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Property::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Property::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Property::PutAttributes ( long plAttributes ) { + HRESULT _hr = put_Attributes(plAttributes); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Properties wrapper method implementations +// + +inline PropertyPtr Properties::GetItem ( const _variant_t & Index ) { + struct Property * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return PropertyPtr(_result, false); +} + +// +// interface _ADO wrapper method implementations +// + +inline PropertiesPtr _ADO::GetProperties ( ) { + struct Properties * _result = 0; + HRESULT _hr = get_Properties(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return PropertiesPtr(_result, false); +} + +// +// interface Error wrapper method implementations +// + +inline long Error::GetNumber ( ) { + long _result = 0; + HRESULT _hr = get_Number(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Error::GetSource ( ) { + BSTR _result = 0; + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Error::GetDescription ( ) { + BSTR _result = 0; + HRESULT _hr = get_Description(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Error::GetHelpFile ( ) { + BSTR _result = 0; + HRESULT _hr = get_HelpFile(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline long Error::GetHelpContext ( ) { + long _result = 0; + HRESULT _hr = get_HelpContext(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Error::GetSQLState ( ) { + BSTR _result = 0; + HRESULT _hr = get_SQLState(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline long Error::GetNativeError ( ) { + long _result = 0; + HRESULT _hr = get_NativeError(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Errors wrapper method implementations +// + +inline ErrorPtr Errors::GetItem ( const _variant_t & Index ) { + struct Error * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ErrorPtr(_result, false); +} + +inline HRESULT Errors::Clear ( ) { + HRESULT _hr = raw_Clear(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Field20 wrapper method implementations +// + +inline long Field20::GetActualSize ( ) { + long _result = 0; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field20::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field20::GetDefinedSize ( ) { + long _result = 0; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field20::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field20::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field20::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field20::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field20::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field20::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field20::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field20::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline IUnknownPtr Field20::GetDataFormat ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataFormat(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Field20::PutRefDataFormat ( IUnknown * ppiDF ) { + HRESULT _hr = putref_DataFormat(ppiDF); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutNumericScale ( unsigned char pbNumericScale ) { + HRESULT _hr = put_NumericScale(pbNumericScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutType ( enum DataTypeEnum pDataType ) { + HRESULT _hr = put_Type(pDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutDefinedSize ( long pl ) { + HRESULT _hr = put_DefinedSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutAttributes ( long pl ) { + HRESULT _hr = put_Attributes(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Field wrapper method implementations +// + +inline long Field::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Fields15 wrapper method implementations +// + +inline FieldPtr Fields15::GetItem ( const _variant_t & Index ) { + struct Field * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return FieldPtr(_result, false); +} + +// +// interface Fields20 wrapper method implementations +// + +inline HRESULT Fields20::_Append ( _bstr_t Name, enum DataTypeEnum Type, long DefinedSize, enum FieldAttributeEnum Attrib ) { + HRESULT _hr = raw__Append(Name, Type, DefinedSize, Attrib); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields20::Delete ( const _variant_t & Index ) { + HRESULT _hr = raw_Delete(Index); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Fields wrapper method implementations +// + +inline HRESULT Fields::Append ( _bstr_t Name, enum DataTypeEnum Type, long DefinedSize, enum FieldAttributeEnum Attrib, const _variant_t & FieldValue ) { + HRESULT _hr = raw_Append(Name, Type, DefinedSize, Attrib, FieldValue); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields::Update ( ) { + HRESULT _hr = raw_Update(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields::Resync ( enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Parameter wrapper method implementations +// + +inline _bstr_t _Parameter::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Parameter::PutName ( _bstr_t pbstr ) { + HRESULT _hr = put_Name(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Parameter::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Parameter::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum DataTypeEnum _Parameter::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutType ( enum DataTypeEnum psDataType ) { + HRESULT _hr = put_Type(psDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Parameter::PutDirection ( enum ParameterDirectionEnum plParmDirection ) { + HRESULT _hr = put_Direction(plParmDirection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ParameterDirectionEnum _Parameter::GetDirection ( ) { + enum ParameterDirectionEnum _result; + HRESULT _hr = get_Direction(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutNumericScale ( unsigned char pbScale ) { + HRESULT _hr = put_NumericScale(pbScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutSize ( long pl ) { + HRESULT _hr = put_Size(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long _Parameter::GetSize ( ) { + long _result = 0; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT _Parameter::AppendChunk ( const _variant_t & Val ) { + HRESULT _hr = raw_AppendChunk(Val); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline long _Parameter::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutAttributes ( long plParmAttribs ) { + HRESULT _hr = put_Attributes(plParmAttribs); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Parameters wrapper method implementations +// + +inline _ParameterPtr Parameters::GetItem ( const _variant_t & Index ) { + struct _Parameter * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _ParameterPtr(_result, false); +} + +// +// dispinterface ConnectionEvents wrapper method implementations +// + +inline HRESULT ConnectionEvents::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x0, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x1, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", TransactionLevel, pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x3, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x2, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x4, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4003\x4003\x4003\x4003\x0009\x0009\x0009", Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x5, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009\x0009\x0009", RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x6, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4008\x4008\x4003\x4003\x0009", ConnectionString, UserID, Password, Options, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x7, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x8, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4003\x0009", adStatus, pConnection); + return _result; +} + +// +// dispinterface RecordsetEvents wrapper method implementations +// + +inline HRESULT RecordsetEvents::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x9, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x4003\x0009", cFields, &Fields, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xa, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x0009\x4003\x0009", cFields, &Fields, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xb, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", adReason, cRecords, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xc, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x0009\x4003\x0009", adReason, cRecords, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xd, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xe, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xf, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x10, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x11, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x400b\x4003\x0009", fMoreData, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x12, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", Progress, MaxProgress, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x13, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pRecordset); + return _result; +} + +// +// interface ADOConnectionConstruction15 wrapper method implementations +// + +inline IUnknownPtr ADOConnectionConstruction15::GetDSO ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DSO(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline IUnknownPtr ADOConnectionConstruction15::GetSession ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Session(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline HRESULT ADOConnectionConstruction15::WrapDSOandSession ( IUnknown * pDSO, IUnknown * pSession ) { + HRESULT _hr = raw_WrapDSOandSession(pDSO, pSession); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Stream wrapper method implementations +// + +inline long _Stream::GetSize ( ) { + long _result = 0; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline VARIANT_BOOL _Stream::GetEOS ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_EOS(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long _Stream::GetPosition ( ) { + long _result = 0; + HRESULT _hr = get_Position(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutPosition ( long pPos ) { + HRESULT _hr = put_Position(pPos); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum StreamTypeEnum _Stream::GetType ( ) { + enum StreamTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutType ( enum StreamTypeEnum ptype ) { + HRESULT _hr = put_Type(ptype); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum LineSeparatorEnum _Stream::GetLineSeparator ( ) { + enum LineSeparatorEnum _result; + HRESULT _hr = get_LineSeparator(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutLineSeparator ( enum LineSeparatorEnum pLS ) { + HRESULT _hr = put_LineSeparator(pLS); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Stream::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline enum ConnectModeEnum _Stream::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Stream::GetCharset ( ) { + BSTR _result = 0; + HRESULT _hr = get_Charset(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Stream::PutCharset ( _bstr_t pbstrCharset ) { + HRESULT _hr = put_Charset(pbstrCharset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Stream::Read ( long NumBytes ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_Read(NumBytes, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT _Stream::Open ( const _variant_t & Source, enum ConnectModeEnum Mode, enum StreamOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, Mode, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::SkipLine ( ) { + HRESULT _hr = raw_SkipLine(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Write ( const _variant_t & Buffer ) { + HRESULT _hr = raw_Write(Buffer); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::SetEOS ( ) { + HRESULT _hr = raw_SetEOS(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::CopyTo ( struct _Stream * DestStream, long CharNumber ) { + HRESULT _hr = raw_CopyTo(DestStream, CharNumber); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Flush ( ) { + HRESULT _hr = raw_Flush(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::SaveToFile ( _bstr_t FileName, enum SaveOptionsEnum Options ) { + HRESULT _hr = raw_SaveToFile(FileName, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::LoadFromFile ( _bstr_t FileName ) { + HRESULT _hr = raw_LoadFromFile(FileName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _bstr_t _Stream::ReadText ( long NumChars ) { + BSTR _result = 0; + HRESULT _hr = raw_ReadText(NumChars, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Stream::WriteText ( _bstr_t Data, enum StreamWriteEnum Options ) { + HRESULT _hr = raw_WriteText(Data, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface ADORecordConstruction wrapper method implementations +// + +inline IUnknownPtr ADORecordConstruction::GetRow ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Row(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADORecordConstruction::PutRow ( IUnknown * ppRow ) { + HRESULT _hr = put_Row(ppRow); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void ADORecordConstruction::PutParentRow ( IUnknown * _arg1 ) { + HRESULT _hr = put_ParentRow(_arg1); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface ADOStreamConstruction wrapper method implementations +// + +inline IUnknownPtr ADOStreamConstruction::GetStream ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Stream(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADOStreamConstruction::PutStream ( IUnknown * ppStm ) { + HRESULT _hr = put_Stream(ppStm); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface ADOCommandConstruction wrapper method implementations +// + +inline IUnknownPtr ADOCommandConstruction::GetOLEDBCommand ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_OLEDBCommand(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADOCommandConstruction::PutOLEDBCommand ( IUnknown * ppOLEDBCommand ) { + HRESULT _hr = put_OLEDBCommand(ppOLEDBCommand); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface ADORecordsetConstruction wrapper method implementations +// + +inline IUnknownPtr ADORecordsetConstruction::GetRowset ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Rowset(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADORecordsetConstruction::PutRowset ( IUnknown * ppRowset ) { + HRESULT _hr = put_Rowset(ppRowset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR ADORecordsetConstruction::GetChapter ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Chapter(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void ADORecordsetConstruction::PutChapter ( ADO_LONGPTR plChapter ) { + HRESULT _hr = put_Chapter(plChapter); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline IUnknownPtr ADORecordsetConstruction::GetRowPosition ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_RowPosition(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADORecordsetConstruction::PutRowPosition ( IUnknown * ppRowPos ) { + HRESULT _hr = put_RowPosition(ppRowPos); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Field15 wrapper method implementations +// + +inline long Field15::GetActualSize ( ) { + long _result = 0; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field15::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field15::GetDefinedSize ( ) { + long _result = 0; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field15::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field15::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field15::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field15::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field15::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field15::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field15::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field15::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +// +// interface Field20_Deprecated wrapper method implementations +// + +inline ADO_LONGPTR Field20_Deprecated::GetActualSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field20_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline ADO_LONGPTR Field20_Deprecated::GetDefinedSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field20_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field20_Deprecated::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field20_Deprecated::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field20_Deprecated::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field20_Deprecated::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field20_Deprecated::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field20_Deprecated::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field20_Deprecated::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20_Deprecated::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20_Deprecated::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline IUnknownPtr Field20_Deprecated::GetDataFormat ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataFormat(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Field20_Deprecated::PutRefDataFormat ( IUnknown * ppiDF ) { + HRESULT _hr = putref_DataFormat(ppiDF); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutNumericScale ( unsigned char pbNumericScale ) { + HRESULT _hr = put_NumericScale(pbNumericScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutType ( enum DataTypeEnum pDataType ) { + HRESULT _hr = put_Type(pDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutDefinedSize ( ADO_LONGPTR pl ) { + HRESULT _hr = put_DefinedSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutAttributes ( long pl ) { + HRESULT _hr = put_Attributes(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Field_Deprecated wrapper method implementations +// + +inline long Field_Deprecated::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Fields15_Deprecated wrapper method implementations +// + +inline Field_DeprecatedPtr Fields15_Deprecated::GetItem ( const _variant_t & Index ) { + struct Field_Deprecated * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Field_DeprecatedPtr(_result, false); +} + +// +// interface Fields20_Deprecated wrapper method implementations +// + +inline HRESULT Fields20_Deprecated::_Append ( _bstr_t Name, enum DataTypeEnum Type, ADO_LONGPTR DefinedSize, enum FieldAttributeEnum Attrib ) { + HRESULT _hr = raw__Append(Name, Type, DefinedSize, Attrib); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields20_Deprecated::Delete ( const _variant_t & Index ) { + HRESULT _hr = raw_Delete(Index); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Fields_Deprecated wrapper method implementations +// + +inline HRESULT Fields_Deprecated::Append ( _bstr_t Name, enum DataTypeEnum Type, ADO_LONGPTR DefinedSize, enum FieldAttributeEnum Attrib, const _variant_t & FieldValue ) { + HRESULT _hr = raw_Append(Name, Type, DefinedSize, Attrib, FieldValue); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields_Deprecated::Update ( ) { + HRESULT _hr = raw_Update(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields_Deprecated::Resync ( enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields_Deprecated::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Parameter_Deprecated wrapper method implementations +// + +inline _bstr_t _Parameter_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Parameter_Deprecated::PutName ( _bstr_t pbstr ) { + HRESULT _hr = put_Name(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Parameter_Deprecated::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Parameter_Deprecated::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum DataTypeEnum _Parameter_Deprecated::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutType ( enum DataTypeEnum psDataType ) { + HRESULT _hr = put_Type(psDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Parameter_Deprecated::PutDirection ( enum ParameterDirectionEnum plParmDirection ) { + HRESULT _hr = put_Direction(plParmDirection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ParameterDirectionEnum _Parameter_Deprecated::GetDirection ( ) { + enum ParameterDirectionEnum _result; + HRESULT _hr = get_Direction(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter_Deprecated::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutNumericScale ( unsigned char pbScale ) { + HRESULT _hr = put_NumericScale(pbScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter_Deprecated::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutSize ( ADO_LONGPTR pl ) { + HRESULT _hr = put_Size(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR _Parameter_Deprecated::GetSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT _Parameter_Deprecated::AppendChunk ( const _variant_t & Val ) { + HRESULT _hr = raw_AppendChunk(Val); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline long _Parameter_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutAttributes ( long plParmAttribs ) { + HRESULT _hr = put_Attributes(plParmAttribs); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Parameters_Deprecated wrapper method implementations +// + +inline _Parameter_DeprecatedPtr Parameters_Deprecated::GetItem ( const _variant_t & Index ) { + struct _Parameter_Deprecated * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Parameter_DeprecatedPtr(_result, false); +} + +// +// dispinterface ConnectionEvents_Deprecated wrapper method implementations +// + +inline HRESULT ConnectionEvents_Deprecated::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x0, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x1, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", TransactionLevel, pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x3, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x2, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x4, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4003\x4003\x4003\x4003\x0009\x0009\x0009", Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x5, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009\x0009\x0009", RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x6, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4008\x4008\x4003\x4003\x0009", ConnectionString, UserID, Password, Options, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x7, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x8, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4003\x0009", adStatus, pConnection); + return _result; +} + +// +// dispinterface RecordsetEvents_Deprecated wrapper method implementations +// + +inline HRESULT RecordsetEvents_Deprecated::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x9, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x4003\x0009", cFields, &Fields, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xa, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x0009\x4003\x0009", cFields, &Fields, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xb, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", adReason, cRecords, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xc, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x0009\x4003\x0009", adReason, cRecords, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xd, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xe, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xf, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x10, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x11, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x400b\x4003\x0009", fMoreData, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x12, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", Progress, MaxProgress, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x13, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pRecordset); + return _result; +} + +// +// interface _Stream_Deprecated wrapper method implementations +// + +inline ADO_LONGPTR _Stream_Deprecated::GetSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline VARIANT_BOOL _Stream_Deprecated::GetEOS ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_EOS(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline ADO_LONGPTR _Stream_Deprecated::GetPosition ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Position(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutPosition ( ADO_LONGPTR pPos ) { + HRESULT _hr = put_Position(pPos); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum StreamTypeEnum _Stream_Deprecated::GetType ( ) { + enum StreamTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutType ( enum StreamTypeEnum ptype ) { + HRESULT _hr = put_Type(ptype); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum LineSeparatorEnum _Stream_Deprecated::GetLineSeparator ( ) { + enum LineSeparatorEnum _result; + HRESULT _hr = get_LineSeparator(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutLineSeparator ( enum LineSeparatorEnum pLS ) { + HRESULT _hr = put_LineSeparator(pLS); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Stream_Deprecated::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline enum ConnectModeEnum _Stream_Deprecated::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Stream_Deprecated::GetCharset ( ) { + BSTR _result = 0; + HRESULT _hr = get_Charset(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Stream_Deprecated::PutCharset ( _bstr_t pbstrCharset ) { + HRESULT _hr = put_Charset(pbstrCharset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Stream_Deprecated::Read ( long NumBytes ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_Read(NumBytes, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT _Stream_Deprecated::Open ( const _variant_t & Source, enum ConnectModeEnum Mode, enum StreamOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, Mode, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::SkipLine ( ) { + HRESULT _hr = raw_SkipLine(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Write ( const _variant_t & Buffer ) { + HRESULT _hr = raw_Write(Buffer); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::SetEOS ( ) { + HRESULT _hr = raw_SetEOS(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::CopyTo ( struct _Stream_Deprecated * DestStream, ADO_LONGPTR CharNumber ) { + HRESULT _hr = raw_CopyTo(DestStream, CharNumber); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Flush ( ) { + HRESULT _hr = raw_Flush(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::SaveToFile ( _bstr_t FileName, enum SaveOptionsEnum Options ) { + HRESULT _hr = raw_SaveToFile(FileName, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::LoadFromFile ( _bstr_t FileName ) { + HRESULT _hr = raw_LoadFromFile(FileName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _bstr_t _Stream_Deprecated::ReadText ( long NumChars ) { + BSTR _result = 0; + HRESULT _hr = raw_ReadText(NumChars, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Stream_Deprecated::WriteText ( _bstr_t Data, enum StreamWriteEnum Options ) { + HRESULT _hr = raw_WriteText(Data, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Field15_Deprecated wrapper method implementations +// + +inline ADO_LONGPTR Field15_Deprecated::GetActualSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field15_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline ADO_LONGPTR Field15_Deprecated::GetDefinedSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field15_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field15_Deprecated::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field15_Deprecated::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field15_Deprecated::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field15_Deprecated::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field15_Deprecated::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field15_Deprecated::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field15_Deprecated::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15_Deprecated::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15_Deprecated::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +// +// interface Command15 wrapper method implementations +// + +inline _ConnectionPtr Command15::GetActiveConnection ( ) { + struct _Connection * _result = 0; + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _ConnectionPtr(_result, false); +} + +inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) { + HRESULT _hr = putref_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Command15::PutActiveConnection ( const _variant_t & ppvObject ) { + HRESULT _hr = put_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Command15::GetCommandText ( ) { + BSTR _result = 0; + HRESULT _hr = get_CommandText(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15::PutCommandText ( _bstr_t pbstr ) { + HRESULT _hr = put_CommandText(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Command15::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15::PutCommandTimeout ( long pl ) { + HRESULT _hr = put_CommandTimeout(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Command15::GetPrepared ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_Prepared(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15::PutPrepared ( VARIANT_BOOL pfPrepared ) { + HRESULT _hr = put_Prepared(pfPrepared); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline _ParameterPtr Command15::CreateParameter ( _bstr_t Name, enum DataTypeEnum Type, enum ParameterDirectionEnum Direction, long Size, const _variant_t & Value ) { + struct _Parameter * _result = 0; + HRESULT _hr = raw_CreateParameter(Name, Type, Direction, Size, Value, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _ParameterPtr(_result, false); +} + +inline ParametersPtr Command15::GetParameters ( ) { + struct Parameters * _result = 0; + HRESULT _hr = get_Parameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ParametersPtr(_result, false); +} + +inline void Command15::PutCommandType ( enum CommandTypeEnum plCmdType ) { + HRESULT _hr = put_CommandType(plCmdType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CommandTypeEnum Command15::GetCommandType ( ) { + enum CommandTypeEnum _result; + HRESULT _hr = get_CommandType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Command15::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15::PutName ( _bstr_t pbstrName ) { + HRESULT _hr = put_Name(pbstrName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Command25 wrapper method implementations +// + +inline long Command25::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Command25::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Command wrapper method implementations +// + +inline void _Command::PutRefCommandStream ( IUnknown * pvStream ) { + HRESULT _hr = putref_CommandStream(pvStream); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Command::GetCommandStream ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_CommandStream(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Command::PutDialect ( _bstr_t pbstrDialect ) { + HRESULT _hr = put_Dialect(pbstrDialect); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Command::GetDialect ( ) { + BSTR _result = 0; + HRESULT _hr = get_Dialect(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Command::PutNamedParameters ( VARIANT_BOOL pfNamedParameters ) { + HRESULT _hr = put_NamedParameters(pfNamedParameters); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL _Command::GetNamedParameters ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_NamedParameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Connection15 wrapper method implementations +// + +inline _bstr_t Connection15::GetConnectionString ( ) { + BSTR _result = 0; + HRESULT _hr = get_ConnectionString(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15::PutConnectionString ( _bstr_t pbstr ) { + HRESULT _hr = put_ConnectionString(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutCommandTimeout ( long plTimeout ) { + HRESULT _hr = put_CommandTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetConnectionTimeout ( ) { + long _result = 0; + HRESULT _hr = get_ConnectionTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutConnectionTimeout ( long plTimeout ) { + HRESULT _hr = put_ConnectionTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15::GetVersion ( ) { + BSTR _result = 0; + HRESULT _hr = get_Version(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT Connection15::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _RecordsetPtr Connection15::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline long Connection15::BeginTrans ( ) { + long _result = 0; + HRESULT _hr = raw_BeginTrans(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Connection15::CommitTrans ( ) { + HRESULT _hr = raw_CommitTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15::RollbackTrans ( ) { + HRESULT _hr = raw_RollbackTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15::Open ( _bstr_t ConnectionString, _bstr_t UserID, _bstr_t Password, long Options ) { + HRESULT _hr = raw_Open(ConnectionString, UserID, Password, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline ErrorsPtr Connection15::GetErrors ( ) { + struct Errors * _result = 0; + HRESULT _hr = get_Errors(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ErrorsPtr(_result, false); +} + +inline _bstr_t Connection15::GetDefaultDatabase ( ) { + BSTR _result = 0; + HRESULT _hr = get_DefaultDatabase(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15::PutDefaultDatabase ( _bstr_t pbstr ) { + HRESULT _hr = put_DefaultDatabase(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum IsolationLevelEnum Connection15::GetIsolationLevel ( ) { + enum IsolationLevelEnum _result; + HRESULT _hr = get_IsolationLevel(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutIsolationLevel ( enum IsolationLevelEnum Level ) { + HRESULT _hr = put_IsolationLevel(Level); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutAttributes ( long plAttr ) { + HRESULT _hr = put_Attributes(plAttr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorLocationEnum Connection15::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum Connection15::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutMode ( enum ConnectModeEnum plMode ) { + HRESULT _hr = put_Mode(plMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15::GetProvider ( ) { + BSTR _result = 0; + HRESULT _hr = get_Provider(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15::PutProvider ( _bstr_t pbstr ) { + HRESULT _hr = put_Provider(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr Connection15::OpenSchema ( enum SchemaEnum Schema, const _variant_t & Restrictions, const _variant_t & SchemaID ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_OpenSchema(Schema, Restrictions, SchemaID, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +// +// interface _Connection wrapper method implementations +// + +inline HRESULT _Connection::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset15 wrapper method implementations +// + +inline enum PositionEnum Recordset15::GetAbsolutePosition ( ) { + enum PositionEnum _result; + HRESULT _hr = get_AbsolutePosition(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutAbsolutePosition ( enum PositionEnum pl ) { + HRESULT _hr = put_AbsolutePosition(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15::PutRefActiveConnection ( IDispatch * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15::PutActiveConnection ( const _variant_t & pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline VARIANT_BOOL Recordset15::GetBOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_BOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15::GetBookmark ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Bookmark(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15::PutBookmark ( const _variant_t & pvBookmark ) { + HRESULT _hr = put_Bookmark(pvBookmark); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetCacheSize ( ) { + long _result = 0; + HRESULT _hr = get_CacheSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutCacheSize ( long pl ) { + HRESULT _hr = put_CacheSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorTypeEnum Recordset15::GetCursorType ( ) { + enum CursorTypeEnum _result; + HRESULT _hr = get_CursorType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutCursorType ( enum CursorTypeEnum plCursorType ) { + HRESULT _hr = put_CursorType(plCursorType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset15::GetadoEOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_adoEOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline FieldsPtr Recordset15::GetFields ( ) { + struct Fields * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return FieldsPtr(_result, false); +} + +inline enum LockTypeEnum Recordset15::GetLockType ( ) { + enum LockTypeEnum _result; + HRESULT _hr = get_LockType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutLockType ( enum LockTypeEnum plLockType ) { + HRESULT _hr = put_LockType(plLockType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetMaxRecords ( ) { + long _result = 0; + HRESULT _hr = get_MaxRecords(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutMaxRecords ( long plMaxRecords ) { + HRESULT _hr = put_MaxRecords(plMaxRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetRecordCount ( ) { + long _result = 0; + HRESULT _hr = get_RecordCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutRefSource ( IDispatch * pvSource ) { + HRESULT _hr = putref_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15::PutSource ( _bstr_t pvSource ) { + HRESULT _hr = put_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15::AddNew ( const _variant_t & FieldList, const _variant_t & Values ) { + HRESULT _hr = raw_AddNew(FieldList, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Delete ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_Delete(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Recordset15::GetRows ( long Rows, const _variant_t & Start, const _variant_t & Fields ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetRows(Rows, Start, Fields, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15::Move ( long NumRecords, const _variant_t & Start ) { + HRESULT _hr = raw_Move(NumRecords, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MoveNext ( ) { + HRESULT _hr = raw_MoveNext(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MovePrevious ( ) { + HRESULT _hr = raw_MovePrevious(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MoveFirst ( ) { + HRESULT _hr = raw_MoveFirst(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MoveLast ( ) { + HRESULT _hr = raw_MoveLast(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum CursorTypeEnum CursorType, enum LockTypeEnum LockType, long Options ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, CursorType, LockType, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Requery ( long Options ) { + HRESULT _hr = raw_Requery(Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::_xResync ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw__xResync(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Update ( const _variant_t & Fields, const _variant_t & Values ) { + HRESULT _hr = raw_Update(Fields, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline enum PositionEnum Recordset15::GetAbsolutePage ( ) { + enum PositionEnum _result; + HRESULT _hr = get_AbsolutePage(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutAbsolutePage ( enum PositionEnum pl ) { + HRESULT _hr = put_AbsolutePage(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum EditModeEnum Recordset15::GetEditMode ( ) { + enum EditModeEnum _result; + HRESULT _hr = get_EditMode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15::GetFilter ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Filter(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15::PutFilter ( const _variant_t & Criteria ) { + HRESULT _hr = put_Filter(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetPageCount ( ) { + long _result = 0; + HRESULT _hr = get_PageCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15::GetPageSize ( ) { + long _result = 0; + HRESULT _hr = get_PageSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutPageSize ( long pl ) { + HRESULT _hr = put_PageSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset15::GetSort ( ) { + BSTR _result = 0; + HRESULT _hr = get_Sort(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset15::PutSort ( _bstr_t Criteria ) { + HRESULT _hr = put_Sort(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr Recordset15::_xClone ( ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw__xClone(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline HRESULT Recordset15::UpdateBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_UpdateBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::CancelBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_CancelBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline enum CursorLocationEnum Recordset15::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _RecordsetPtr Recordset15::NextRecordset ( VARIANT * RecordsAffected ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_NextRecordset(RecordsAffected, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline VARIANT_BOOL Recordset15::Supports ( enum CursorOptionEnum CursorOptions ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = raw_Supports(CursorOptions, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15::GetCollect ( const _variant_t & Index ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Collect(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15::PutCollect ( const _variant_t & Index, const _variant_t & pvar ) { + HRESULT _hr = put_Collect(Index, pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum MarshalOptionsEnum Recordset15::GetMarshalOptions ( ) { + enum MarshalOptionsEnum _result; + HRESULT _hr = get_MarshalOptions(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutMarshalOptions ( enum MarshalOptionsEnum peMarshal ) { + HRESULT _hr = put_MarshalOptions(peMarshal); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset15::Find ( _bstr_t Criteria, long SkipRecords, enum SearchDirectionEnum SearchDirection, const _variant_t & Start ) { + HRESULT _hr = raw_Find(Criteria, SkipRecords, SearchDirection, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset20 wrapper method implementations +// + +inline HRESULT Recordset20::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IUnknownPtr Recordset20::GetDataSource ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataSource(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Recordset20::PutRefDataSource ( IUnknown * ppunkDataSource ) { + HRESULT _hr = putref_DataSource(ppunkDataSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset20::_xSave ( _bstr_t FileName, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw__xSave(FileName, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IDispatchPtr Recordset20::GetActiveCommand ( ) { + IDispatch * _result = 0; + HRESULT _hr = get_ActiveCommand(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IDispatchPtr(_result, false); +} + +inline void Recordset20::PutStayInSync ( VARIANT_BOOL pbStayInSync ) { + HRESULT _hr = put_StayInSync(pbStayInSync); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset20::GetStayInSync ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_StayInSync(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Recordset20::GetString ( enum StringFormatEnum StringFormat, long NumRows, _bstr_t ColumnDelimeter, _bstr_t RowDelimeter, _bstr_t NullExpr ) { + BSTR _result = 0; + HRESULT _hr = raw_GetString(StringFormat, NumRows, ColumnDelimeter, RowDelimeter, NullExpr, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Recordset20::GetDataMember ( ) { + BSTR _result = 0; + HRESULT _hr = get_DataMember(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset20::PutDataMember ( _bstr_t pbstrDataMember ) { + HRESULT _hr = put_DataMember(pbstrDataMember); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CompareEnum Recordset20::CompareBookmarks ( const _variant_t & Bookmark1, const _variant_t & Bookmark2 ) { + enum CompareEnum _result; + HRESULT _hr = raw_CompareBookmarks(Bookmark1, Bookmark2, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr Recordset20::Clone ( enum LockTypeEnum LockType ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_Clone(LockType, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline HRESULT Recordset20::Resync ( enum AffectEnum AffectRecords, enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(AffectRecords, ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset21 wrapper method implementations +// + +inline HRESULT Recordset21::Seek ( const _variant_t & KeyValues, enum SeekEnum SeekOption ) { + HRESULT _hr = raw_Seek(KeyValues, SeekOption); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline void Recordset21::PutIndex ( _bstr_t pbstrIndex ) { + HRESULT _hr = put_Index(pbstrIndex); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset21::GetIndex ( ) { + BSTR _result = 0; + HRESULT _hr = get_Index(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +// +// interface _Recordset wrapper method implementations +// + +inline HRESULT _Recordset::Save ( const _variant_t & Destination, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw_Save(Destination, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface ConnectionEventsVt wrapper method implementations +// + +inline HRESULT ConnectionEventsVt::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_InfoMessage(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_BeginTransComplete(TransactionLevel, pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_CommitTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_RollbackTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _hr = raw_WillExecute(Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _hr = raw_ExecuteComplete(RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_WillConnect(ConnectionString, UserID, Password, Options, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_ConnectComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_Disconnect(adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface RecordsetEventsVt wrapper method implementations +// + +inline HRESULT RecordsetEventsVt::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillChangeField(cFields, Fields, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_FieldChangeComplete(cFields, Fields, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillChangeRecord(adReason, cRecords, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_RecordChangeComplete(adReason, cRecords, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillChangeRecordset(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_RecordsetChangeComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillMove(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_MoveComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_EndOfRecordset(fMoreData, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_FetchProgress(Progress, MaxProgress, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_FetchComplete(pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Record wrapper method implementations +// + +inline _variant_t _Record::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record::PutActiveConnection ( _bstr_t pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record::PutRefActiveConnection ( struct _Connection * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Record::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t _Record::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record::PutSource ( _bstr_t pvar ) { + HRESULT _hr = put_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record::PutRefSource ( IDispatch * pvar ) { + HRESULT _hr = putref_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum _Record::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Record::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Record::GetParentURL ( ) { + BSTR _result = 0; + HRESULT _hr = get_ParentURL(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record::MoveRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum MoveRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_MoveRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record::CopyRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum CopyRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_CopyRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Record::DeleteRecord ( _bstr_t Source, VARIANT_BOOL Async ) { + HRESULT _hr = raw_DeleteRecord(Source, Async); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum ConnectModeEnum Mode, enum RecordCreateOptionsEnum CreateOptions, enum RecordOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, Mode, CreateOptions, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline FieldsPtr _Record::GetFields ( ) { + struct Fields * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return FieldsPtr(_result, false); +} + +inline enum RecordTypeEnum _Record::GetRecordType ( ) { + enum RecordTypeEnum _result; + HRESULT _hr = get_RecordType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr _Record::GetChildren ( ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_GetChildren(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline HRESULT _Record::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface ConnectionEventsVt_Deprecated wrapper method implementations +// + +inline HRESULT ConnectionEventsVt_Deprecated::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_InfoMessage(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_BeginTransComplete(TransactionLevel, pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_CommitTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_RollbackTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_WillExecute(Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_ExecuteComplete(RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_WillConnect(ConnectionString, UserID, Password, Options, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_ConnectComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_Disconnect(adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Connection15_Deprecated wrapper method implementations +// + +inline _bstr_t Connection15_Deprecated::GetConnectionString ( ) { + BSTR _result = 0; + HRESULT _hr = get_ConnectionString(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15_Deprecated::PutConnectionString ( _bstr_t pbstr ) { + HRESULT _hr = put_ConnectionString(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutCommandTimeout ( long plTimeout ) { + HRESULT _hr = put_CommandTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetConnectionTimeout ( ) { + long _result = 0; + HRESULT _hr = get_ConnectionTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutConnectionTimeout ( long plTimeout ) { + HRESULT _hr = put_ConnectionTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15_Deprecated::GetVersion ( ) { + BSTR _result = 0; + HRESULT _hr = get_Version(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT Connection15_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _Recordset_DeprecatedPtr Connection15_Deprecated::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline long Connection15_Deprecated::BeginTrans ( ) { + long _result = 0; + HRESULT _hr = raw_BeginTrans(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Connection15_Deprecated::CommitTrans ( ) { + HRESULT _hr = raw_CommitTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15_Deprecated::RollbackTrans ( ) { + HRESULT _hr = raw_RollbackTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15_Deprecated::Open ( _bstr_t ConnectionString, _bstr_t UserID, _bstr_t Password, long Options ) { + HRESULT _hr = raw_Open(ConnectionString, UserID, Password, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline ErrorsPtr Connection15_Deprecated::GetErrors ( ) { + struct Errors * _result = 0; + HRESULT _hr = get_Errors(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ErrorsPtr(_result, false); +} + +inline _bstr_t Connection15_Deprecated::GetDefaultDatabase ( ) { + BSTR _result = 0; + HRESULT _hr = get_DefaultDatabase(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15_Deprecated::PutDefaultDatabase ( _bstr_t pbstr ) { + HRESULT _hr = put_DefaultDatabase(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum IsolationLevelEnum Connection15_Deprecated::GetIsolationLevel ( ) { + enum IsolationLevelEnum _result; + HRESULT _hr = get_IsolationLevel(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutIsolationLevel ( enum IsolationLevelEnum Level ) { + HRESULT _hr = put_IsolationLevel(Level); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutAttributes ( long plAttr ) { + HRESULT _hr = put_Attributes(plAttr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorLocationEnum Connection15_Deprecated::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum Connection15_Deprecated::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutMode ( enum ConnectModeEnum plMode ) { + HRESULT _hr = put_Mode(plMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15_Deprecated::GetProvider ( ) { + BSTR _result = 0; + HRESULT _hr = get_Provider(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15_Deprecated::PutProvider ( _bstr_t pbstr ) { + HRESULT _hr = put_Provider(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr Connection15_Deprecated::OpenSchema ( enum SchemaEnum Schema, const _variant_t & Restrictions, const _variant_t & SchemaID ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_OpenSchema(Schema, Restrictions, SchemaID, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +// +// interface _Connection_Deprecated wrapper method implementations +// + +inline HRESULT _Connection_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset15_Deprecated wrapper method implementations +// + +inline PositionEnum_Param Recordset15_Deprecated::GetAbsolutePosition ( ) { + PositionEnum_Param _result; + HRESULT _hr = get_AbsolutePosition(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutAbsolutePosition ( PositionEnum_Param pl ) { + HRESULT _hr = put_AbsolutePosition(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15_Deprecated::PutRefActiveConnection ( IDispatch * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15_Deprecated::PutActiveConnection ( const _variant_t & pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15_Deprecated::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline VARIANT_BOOL Recordset15_Deprecated::GetBOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_BOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15_Deprecated::GetBookmark ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Bookmark(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15_Deprecated::PutBookmark ( const _variant_t & pvBookmark ) { + HRESULT _hr = put_Bookmark(pvBookmark); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15_Deprecated::GetCacheSize ( ) { + long _result = 0; + HRESULT _hr = get_CacheSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutCacheSize ( long pl ) { + HRESULT _hr = put_CacheSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorTypeEnum Recordset15_Deprecated::GetCursorType ( ) { + enum CursorTypeEnum _result; + HRESULT _hr = get_CursorType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutCursorType ( enum CursorTypeEnum plCursorType ) { + HRESULT _hr = put_CursorType(plCursorType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset15_Deprecated::GetadoEOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_adoEOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline Fields_DeprecatedPtr Recordset15_Deprecated::GetFields ( ) { + struct Fields_Deprecated * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Fields_DeprecatedPtr(_result, false); +} + +inline enum LockTypeEnum Recordset15_Deprecated::GetLockType ( ) { + enum LockTypeEnum _result; + HRESULT _hr = get_LockType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutLockType ( enum LockTypeEnum plLockType ) { + HRESULT _hr = put_LockType(plLockType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR Recordset15_Deprecated::GetMaxRecords ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_MaxRecords(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutMaxRecords ( ADO_LONGPTR plMaxRecords ) { + HRESULT _hr = put_MaxRecords(plMaxRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR Recordset15_Deprecated::GetRecordCount ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_RecordCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutRefSource ( IDispatch * pvSource ) { + HRESULT _hr = putref_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15_Deprecated::PutSource ( _bstr_t pvSource ) { + HRESULT _hr = put_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15_Deprecated::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15_Deprecated::AddNew ( const _variant_t & FieldList, const _variant_t & Values ) { + HRESULT _hr = raw_AddNew(FieldList, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Delete ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_Delete(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Recordset15_Deprecated::GetRows ( long Rows, const _variant_t & Start, const _variant_t & Fields ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetRows(Rows, Start, Fields, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15_Deprecated::Move ( ADO_LONGPTR NumRecords, const _variant_t & Start ) { + HRESULT _hr = raw_Move(NumRecords, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MoveNext ( ) { + HRESULT _hr = raw_MoveNext(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MovePrevious ( ) { + HRESULT _hr = raw_MovePrevious(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MoveFirst ( ) { + HRESULT _hr = raw_MoveFirst(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MoveLast ( ) { + HRESULT _hr = raw_MoveLast(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum CursorTypeEnum CursorType, enum LockTypeEnum LockType, long Options ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, CursorType, LockType, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Requery ( long Options ) { + HRESULT _hr = raw_Requery(Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::_xResync ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw__xResync(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Update ( const _variant_t & Fields, const _variant_t & Values ) { + HRESULT _hr = raw_Update(Fields, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline PositionEnum_Param Recordset15_Deprecated::GetAbsolutePage ( ) { + PositionEnum_Param _result; + HRESULT _hr = get_AbsolutePage(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutAbsolutePage ( PositionEnum_Param pl ) { + HRESULT _hr = put_AbsolutePage(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum EditModeEnum Recordset15_Deprecated::GetEditMode ( ) { + enum EditModeEnum _result; + HRESULT _hr = get_EditMode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15_Deprecated::GetFilter ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Filter(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15_Deprecated::PutFilter ( const _variant_t & Criteria ) { + HRESULT _hr = put_Filter(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR Recordset15_Deprecated::GetPageCount ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_PageCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15_Deprecated::GetPageSize ( ) { + long _result = 0; + HRESULT _hr = get_PageSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutPageSize ( long pl ) { + HRESULT _hr = put_PageSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset15_Deprecated::GetSort ( ) { + BSTR _result = 0; + HRESULT _hr = get_Sort(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset15_Deprecated::PutSort ( _bstr_t Criteria ) { + HRESULT _hr = put_Sort(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15_Deprecated::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15_Deprecated::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr Recordset15_Deprecated::_xClone ( ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw__xClone(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline HRESULT Recordset15_Deprecated::UpdateBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_UpdateBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::CancelBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_CancelBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline enum CursorLocationEnum Recordset15_Deprecated::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _Recordset_DeprecatedPtr Recordset15_Deprecated::NextRecordset ( VARIANT * RecordsAffected ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_NextRecordset(RecordsAffected, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline VARIANT_BOOL Recordset15_Deprecated::Supports ( enum CursorOptionEnum CursorOptions ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = raw_Supports(CursorOptions, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15_Deprecated::GetCollect ( const _variant_t & Index ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Collect(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15_Deprecated::PutCollect ( const _variant_t & Index, const _variant_t & pvar ) { + HRESULT _hr = put_Collect(Index, pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum MarshalOptionsEnum Recordset15_Deprecated::GetMarshalOptions ( ) { + enum MarshalOptionsEnum _result; + HRESULT _hr = get_MarshalOptions(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutMarshalOptions ( enum MarshalOptionsEnum peMarshal ) { + HRESULT _hr = put_MarshalOptions(peMarshal); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset15_Deprecated::Find ( _bstr_t Criteria, ADO_LONGPTR SkipRecords, enum SearchDirectionEnum SearchDirection, const _variant_t & Start ) { + HRESULT _hr = raw_Find(Criteria, SkipRecords, SearchDirection, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset20_Deprecated wrapper method implementations +// + +inline HRESULT Recordset20_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IUnknownPtr Recordset20_Deprecated::GetDataSource ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataSource(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Recordset20_Deprecated::PutRefDataSource ( IUnknown * ppunkDataSource ) { + HRESULT _hr = putref_DataSource(ppunkDataSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset20_Deprecated::_xSave ( _bstr_t FileName, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw__xSave(FileName, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IDispatchPtr Recordset20_Deprecated::GetActiveCommand ( ) { + IDispatch * _result = 0; + HRESULT _hr = get_ActiveCommand(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IDispatchPtr(_result, false); +} + +inline void Recordset20_Deprecated::PutStayInSync ( VARIANT_BOOL pbStayInSync ) { + HRESULT _hr = put_StayInSync(pbStayInSync); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset20_Deprecated::GetStayInSync ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_StayInSync(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Recordset20_Deprecated::GetString ( enum StringFormatEnum StringFormat, long NumRows, _bstr_t ColumnDelimeter, _bstr_t RowDelimeter, _bstr_t NullExpr ) { + BSTR _result = 0; + HRESULT _hr = raw_GetString(StringFormat, NumRows, ColumnDelimeter, RowDelimeter, NullExpr, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Recordset20_Deprecated::GetDataMember ( ) { + BSTR _result = 0; + HRESULT _hr = get_DataMember(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset20_Deprecated::PutDataMember ( _bstr_t pbstrDataMember ) { + HRESULT _hr = put_DataMember(pbstrDataMember); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CompareEnum Recordset20_Deprecated::CompareBookmarks ( const _variant_t & Bookmark1, const _variant_t & Bookmark2 ) { + enum CompareEnum _result; + HRESULT _hr = raw_CompareBookmarks(Bookmark1, Bookmark2, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr Recordset20_Deprecated::Clone ( enum LockTypeEnum LockType ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_Clone(LockType, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline HRESULT Recordset20_Deprecated::Resync ( enum AffectEnum AffectRecords, enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(AffectRecords, ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset21_Deprecated wrapper method implementations +// + +inline HRESULT Recordset21_Deprecated::Seek ( const _variant_t & KeyValues, enum SeekEnum SeekOption ) { + HRESULT _hr = raw_Seek(KeyValues, SeekOption); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline void Recordset21_Deprecated::PutIndex ( _bstr_t pbstrIndex ) { + HRESULT _hr = put_Index(pbstrIndex); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset21_Deprecated::GetIndex ( ) { + BSTR _result = 0; + HRESULT _hr = get_Index(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +// +// interface _Recordset_Deprecated wrapper method implementations +// + +inline HRESULT _Recordset_Deprecated::Save ( const _variant_t & Destination, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw_Save(Destination, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Command15_Deprecated wrapper method implementations +// + +inline _Connection_DeprecatedPtr Command15_Deprecated::GetActiveConnection ( ) { + struct _Connection_Deprecated * _result = 0; + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Connection_DeprecatedPtr(_result, false); +} + +inline void Command15_Deprecated::PutRefActiveConnection ( struct _Connection_Deprecated * ppvObject ) { + HRESULT _hr = putref_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Command15_Deprecated::PutActiveConnection ( const _variant_t & ppvObject ) { + HRESULT _hr = put_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Command15_Deprecated::GetCommandText ( ) { + BSTR _result = 0; + HRESULT _hr = get_CommandText(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15_Deprecated::PutCommandText ( _bstr_t pbstr ) { + HRESULT _hr = put_CommandText(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Command15_Deprecated::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15_Deprecated::PutCommandTimeout ( long pl ) { + HRESULT _hr = put_CommandTimeout(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Command15_Deprecated::GetPrepared ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_Prepared(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15_Deprecated::PutPrepared ( VARIANT_BOOL pfPrepared ) { + HRESULT _hr = put_Prepared(pfPrepared); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _Recordset_DeprecatedPtr Command15_Deprecated::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline _Parameter_DeprecatedPtr Command15_Deprecated::CreateParameter ( _bstr_t Name, enum DataTypeEnum Type, enum ParameterDirectionEnum Direction, ADO_LONGPTR Size, const _variant_t & Value ) { + struct _Parameter_Deprecated * _result = 0; + HRESULT _hr = raw_CreateParameter(Name, Type, Direction, Size, Value, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Parameter_DeprecatedPtr(_result, false); +} + +inline Parameters_DeprecatedPtr Command15_Deprecated::GetParameters ( ) { + struct Parameters_Deprecated * _result = 0; + HRESULT _hr = get_Parameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Parameters_DeprecatedPtr(_result, false); +} + +inline void Command15_Deprecated::PutCommandType ( enum CommandTypeEnum plCmdType ) { + HRESULT _hr = put_CommandType(plCmdType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CommandTypeEnum Command15_Deprecated::GetCommandType ( ) { + enum CommandTypeEnum _result; + HRESULT _hr = get_CommandType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Command15_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15_Deprecated::PutName ( _bstr_t pbstrName ) { + HRESULT _hr = put_Name(pbstrName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Command25_Deprecated wrapper method implementations +// + +inline long Command25_Deprecated::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Command25_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Command_Deprecated wrapper method implementations +// + +inline void _Command_Deprecated::PutRefCommandStream ( IUnknown * pvStream ) { + HRESULT _hr = putref_CommandStream(pvStream); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Command_Deprecated::GetCommandStream ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_CommandStream(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Command_Deprecated::PutDialect ( _bstr_t pbstrDialect ) { + HRESULT _hr = put_Dialect(pbstrDialect); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Command_Deprecated::GetDialect ( ) { + BSTR _result = 0; + HRESULT _hr = get_Dialect(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Command_Deprecated::PutNamedParameters ( VARIANT_BOOL pfNamedParameters ) { + HRESULT _hr = put_NamedParameters(pfNamedParameters); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL _Command_Deprecated::GetNamedParameters ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_NamedParameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface RecordsetEventsVt_Deprecated wrapper method implementations +// + +inline HRESULT RecordsetEventsVt_Deprecated::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillChangeField(cFields, Fields, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_FieldChangeComplete(cFields, Fields, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillChangeRecord(adReason, cRecords, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_RecordChangeComplete(adReason, cRecords, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillChangeRecordset(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_RecordsetChangeComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillMove(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_MoveComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_EndOfRecordset(fMoreData, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_FetchProgress(Progress, MaxProgress, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_FetchComplete(pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Record_Deprecated wrapper method implementations +// + +inline _variant_t _Record_Deprecated::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record_Deprecated::PutActiveConnection ( _bstr_t pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record_Deprecated::PutRefActiveConnection ( struct _Connection_Deprecated * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Record_Deprecated::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t _Record_Deprecated::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record_Deprecated::PutSource ( _bstr_t pvar ) { + HRESULT _hr = put_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record_Deprecated::PutRefSource ( IDispatch * pvar ) { + HRESULT _hr = putref_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum _Record_Deprecated::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Record_Deprecated::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Record_Deprecated::GetParentURL ( ) { + BSTR _result = 0; + HRESULT _hr = get_ParentURL(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record_Deprecated::MoveRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum MoveRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_MoveRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record_Deprecated::CopyRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum CopyRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_CopyRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Record_Deprecated::DeleteRecord ( _bstr_t Source, VARIANT_BOOL Async ) { + HRESULT _hr = raw_DeleteRecord(Source, Async); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record_Deprecated::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum ConnectModeEnum Mode, enum RecordCreateOptionsEnum CreateOptions, enum RecordOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, Mode, CreateOptions, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline Fields_DeprecatedPtr _Record_Deprecated::GetFields ( ) { + struct Fields_Deprecated * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Fields_DeprecatedPtr(_result, false); +} + +inline enum RecordTypeEnum _Record_Deprecated::GetRecordType ( ) { + enum RecordTypeEnum _result; + HRESULT _hr = get_RecordType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr _Record_Deprecated::GetChildren ( ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_GetChildren(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline HRESULT _Record_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} diff --git a/connor_signature/x64/Release/ocilib.obj b/connor_signature/x64/Release/ocilib.obj new file mode 100644 index 0000000..21a032d Binary files /dev/null and b/connor_signature/x64/Release/ocilib.obj differ diff --git a/connor_signature/x64/Release/raycus_itk.Build.CppClean.log b/connor_signature/x64/Release/raycus_itk.Build.CppClean.log new file mode 100644 index 0000000..183e9bc --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk.Build.CppClean.log @@ -0,0 +1,57 @@ +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\vc142.pdb +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1217.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1216.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1215.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1214.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1207.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1128.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1106.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\kutil.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_sign_pre_revision.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_sign_master.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_sign_dataset.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\plm_to_oa.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\json_writer.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\json_value.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\json_reader.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_revise_clear_master.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_avic_catiasign.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_add_release_status.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ado.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\send_sap_bom.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_childgeneralidentify.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_itemrevpreupdate.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\qf8_handlers.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_wbs.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_update_currentstate.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_update_cchosenrevision.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendtoweixin.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendtoqms.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendtoputinfo.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendchangeorder.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendbyproposer.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_productcode.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_nowtime.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_logincheck.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_handler266.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_createprojectform.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_checkstate.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_append_code.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1227.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\send_sap_material.cpp.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\x64\release\raycus_itk.dll +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.ipdb +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.iobj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\x64\release\raycus_itk.pdb +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\x64\release\raycus_itk.lib +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\x64\release\raycus_itk.exp +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\msado15.tli +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\msado15.tlh +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.tlog\cl.command.1.tlog +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.tlog\cl.read.1.tlog +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.tlog\cl.write.1.tlog +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.tlog\link.command.1.tlog +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.tlog\link.read.1.tlog +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.tlog\link.write.1.tlog +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.tlog\raycus_itk.write.1u.tlog diff --git a/connor_signature/x64/Release/raycus_itk.dll.recipe b/connor_signature/x64/Release/raycus_itk.dll.recipe new file mode 100644 index 0000000..a2a2956 --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk.dll.recipe @@ -0,0 +1,11 @@ + + + + + C:\Users\cbang\Desktop\锐科开发\ITK\raycus_itk\x64\Release\raycus_itk.dll + + + + + + \ No newline at end of file diff --git a/connor_signature/x64/Release/raycus_itk.obj b/connor_signature/x64/Release/raycus_itk.obj new file mode 100644 index 0000000..a797580 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk.obj differ diff --git a/connor_signature/x64/Release/raycus_itk.tlog/CL.command.1.tlog b/connor_signature/x64/Release/raycus_itk.tlog/CL.command.1.tlog new file mode 100644 index 0000000..2d61402 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk.tlog/CL.command.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk.tlog/CL.read.1.tlog b/connor_signature/x64/Release/raycus_itk.tlog/CL.read.1.tlog new file mode 100644 index 0000000..1d6c88b Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk.tlog/CL.read.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk.tlog/CL.write.1.tlog b/connor_signature/x64/Release/raycus_itk.tlog/CL.write.1.tlog new file mode 100644 index 0000000..11475c3 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk.tlog/CL.write.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk.tlog/link.command.1.tlog b/connor_signature/x64/Release/raycus_itk.tlog/link.command.1.tlog new file mode 100644 index 0000000..eb5a623 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk.tlog/link.command.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk.tlog/link.read.1.tlog b/connor_signature/x64/Release/raycus_itk.tlog/link.read.1.tlog new file mode 100644 index 0000000..c87edcb Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk.tlog/link.read.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk.tlog/link.write.1.tlog b/connor_signature/x64/Release/raycus_itk.tlog/link.write.1.tlog new file mode 100644 index 0000000..9cca8b7 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk.tlog/link.write.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk.tlog/raycus_itk.lastbuildstate b/connor_signature/x64/Release/raycus_itk.tlog/raycus_itk.lastbuildstate new file mode 100644 index 0000000..ae061cc --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk.tlog/raycus_itk.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionATL=14.29.30136:VCServicingVersionCrtHeaders=14.29.30136:VCServicingVersionCompilers=14.29.30136:TargetPlatformVersion=10.0.19041.0: +Release|x64|C:\Users\cbang\Desktop\锐科开发\ITK\raycus_itk\| diff --git a/connor_signature/x64/Release/raycus_itk.tlog/raycus_itk.write.1u.tlog b/connor_signature/x64/Release/raycus_itk.tlog/raycus_itk.write.1u.tlog new file mode 100644 index 0000000..41ec2e4 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk.tlog/raycus_itk.write.1u.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk2.Build.CppClean.log b/connor_signature/x64/Release/raycus_itk2.Build.CppClean.log new file mode 100644 index 0000000..d19efeb --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk2.Build.CppClean.log @@ -0,0 +1,46 @@ +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ado.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_add_release_status.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_avic_catiasign.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_revise_clear_master.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_sign_dataset.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_sign_master.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_sign_pre_revision.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\json_reader.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\json_value.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\json_writer.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\kutil.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1106.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1128.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1207.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1214.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1215.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1216.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1217.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1227.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_append_code.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_checkstate.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_childgeneralidentify.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_createprojectform.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_handler266.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_itemrevpreupdate.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_logincheck.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_nowtime.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_productcode.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendbyproposer.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendchangeorder.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendtoputinfo.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendtoqms.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendtoweixin.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_update_cchosenrevision.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_update_currentstate.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_wbs.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\plm_to_oa.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\qf8_handlers.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\send_sap_bom.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\send_sap_material.cpp.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.ipdb +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.iobj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\msado15.tli +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\msado15.tlh +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\vc142.pdb diff --git a/connor_signature/x64/Release/raycus_itk2.dll.recipe b/connor_signature/x64/Release/raycus_itk2.dll.recipe new file mode 100644 index 0000000..5a13c57 --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk2.dll.recipe @@ -0,0 +1,11 @@ + + + + + C:\Users\cbang\Desktop\锐科开发\ITK\raycus_itk\x64\Release\raycus_itk2.dll + + + + + + \ No newline at end of file diff --git a/connor_signature/x64/Release/raycus_itk2.tlog/CL.command.1.tlog b/connor_signature/x64/Release/raycus_itk2.tlog/CL.command.1.tlog new file mode 100644 index 0000000..2d61402 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk2.tlog/CL.command.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk2.tlog/CL.read.1.tlog b/connor_signature/x64/Release/raycus_itk2.tlog/CL.read.1.tlog new file mode 100644 index 0000000..1d6c88b Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk2.tlog/CL.read.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk2.tlog/CL.write.1.tlog b/connor_signature/x64/Release/raycus_itk2.tlog/CL.write.1.tlog new file mode 100644 index 0000000..11475c3 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk2.tlog/CL.write.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk2.tlog/link.command.1.tlog b/connor_signature/x64/Release/raycus_itk2.tlog/link.command.1.tlog new file mode 100644 index 0000000..9df3b86 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk2.tlog/link.command.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk2.tlog/link.read.1.tlog b/connor_signature/x64/Release/raycus_itk2.tlog/link.read.1.tlog new file mode 100644 index 0000000..c87edcb Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk2.tlog/link.read.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk2.tlog/link.write.1.tlog b/connor_signature/x64/Release/raycus_itk2.tlog/link.write.1.tlog new file mode 100644 index 0000000..41aa52b Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk2.tlog/link.write.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk2.tlog/raycus_itk2.lastbuildstate b/connor_signature/x64/Release/raycus_itk2.tlog/raycus_itk2.lastbuildstate new file mode 100644 index 0000000..ae061cc --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk2.tlog/raycus_itk2.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionATL=14.29.30136:VCServicingVersionCrtHeaders=14.29.30136:VCServicingVersionCompilers=14.29.30136:TargetPlatformVersion=10.0.19041.0: +Release|x64|C:\Users\cbang\Desktop\锐科开发\ITK\raycus_itk\| diff --git a/connor_signature/x64/Release/raycus_itk2.tlog/raycus_itk2.write.1u.tlog b/connor_signature/x64/Release/raycus_itk2.tlog/raycus_itk2.write.1u.tlog new file mode 100644 index 0000000..46b9dd5 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk2.tlog/raycus_itk2.write.1u.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk_c.Build.CppClean.log b/connor_signature/x64/Release/raycus_itk_c.Build.CppClean.log new file mode 100644 index 0000000..37c3519 --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk_c.Build.CppClean.log @@ -0,0 +1,82 @@ +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\vc142.pdb +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1214.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1207.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1128.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1106.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\kutil.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_sign_pre_revision.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_sign_master.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_sign_dataset.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_auto_tbywl.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\plm_to_oa.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ocilib.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\json_writer.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\json_value.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\json_reader.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\crul_server_call_httpserver2.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_revise_clear_master.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_avic_catiasign.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\connor_add_release_status.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ado.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\qf8_handlers.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_wbs.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_update_currentstate.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_update_cchosenrevision.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendtoweixin.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendtoqms.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendtoputinfo.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendchangeorder.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_sendbyproposer.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_productcode.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_nowtime.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_logincheck.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_handler266.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_createprojectform.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_checkstate.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_append_code.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1227.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1217.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1216.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_1215.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\test.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\signoff_rev.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\send_sap_material.cpp.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\send_sap_bom.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\rk_getprojectdata.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\rk_attach_assembly_components.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_childgeneralidentify.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\ml_itemrevpreupdate.obj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\x64\release\raycus_itk_c.dll +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk_c.ipdb +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk_c.iobj +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\x64\release\raycus_itk_c.pdb +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\x64\release\raycus_itk_c.lib +c:\users\cbang\desktop\锐科开发\itk\raycus_itk\x64\release\raycus_itk_c.exp +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\ado.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\json_reader.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\json_value.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\json_writer.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\kutil.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\ocilib.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\plm_to_oa.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\raycus_auto_tbywl.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\rk_attach_assembly_components.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\send_sap_bom.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\send_sap_material.cpp.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\test.obj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\ld_itk_c.ipdb +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\ld_itk_c.iobj +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\msado15.tli +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\msado15.tlh +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\vc142.pdb +c:\users\cbang\desktop\联德开发\itk\raycus_itk\x64\release\raycus_itk_c.pdb +c:\users\cbang\desktop\联德开发\itk\raycus_itk\x64\release\raycus_itk_c.dll +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk_c.tlog\cl.command.1.tlog +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk_c.tlog\cl.read.1.tlog +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk_c.tlog\cl.write.1.tlog +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk_c.tlog\link.command.1.tlog +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk_c.tlog\link.read.1.tlog +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk_c.tlog\link.write.1.tlog +c:\users\cbang\desktop\联德开发\itk\raycus_itk\connor_signature\x64\release\raycus_itk_c.tlog\raycus_itk_c.write.1u.tlog diff --git a/connor_signature/x64/Release/raycus_itk_c.dll.recipe b/connor_signature/x64/Release/raycus_itk_c.dll.recipe new file mode 100644 index 0000000..43c9b7c --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk_c.dll.recipe @@ -0,0 +1,11 @@ + + + + + C:\Users\cbang\Desktop\锐科开发\ITK\raycus_itk\x64\Release\raycus_itk_c.dll + + + + + + \ No newline at end of file diff --git a/connor_signature/x64/Release/raycus_itk_c.tlog/CL.command.1.tlog b/connor_signature/x64/Release/raycus_itk_c.tlog/CL.command.1.tlog new file mode 100644 index 0000000..9f440c7 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk_c.tlog/CL.command.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk_c.tlog/CL.read.1.tlog b/connor_signature/x64/Release/raycus_itk_c.tlog/CL.read.1.tlog new file mode 100644 index 0000000..d39e209 Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk_c.tlog/CL.read.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk_c.tlog/CL.write.1.tlog b/connor_signature/x64/Release/raycus_itk_c.tlog/CL.write.1.tlog new file mode 100644 index 0000000..f2c730f Binary files /dev/null and b/connor_signature/x64/Release/raycus_itk_c.tlog/CL.write.1.tlog differ diff --git a/connor_signature/x64/Release/raycus_itk_c.tlog/link.command.1.tlog b/connor_signature/x64/Release/raycus_itk_c.tlog/link.command.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk_c.tlog/link.command.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/connor_signature/x64/Release/raycus_itk_c.tlog/link.read.1.tlog b/connor_signature/x64/Release/raycus_itk_c.tlog/link.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk_c.tlog/link.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/connor_signature/x64/Release/raycus_itk_c.tlog/link.write.1.tlog b/connor_signature/x64/Release/raycus_itk_c.tlog/link.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk_c.tlog/link.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/connor_signature/x64/Release/raycus_itk_c.tlog/raycus_itk_c.lastbuildstate b/connor_signature/x64/Release/raycus_itk_c.tlog/raycus_itk_c.lastbuildstate new file mode 100644 index 0000000..cb83a62 --- /dev/null +++ b/connor_signature/x64/Release/raycus_itk_c.tlog/raycus_itk_c.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionATL=14.29.30136:VCServicingVersionCrtHeaders=14.29.30136:VCServicingVersionCompilers=14.29.30136:TargetPlatformVersion=10.0.19041.0: +Release|x64|C:\Users\cbang\Desktop\联德开发\ITK\raycus_itk\| diff --git a/connor_signature/x64/Release/raycus_itk_c.tlog/unsuccessfulbuild b/connor_signature/x64/Release/raycus_itk_c.tlog/unsuccessfulbuild new file mode 100644 index 0000000..e69de29 diff --git a/connor_signature/x64/Release/vc142.pdb b/connor_signature/x64/Release/vc142.pdb new file mode 100644 index 0000000..b0df070 Binary files /dev/null and b/connor_signature/x64/Release/vc142.pdb differ diff --git a/x64/Release/.dll b/x64/Release/.dll new file mode 100644 index 0000000..f93f080 Binary files /dev/null and b/x64/Release/.dll differ diff --git a/x64/Release/.iobj b/x64/Release/.iobj new file mode 100644 index 0000000..7c600f9 Binary files /dev/null and b/x64/Release/.iobj differ diff --git a/x64/Release/.ipdb b/x64/Release/.ipdb new file mode 100644 index 0000000..06b9510 Binary files /dev/null and b/x64/Release/.ipdb differ diff --git a/x64/Release/asd.dll b/x64/Release/asd.dll new file mode 100644 index 0000000..cc0c705 Binary files /dev/null and b/x64/Release/asd.dll differ diff --git a/x64/Release/connor_signature.dll b/x64/Release/connor_signature.dll new file mode 100644 index 0000000..c50fc0b Binary files /dev/null and b/x64/Release/connor_signature.dll differ diff --git a/x64/Release/connor_signature.exp b/x64/Release/connor_signature.exp new file mode 100644 index 0000000..c6abe52 Binary files /dev/null and b/x64/Release/connor_signature.exp differ diff --git a/x64/Release/connor_signature.iobj b/x64/Release/connor_signature.iobj new file mode 100644 index 0000000..390a3f2 Binary files /dev/null and b/x64/Release/connor_signature.iobj differ diff --git a/x64/Release/connor_signature.ipdb b/x64/Release/connor_signature.ipdb new file mode 100644 index 0000000..c936df7 Binary files /dev/null and b/x64/Release/connor_signature.ipdb differ diff --git a/x64/Release/connor_signature.lib b/x64/Release/connor_signature.lib new file mode 100644 index 0000000..0d5f913 Binary files /dev/null and b/x64/Release/connor_signature.lib differ diff --git a/x64/Release/connor_signature.pdb b/x64/Release/connor_signature.pdb new file mode 100644 index 0000000..52cc594 Binary files /dev/null and b/x64/Release/connor_signature.pdb differ diff --git a/x64/Release/ld_itk_c.dll b/x64/Release/ld_itk_c.dll new file mode 100644 index 0000000..063faff Binary files /dev/null and b/x64/Release/ld_itk_c.dll differ diff --git a/x64/Release/ld_itk_c.exp b/x64/Release/ld_itk_c.exp new file mode 100644 index 0000000..b738ef5 Binary files /dev/null and b/x64/Release/ld_itk_c.exp differ diff --git a/x64/Release/ld_itk_c.lib b/x64/Release/ld_itk_c.lib new file mode 100644 index 0000000..f72661b Binary files /dev/null and b/x64/Release/ld_itk_c.lib differ diff --git a/x64/Release/ld_itk_c.pdb b/x64/Release/ld_itk_c.pdb new file mode 100644 index 0000000..023c97e Binary files /dev/null and b/x64/Release/ld_itk_c.pdb differ diff --git a/x64/Release/meling_itk.dll b/x64/Release/meling_itk.dll new file mode 100644 index 0000000..bb51106 Binary files /dev/null and b/x64/Release/meling_itk.dll differ diff --git a/x64/Release/meling_itk.exp b/x64/Release/meling_itk.exp new file mode 100644 index 0000000..cc11b81 Binary files /dev/null and b/x64/Release/meling_itk.exp differ diff --git a/x64/Release/meling_itk.iobj b/x64/Release/meling_itk.iobj new file mode 100644 index 0000000..3f66567 Binary files /dev/null and b/x64/Release/meling_itk.iobj differ diff --git a/x64/Release/meling_itk.ipdb b/x64/Release/meling_itk.ipdb new file mode 100644 index 0000000..470a918 Binary files /dev/null and b/x64/Release/meling_itk.ipdb differ diff --git a/x64/Release/meling_itk.lib b/x64/Release/meling_itk.lib new file mode 100644 index 0000000..eed618c Binary files /dev/null and b/x64/Release/meling_itk.lib differ diff --git a/x64/Release/meling_itk.pdb b/x64/Release/meling_itk.pdb new file mode 100644 index 0000000..8c31dcb Binary files /dev/null and b/x64/Release/meling_itk.pdb differ diff --git a/x64/Release/raycus_itk.dll b/x64/Release/raycus_itk.dll new file mode 100644 index 0000000..c56fa50 Binary files /dev/null and b/x64/Release/raycus_itk.dll differ diff --git a/x64/Release/raycus_itk.exp b/x64/Release/raycus_itk.exp new file mode 100644 index 0000000..743fc1f Binary files /dev/null and b/x64/Release/raycus_itk.exp differ diff --git a/x64/Release/raycus_itk.lib b/x64/Release/raycus_itk.lib new file mode 100644 index 0000000..f69b2d4 Binary files /dev/null and b/x64/Release/raycus_itk.lib differ diff --git a/x64/Release/raycus_itk.pdb b/x64/Release/raycus_itk.pdb new file mode 100644 index 0000000..5d228a6 Binary files /dev/null and b/x64/Release/raycus_itk.pdb differ diff --git a/x64/Release/raycus_itk2.dll b/x64/Release/raycus_itk2.dll new file mode 100644 index 0000000..401915c Binary files /dev/null and b/x64/Release/raycus_itk2.dll differ diff --git a/x64/Release/raycus_itk2.exp b/x64/Release/raycus_itk2.exp new file mode 100644 index 0000000..9b7e7b2 Binary files /dev/null and b/x64/Release/raycus_itk2.exp differ diff --git a/x64/Release/raycus_itk2.lib b/x64/Release/raycus_itk2.lib new file mode 100644 index 0000000..02b7479 Binary files /dev/null and b/x64/Release/raycus_itk2.lib differ diff --git a/x64/Release/raycus_itk2.pdb b/x64/Release/raycus_itk2.pdb new file mode 100644 index 0000000..a7b5416 Binary files /dev/null and b/x64/Release/raycus_itk2.pdb differ diff --git a/x64/Release/raycus_itk_c.exp b/x64/Release/raycus_itk_c.exp new file mode 100644 index 0000000..56a5314 Binary files /dev/null and b/x64/Release/raycus_itk_c.exp differ diff --git a/x64/Release/raycus_itk_c.lib b/x64/Release/raycus_itk_c.lib new file mode 100644 index 0000000..78c0578 Binary files /dev/null and b/x64/Release/raycus_itk_c.lib differ