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.

101 lines
2.8 KiB

#pragma once
#include <string>
#include <tc\tc_macros.h>
#include <tc\emh.h>
#include <tc\preferences.h>
#include <property\propdesc.h>
#include <epm\epm.h>
#include <tccore\item.h>
#include <tccore\grm.h>
#include <tccore\imantype.hxx>
#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 <pom\pom\pom.h>
#include <epm\cr.h>
#include "ae/dataset.h"
#include <iterator>
#include <map>
#include <vector>
#include <ict/ict_userservice.h>
#include <tc/envelope.h>
#include <tc/folder.h>
#include <fclasses/tc_date.h>
#include "schmgt/schmgt_bridge_itk.h"
#include <iostream>
#include "cfm/cfm.h"
#include "schmgt/schmgt_bridge_itk.h"
#include <iostream>
#include "metaframework/BusinessObjectRef.hxx"
#include "tccore/ItemRevision.hxx"
#include "ps/ps.h"
#include "sstream"
#include <sa/tcfile.h>
#include <sa/tcfile_cache.h>
#include <epm/signoff.h>
#include <tccore/grmtype.h>
#include "epm/EPMTask.hxx"
#include "bom/bom.h"
#include <set>
#include "spdlog/spdlog.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "tccore/Item.hxx"
// #include "excelreader.h"
#include "libxl.h"
using namespace std;
using namespace libxl;
using namespace spdlog;
// using namespace excelreader;
extern "C" int POM_AM__set_application_bypass(logical bypass);
const char* newGUID();
bool isTypeOf(tag_t objtag, const char * type_name);
void split(std::string s, const char* delim, std::vector<std::string>* ret);
void vecToArray(vector<string> &vec, char ***arr);
string WStringToString(const wstring& ws);
wstring StringToWString(const string s);
string getTime();
char* U2G(const char* utf8);
char* G2U(const char* gb2312);
std::string string_To_UTF8(const std::string str);
string getTime2();
double stringToNum(string str);
void getLatest(tag_t item, tag_t *rev);
string get_excel_data(libxl::Book *book, libxl::Sheet *sheet, int row, int col);
void trim(string &s);
void log(const char* format, ...);
void log2(string msg);
#define SAFECALL( argument ) \
{ \
int retcode = argument; \
if ( retcode != ITK_ok ) { \
const char* *err; \
const int *e1,*e2; \
int e; \
EMH_ask_errors(&e,&e1,&e2,&err); \
stringstream err_ss;\
for(auto e_i=0;e_i<e;e_i++){\
err_ss<<err[e_i];\
}\
if(e){ \
error("func:{} line:{} error:{}",__func__,__LINE__,err_ss.str());\
} \
} \
}
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}