You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
4.8 KiB

//#include <windows.h>
//#include <winsock2.h>
//ws2_32.lib·¢ËÍhttpÇëÇóÀà¿â
#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 <lov\lov.h>
#include <ics\ics.h>
#include <ict/ict_userservice.h>
#include <atlstr.h>
#include <ATLComTime.h>
#include <iostream>
#include <tc\tc_macros.h>
#include <tc\emh.h>
#include <tc\preferences.h>
#include <property\propdesc.h>
#include <epm\epm.h>
#include <epm\epm_toolkit_tc_utils.h>
#include <tccore\item.h>
#include <tccore\grmtype.h>
#include <tchar.h>
#include <tccore\grm.h>
//#include <tccore\imantype.h>
#include <sa\am.h>
#include <sa\sa.h>
#include <tccore\aom.h>
#include <tccore\aom_prop.h>
#include <property\prop_errors.h>
#include <tccore\workspaceobject.h>
#include <qry\qry.h>
#include <bom\bom_attr.h>
#include <bom\bom.h>
#include <epm\signoff.h>
#include <pom\pom\pom.h>
#include <pom\pom\pom_errors.h>
#include <fclasses\tc_date.h>
#include <epm\cr.h>
#include <cfm\cfm.h>
#include <time.h>
#include <ae/ae.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <string>
#include <iostream>
#include <iterator>
#include <map>
#include <set>
#include <vector>
#include <sstream>
#include <fstream>
#include <res\reservation.h>
#ifdef WIN32
#include <io.h>
#include <direct.h>
#else
#include <unistd.h>
#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<string> &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<string> &ans);
void Split(string strArg, string spliter, vector<string> &ans);
int getPrefStrings2(const char *preference, TC_preference_search_scope_t scope, char splitter, vector<string> &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<tag_t> &targets,char* formType,char splitter);
bool inArray(vector<string> types, string type);
int getIndexInArray(vector<string> 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<string, string> 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);
void CreateDirectoryAndFile(const char* directory_path, const char* file_path);
//BOOL GetIpByDomainName(char *szHost, char* szIp);
//void sendGetRequest();