Re: [討論] 修改CSV格式 請問這樣值多少錢?
※ 引述《deo2000 (800IM)》之銘言:
: 推 WolfLord:要是我報價大約5K左右,其實這個功能我自己寫的字串就有 12/01 17:35
: → WolfLord:對應功能了,大概需要花幾十分鐘做UI吧 12/01 17:37
: → WolfLord:朋友做交情的話,一瓶可樂或正妹撒嬌都可能....就醬 XDD 12/01 17:37
: UI 嘛...我有用 cout + while(1) + system("cls") 做 UI 算嗎XD
: 防錯,趕時間就沒弄了
除非對方要用來串SH不然這樣應該算不上UI,不管收不收錢以我無謂的User friendly
自我要求責任感下,我最少會一啟動先呼叫一個OpenFileDialog,然後有輸出最少會
叫一下SaveFileDialog(不使用winmain)。
: 不好意思,可能我功力不夠無法理解,為何說是自己寫的"字串"而不是"function"呢?
那就臭屁一下吧 :P (很長喔~ 不想看的直接END吧 :P )
//---------------------------------------------------------------------------
#ifndef wlsStringH
#define wlsStringH
//---------------------------------------------------------------------------
//----- Vars
//----- Definitions
#ifndef _stdLibWLS
#ifdef __BORLANDC__
#define _stdLibWLS __fastcall
#include <vcl.h>
#else
#define _stdLibWLS __stdcall
#define BYTE char
#define WORD short
#define DWORD long
#endif
#endif
#ifndef __BORLANDC__
extern "C" {void setmem(void *buf, int count, char ch);};
#endif
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
struct wlsGenPos{
int x1; int x2; int y1; int y2;
int z1; int z2; int t1; int t2;
int i; int c; int n; int p;
};
//---------------------------------------------------------------------------
#ifndef _wlsCRC16Defined
#define _wlsCRC16Defined
#ifndef __x86Only__
struct __wlsCRC16Byte{ //Big endian
BYTE high;
BYTE low;
};
#else
struct __wlsCRC16Byte{ //Little endian
BYTE low;
BYTE high;
};
#endif
//---------------------------------------------------------------------------
union _wlsCRC16{
__wlsCRC16Byte bytes;
WORD crc;
};
#endif
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
extern void _stdLibWLS BackwardCopy(char *s,char *d,int len);
extern void _autoDeleteWlsCString(void* v);
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wlsArray{
protected://----------------------------------------
void** vd;
int length;
void _stdLibWLS locate(int len);
public: //----------------------------------------
bool AUTOFREE;
void (*OnFree)(void *);
void _stdLibWLS clear(void);
void _stdLibWLS Insert(const void** v,int pos,int len);
void _stdLibWLS move(int dest,int src,int len);
void _stdLibWLS Push(const void* v);
void _stdLibWLS PushBack(const void* v);
void _stdLibWLS PushFront(const void* v);
void* _stdLibWLS PopBack(void);
void* _stdLibWLS PopFront(void);
void* _stdLibWLS Pop(void);
int _stdLibWLS Size(void)const;
void** _stdLibWLS Ary(void)const;
wlsArray();
wlsArray(const void* v);
~wlsArray();
void*& operator [](int v);
};
//---------------------------------------------------------------------------
class wlsCString{
protected://----------------------------------------
char* CSTR;
int length;
int sectors;
int realsize;
void _stdLibWLS _init(void);
void _stdLibWLS locate(int len);
void _stdLibWLS setObjs(int len,const void *c);
public: //----------------------------------------
char FieldSpliteChar;
wlsCString* Prior;
wlsCString* Next;
int SectorSize;
void* Attach;
void* AP0;
void* AP1;
void* AP2;
void* AP3;
wlsCString& _stdLibWLS Append(const char prm);
wlsCString& _stdLibWLS Append(const char* prm);
wlsCString& _stdLibWLS Append(const wlsCString &prm);
bool _stdLibWLS AppendToFile(const wlsCString &fn);
int _stdLibWLS AsInteger(void)const;
wlsCString _stdLibWLS Base64(void)const;
wlsCString _stdLibWLS Base64(int col)const;
wlsArray* _stdLibWLS Chain2Array(wlsArray* ay);
wlsArray* _stdLibWLS ChainDn2Array(wlsArray* ay);
wlsArray* _stdLibWLS ChainUp2Array(wlsArray* ay);
wlsCString* _stdLibWLS ChainTop(void);
wlsCString* _stdLibWLS ChainBottom(void);
char* _stdLibWLS c_str(void)const;
void _stdLibWLS clear(void);
int _stdLibWLS comp(const char prm)const;
int _stdLibWLS comp(const char *prm)const;
int _stdLibWLS comp(char *src,int slen,char *prm,int plen)const;
int _stdLibWLS comp(const void *prm)const;
int _stdLibWLS comp(const wlsCString &prm)const;
int _stdLibWLS comp(int pos,int len,const wlsCString &prm)const;
int _stdLibWLS Count(char prm)const;
int _stdLibWLS Count(const char *prm)const;
int _stdLibWLS Count(const wlsCString &prm)const;
_wlsCRC16 _stdLibWLS crc16(void)const;
WORD _stdLibWLS CRC16(void)const;
void _stdLibWLS CStr(const char* prmconst);
void _stdLibWLS CStr(const void* prm,int len);
void _stdLibWLS CStr(const wlsCString& prm);
void _stdLibWLS CStr(double prm);
void _stdLibWLS CStr(int prm);
char* _stdLibWLS CStr(void)const;
wlsCString _stdLibWLS Data(void)const;
wlsCString& _stdLibWLS DeBase64(const wlsCString &prm);
wlsCString& _stdLibWLS DeCrypto(const wlsCString &prm);
wlsCString& _stdLibWLS DeCrypto(int n);
wlsCString& _stdLibWLS DeCrypto32(const wlsCString &prm);
wlsCString& _stdLibWLS DeCrypto64(const wlsCString &prm);
wlsCString& _stdLibWLS DeDCrypto(const wlsCString &prm);
wlsCString& _stdLibWLS DeDCrypto(void);
wlsCString& _stdLibWLS DeDCrypto32(const wlsCString &prm);
wlsCString& _stdLibWLS DeDCrypto64(const wlsCString &prm);
wlsCString& _stdLibWLS DeE32(const wlsCString &prm);
wlsCString& _stdLibWLS DeE64(const wlsCString &prm);
wlsCString& _stdLibWLS DeE128(const wlsCString &prm);
wlsCString& _stdLibWLS Delete(int pos,int len);
wlsCString _stdLibWLS DrawHEX(void)const;
wlsCString _stdLibWLS DrawNum(void)const;
wlsCString _stdLibWLS DrawString(const wlsCString& Leadin,const wlsCString&
Leadout);
wlsCString _stdLibWLS EnE32(void)const;
wlsCString _stdLibWLS EnE64(void)const;
wlsCString _stdLibWLS EnE128(void)const;
wlsCString& _stdLibWLS fill(int len,char c);
wlsCString _stdLibWLS Fill(int len,char c)const;
wlsCString _stdLibWLS FillLeft(int len,char c)const;
wlsCString& _stdLibWLS Fillleft(int len,char c);
wlsCString _stdLibWLS FillRight(int len,char c)const;
wlsCString& _stdLibWLS Fillright(int len,char c);
wlsCString _stdLibWLS Field(void)const;
void _stdLibWLS FieltB64(void);
void _stdLibWLS FieltE32(void);
void _stdLibWLS FieltE64(void);
void _stdLibWLS FieltE128(void);
bool _stdLibWLS Field(const wlsCString &f)const;
bool _stdLibWLS Fieldx(const wlsCString &f)const;
wlsCString* _stdLibWLS FindKeyWordInChain(const wlsCString &k);
wlsGenPos _stdLibWLS FindPair(const wlsCString& Lin,const wlsCString&
Lout)const;
char _stdLibWLS FirstChar(void)const;
bool _stdLibWLS FirstCharIsNumber(void)const;
bool _stdLibWLS FirstCharIsAlpha(void)const;
int _stdLibWLS hex(void)const;
wlsCString& _stdLibWLS hex(int v);
// wlsCString& _stdLibWLS Insert(int pos,char *prm);
wlsCString& _stdLibWLS Insert(int pos,char prm);
wlsCString& _stdLibWLS Insert(int pos,const char *prm,int len);
wlsCString& _stdLibWLS Insert(int pos,const wlsCString &prm);
bool _stdLibWLS isASCII(const char *a)const;
bool _stdLibWLS isASCII(void)const;
bool _stdLibWLS isEmpty(void)const;
bool _stdLibWLS isHEX(const char *a)const;
bool _stdLibWLS isHEX(void)const;
bool _stdLibWLS isNumber(const char *a)const;
bool _stdLibWLS isNumber(void)const;
bool _stdLibWLS isincludedchar(char *ab,int lenab,char *cmp, int
lencmp) const;
bool _stdLibWLS isIncludedChar(char *cmp, int lencmp) const;
bool _stdLibWLS isIncludedChar(const wlsCString &cmp) const;
char _stdLibWLS LastChar(void)const;
bool _stdLibWLS LastCharIsNumber(void)const;
bool _stdLibWLS LastCharIsAlpha(void)const;
void _stdLibWLS Length(int len);
int _stdLibWLS Length(void)const;
bool _stdLibWLS LoadFromFile(const wlsCString &fn);
void _stdLibWLS lowcase(char *a,int l); //Working Function only
wlsCString& _stdLibWLS Lowcase(void); //Change & reyurn self
wlsCString _stdLibWLS LowCase(void)const; //Change & reyurn temp
int _stdLibWLS mPos(const wlsCString &sig)const;
int _stdLibWLS mPos(const char *sig)const;
int _stdLibWLS mPos(const wlsCString &sig,int count)const;
int _stdLibWLS mPos(const char *sig,int count)const;
wlsCString* _stdLibWLS NewPrior(void);
wlsCString* _stdLibWLS NewNext(void);
void _stdLibWLS pclear(void);
int _stdLibWLS Pos(char prm)const;
int _stdLibWLS Pos(char prm,int count)const;
int _stdLibWLS Pos(const char *prm)const;
int _stdLibWLS Pos(const char *prm,int count)const;
int _stdLibWLS Pos(const wlsCString &prm)const;
int _stdLibWLS Pos(const wlsCString &prm,int count)const;
int printf(const char *format, ...);
wlsCString _stdLibWLS Replace(const wlsCString &prm,const wlsCString
&rep)const;
wlsCString& _stdLibWLS replace(const wlsCString &prm,const wlsCString &rep);
wlsCString& _stdLibWLS replace(const char prm,const char rep);
void _stdLibWLS reset(void);
bool _stdLibWLS SaveToFile(const wlsCString &fn)const;
bool _stdLibWLS SaveToFileWithPath(const wlsCString &fn)const;
wlsCString& sprintf(const char *format, ...);
wlsCString _stdLibWLS Split(const char Mark);
wlsCString _stdLibWLS Split(const wlsCString &Mark);
wlsCString _stdLibWLS SplitNz(const char Mark);
wlsCString _stdLibWLS SplitNz(const wlsCString &Mark);
int sscanf(const char *format, ...)const;
void _stdLibWLS Strip(void);
void _stdLibWLS StripTheSlash(void);
void _stdLibWLS StripHtmlEntity(void);
wlsCString _stdLibWLS SubString(int beging, int len)const;
wlsCString _stdLibWLS TakeAlpha(int max);//from fornt
wlsCString _stdLibWLS TakeAlpha(void);//from fornt
wlsCString _stdLibWLS TakeBackAlpha(int max);//from fornt
wlsCString _stdLibWLS TakeBackAlpha(void);//from fornt
wlsCString _stdLibWLS TakeBackNumber(int max);//from fornt
wlsCString _stdLibWLS TakeBackNumber(void);//from fornt
wlsCString _stdLibWLS TakeBackWord(const wlsCString &sig);//from fornt
wlsCString _stdLibWLS TakeBackWord(int max);//from fornt
wlsCString _stdLibWLS TakeBackWord(void);//from fornt
wlsCString _stdLibWLS TakeCSWord(void);//from fornt to first ','
wlsCString _stdLibWLS TakeCSWordEnd(void);//from fornt to first ','
wlsCString _stdLibWLS TakeHexNumber(int max);//from fornt
wlsCString _stdLibWLS TakeHexNumber(void);//from fornt
wlsCString _stdLibWLS TakeNumber(int max);//from fornt
wlsCString _stdLibWLS TakeNumber(void);//from fornt
wlsCString _stdLibWLS TakeWord(const wlsCString &sig);
wlsCString _stdLibWLS TakeWord(int max);//from fornt
wlsCString _stdLibWLS TakeWord(void);//from fornt
wlsCString& _stdLibWLS trim(void);//Change content
wlsCString _stdLibWLS Trim(void)const;//return in new string
wlsCString& _stdLibWLS Trimleft(void);//Change content
wlsCString _stdLibWLS TrimLeft(void)const;//return in new string
wlsCString& _stdLibWLS Trimright(void);//Change content
wlsCString _stdLibWLS TrimRight(void)const;//return in new string
void _stdLibWLS upcase(char *a,int l); //Working Function only
wlsCString& _stdLibWLS Upcase(void); //Change & reyurn self
wlsCString _stdLibWLS UpCase(void)const; //Change & reyurn temp
wlsCString _stdLibWLS UrlEnc(void)const;
wlsCString& _stdLibWLS UrlDec(wlsCString& s);
wlsCString();
wlsCString(const char *prm);
wlsCString(const char *prm,int len);
wlsCString(const wlsCString& prm);
wlsCString(double prm);
wlsCString(int prm);
~wlsCString();
int _stdLibWLS xcomp(const char prm)const;
int _stdLibWLS xcomp(const char *prm)const;
int _stdLibWLS xcomp(char *src,int slen,char *prm,int plen)const;
int _stdLibWLS xcomp(const void *prm)const;
int _stdLibWLS xcomp(const wlsCString &prm)const;
int _stdLibWLS xcomp(int pos,int len,const wlsCString &prm)const;
wlsCString operator + (const char prm)const;
wlsCString operator + (const char* prm)const;
wlsCString operator + (const void* prm)const;
wlsCString operator + (const wlsCString& prm)const;
wlsCString& operator +=(char prm);
wlsCString& operator +=(const char* prm);
wlsCString& operator +=(const void* prm);
wlsCString& operator +=(const wlsCString& prm);
wlsCString operator - (const char prm)const;
wlsCString operator - (const char* prm)const;
wlsCString operator - (const void* prm)const;
wlsCString operator - (const wlsCString& prm)const;
wlsCString& operator -=(const char prm);
wlsCString& operator -=(const char* prm);
wlsCString& operator -=(const void* prm);
wlsCString& operator -=(const wlsCString& prm);
bool operator < (const void* prm)const;
bool operator < ( char prm)const;
bool operator < (const char* prm)const;
bool operator < (const wlsCString& prm)const;
bool operator <=(const void* prm)const;
bool operator <=( char prm)const;
bool operator <=(const char* prm)const;
bool operator <=(const wlsCString& prm)const;
wlsCString& operator = ( char prm);
wlsCString& operator = (const char* prm);
wlsCString& operator = (const double prm);
wlsCString& operator = (const int prm);
wlsCString& operator = (const wlsCString& prm);
bool operator ==(const void* prm)const;
bool operator ==( char prm)const;
bool operator ==(const char* prm)const;
bool operator ==(const wlsCString& prm)const;
bool operator !=(const void* prm)const;
bool operator !=( char prm)const;
bool operator !=(const char* prm)const;
bool operator !=(const wlsCString& prm)const;
bool operator > (const void* prm)const;
bool operator > ( char prm)const;
bool operator > (const char* prm)const;
bool operator > (const wlsCString& prm)const;
bool operator >=(const void* prm)const;
bool operator >= ( char prm)const;
bool operator >=(const char* prm)const;
bool operator >=(const wlsCString& prm)const;
char& operator [](int prm);
operator char*(void) const;
operator double(void) const;
operator int(void) const;
friend class wlsCCString;
friend class wlsMarkDef;
friend class wlsCStrings;
friend class wlsCStrAry;
friend class wlsCSSQLReslut;
#ifdef __BORLANDC__
wlsCString(const AnsiString& prm);
wlsCString& operator = (const AnsiString& prm);
wlsCString operator + (const AnsiString& prm)const;
wlsCString operator - (const AnsiString& prm)const;
wlsCString& operator +=(const AnsiString& prm);
wlsCString& operator -=(const AnsiString& prm);
operator AnsiString(void) const;
#endif
};
//---------------------------------------------------------------------------
class wlsCStrings{
protected://----------------------------------------
wlsCString* CSTRS;
int length;
void _stdLibWLS _init(void);
void _stdLibWLS locate(int len);
void _stdLibWLS setObjs(int len,const wlsCString* c);
public: //----------------------------------------
bool _StackFIFO;
bool TextFormat;
wlsMarkDef* Marks;
void _stdLibWLS Add(const char *prm);
void _stdLibWLS Add(const double prm);
void _stdLibWLS Add(const int prm);
void _stdLibWLS Add(const wlsCString &prm);
void _stdLibWLS Add(const wlsCString* &prm,int cnt);
void _stdLibWLS AddText(const wlsCString &prm);
void _stdLibWLS AddText(const char *prm);
wlsCString* _stdLibWLS c_strs(void)const;
void _stdLibWLS clear(void);
void _stdLibWLS CStrs(const wlsCString* prm,int len);
void _stdLibWLS CStrs(const wlsCStrings &prm);
wlsCString* _stdLibWLS CStrs(void)const;
void _stdLibWLS Delete(int pos);
void _stdLibWLS Delete(int pos,int cnt);
int _stdLibWLS Find(const wlsCString& x)const;
wlsCString _stdLibWLS FindField(const wlsCString& fie,char *def)const;
wlsCString _stdLibWLS FindField(const wlsCString& fie)const;
int _stdLibWLS FindFieldIx(const wlsCString& fie)const;
void _stdLibWLS FromCSV(const wlsCString& s);
void _stdLibWLS FromMSV(wlsCString s);
void _stdLibWLS FromSSV(char sig,wlsCString s);
void _stdLibWLS FromSSV(const wlsCString& sig,wlsCString s);
void _stdLibWLS FromString(const wlsCString& s);
void _stdLibWLS FromTSV(const wlsCString& s);
void _stdLibWLS Insert(int pos,const wlsCString &prm);
void _stdLibWLS Insert(int pos,const wlsCString* prm,int cnt);
bool _stdLibWLS isEmpty(void)const;
void _stdLibWLS Length(int len);
int _stdLibWLS Length(void)const;
bool _stdLibWLS LoadFromFile(const wlsCString &fn);
void _stdLibWLS pclear(void);
void _stdLibWLS Pop(void);
void _stdLibWLS Push(const wlsCString& prm);
void _stdLibWLS Push(const char *prm);
bool _stdLibWLS SaveToFile(const wlsCString &fn)const;
wlsCString _stdLibWLS ToCSV(void)const;//Comma-separated values
wlsCString _stdLibWLS ToMSV(void)const;
wlsCString _stdLibWLS ToSSV(char sig)const;//Signed-separated values
wlsCString _stdLibWLS ToTSV(void)const;//Tab-separated values
void _stdLibWLS UpdateField(wlsCString fie,wlsCString dat);
wlsCStrings();
wlsCStrings(const wlsCString& prm);
wlsCStrings(const wlsCString* prm,int len);
wlsCStrings(const wlsCStrings& prm);
~wlsCStrings();
wlsCString& operator = (const wlsCString& prm);
wlsCStrings& operator = (const wlsCStrings& prm);
wlsCString& operator [](const wlsCString& x);
wlsCString& operator [](int prm);
operator wlsCString(void);
friend class wlsCStrAry;
friend class wlsCSSQLReslut;
friend class wlsMarkDef;
#ifdef __BORLANDC__
wlsCStrings(const TStrings* prm);
wlsCStrings& operator =(const TStrings* prm);
operator TStrings*(void)const;
void _stdLibWLS Push(const AnsiString& prm);
#endif
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wlsCStrAry{
protected://----------------------------------------
void _stdLibWLS locate(int len);
void _stdLibWLS setObjs(int len,const wlsCStrings* c);
void _stdLibWLS _init(void);
wlsCStrings* ARY;
int length;
public: //----------------------------------------
wlsMarkDef* Marks;
int defaultFindFromColOfRow;
wlsCStrAry();
wlsCStrAry(const wlsCStrings* prm,int len);
wlsCStrAry(const wlsCStrAry& prm);
~wlsCStrAry();
void _stdLibWLS Length(int len);
int _stdLibWLS Length(void)const;
void _stdLibWLS Ary(const wlsCStrings* prm,int len);
wlsCStrings* _stdLibWLS Ary(void)const;
wlsCString _stdLibWLS ToHTML(void)const;
void _stdLibWLS clear(void);
void _stdLibWLS Add(const wlsCStrings &prm);
void _stdLibWLS Add(const wlsCStrings* &prm,int cnt);
void _stdLibWLS Del(int prm);
void _stdLibWLS Del(int prm,unsigned cnt);
bool _stdLibWLS LoadFromFile(const wlsCString &fn);
bool _stdLibWLS SaveToFile(const wlsCString &fn)const;
void _stdLibWLS SyncMark(void);
int _stdLibWLS xFind(int row,const wlsCString &x)const;
int _stdLibWLS yFind(int col,const wlsCString &x)const;
wlsCStrAry& operator = (const wlsCStrAry& prm);
wlsCStrings& operator [](int prm);
int operator [](const wlsCString &x)const;
friend class wlsCSSQLReslut;
friend class wlsCSQLUnit;
friend class wlsMarkDef;
};
//---------------------------------------------------------------------------
class wlsCSSQLReslut:public wlsCStrAry{
public:
wlsCSSQLReslut();
int _stdLibWLS RowCount(void)const;
int _stdLibWLS ColCount(void)const;
int _stdLibWLS FieldIndexByName(const char *fe)const;
const char* _stdLibWLS FieldByName(int row,const char *fe)const;
wlsCStrings* _stdLibWLS Fields(void)const;
wlsCStrings* _stdLibWLS Rows(void)const;
wlsCString _stdLibWLS ToHTML(void)const;
friend class wlsMarkDef;
friend class wlsCSQLUnit;
};
//---------------------------------------------------------------------------
class wlsCSQLUnit{
public:
wlsCSSQLReslut Reslut;
void *db;
wlsCString ErrMsg;
wlsCString Host;
wlsCString User;
wlsCString Passwd;
wlsCString DataBase;
wlsCString SQL;
void _stdLibWLS close_db(void);
int _stdLibWLS open_db(void);
int _stdLibWLS open_db(const char *database);
int _stdLibWLS ExecSQL(const char *sql);
int _stdLibWLS ExecSQL(const char *database,const char *sql);
int _stdLibWLS ExecSQL(void);
wlsCSQLUnit();
wlsCSQLUnit(const wlsCString &database);
~wlsCSQLUnit();
void _stdLibWLS clear_reslut(void);
void _stdLibWLS clear(void);
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wlsMarkDef{
public:
//----- Vars
wlsCString FieldBeginMark;
wlsCString FieldEndMark;
wlsCString DataBeginMark;
wlsCString DataEndMark;
wlsCString RowBeginMark;
wlsCString RowEndMark;
wlsCString TableBeginMark;
wlsCString TableEndMark;
wlsCString MSV;
//----- Functions
wlsMarkDef();
wlsMarkDef(const wlsMarkDef &pas);
~wlsMarkDef(void);
wlsCString& _stdLibWLS BindDataMSV(const wlsCString& s);
wlsCString& _stdLibWLS BindFieldMSV(const wlsCString& s);
wlsCString _stdLibWLS BindTBL(const wlsCStrAry& msv);
wlsCString _stdLibWLS BindTBL(const wlsCSSQLReslut& res);
wlsCString _stdLibWLS DrawRowFromMSV(wlsCString& s);
wlsCString _stdLibWLS DrawDataFromMSV(wlsCString& s);
wlsCStrAry& _stdLibWLS DrawDataFromTBL(wlsCStrAry& dest,wlsCString s);
//----- Definitions
};
//---------------------------------------------------------------------------
class wlsMBCRC16{
protected:
public:
unsigned char low;
unsigned char high;
wlsMBCRC16(void);
wlsMBCRC16(const unsigned char l,const unsigned char h);
wlsMBCRC16(wlsMBCRC16 *v);
~wlsMBCRC16(void);
void _stdLibWLS Reset(void);
void _stdLibWLS Cacu(char b);
void _stdLibWLS Cacu(char *b, int len);
void _stdLibWLS Cacu(const wlsCString b);
void _stdLibWLS MakeCRC(char *b, int len);
void _stdLibWLS MakeCRC(const wlsCString b);
_stdLibWLS operator int(void) const;
_stdLibWLS operator short(void) const;
_stdLibWLS operator unsigned int(void) const;
_stdLibWLS operator unsigned short(void) const;
wlsMBCRC16& _stdLibWLS operator =(const wlsMBCRC16& b);
bool _stdLibWLS operator ==(const wlsMBCRC16& b)const;
wlsMBCRC16 _stdLibWLS operator +(char b);
wlsMBCRC16 _stdLibWLS operator +(const wlsCString& b);
wlsMBCRC16& _stdLibWLS operator +=(char b);
wlsMBCRC16& _stdLibWLS operator +=(const wlsCString& b);
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
extern class wlsMarkDef ___wls_defMark;
extern class wlsCString gwlsCStringErr;
extern wlsCStrings gwlsCStringsErr;
extern void* __wlsErrorPointer;
extern int wlsCString_DefSecSize;
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#endif
--
上帝完美無瑕
上帝造人,人有缺陷
人被造得有缺陷,人造之物必然漏洞百出
WolfLord
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.230.66.62
推
12/01 18:48, , 1F
12/01 18:48, 1F
推
12/01 22:00, , 2F
12/01 22:00, 2F
→
12/01 22:01, , 3F
12/01 22:01, 3F
推
12/01 22:03, , 4F
12/01 22:03, 4F
→
12/01 22:04, , 5F
12/01 22:04, 5F
→
12/01 22:14, , 6F
12/01 22:14, 6F
→
12/01 22:47, , 7F
12/01 22:47, 7F
→
12/01 22:48, , 8F
12/01 22:48, 8F
→
12/01 22:49, , 9F
12/01 22:49, 9F
推
12/01 22:50, , 10F
12/01 22:50, 10F
→
12/01 22:50, , 11F
12/01 22:50, 11F
→
12/02 00:07, , 12F
12/02 00:07, 12F
→
12/02 00:08, , 13F
12/02 00:08, 13F
推
12/02 00:11, , 14F
12/02 00:11, 14F
推
12/02 00:16, , 15F
12/02 00:16, 15F
→
12/02 00:24, , 16F
12/02 00:24, 16F
→
12/02 00:25, , 17F
12/02 00:25, 17F
→
12/02 00:26, , 18F
12/02 00:26, 18F
→
12/02 00:27, , 19F
12/02 00:27, 19F
推
12/02 00:35, , 20F
12/02 00:35, 20F
推
12/02 02:10, , 21F
12/02 02:10, 21F
→
12/02 02:10, , 22F
12/02 02:10, 22F
→
12/02 02:11, , 23F
12/02 02:11, 23F
→
12/02 02:16, , 24F
12/02 02:16, 24F
→
12/02 02:17, , 25F
12/02 02:17, 25F
我還是用EDIT來說明好了:
這篇最主要的目的在於說明、回答 "為何說是自己寫的"字串"而不是"function"呢?"
因為C++中 字串 是一個物件,他是由上面宣告中的那麼多FUNCTION組再同一個資料結
構中互相連動運作的一群自動程式(C中以NAMESPACE封裝的群組FUNCTION與DATA)
上面的 "宣告" 之所以說他不是程式碼,因為其中沒有任何一行是用來作功的敘述。
完完全全只有物件的內容宣告(虛碼)。而指著宣告大喊:好臭好長的程式,那我怎
麼去認定會這樣反應的人真的懂得什麼叫做OOP,真的懂得什麼是C++ ?
以這個字串物件要達成原PO的要求程式碼只要:
void main(int argc, char *argv[]){
if(argc > 2){
class wlsCString b,o;b.LoadFromfile(argv[1]);
while(!b.isEmpty()){o+=(b.TakeNumber()+"\n");}
o.SaveToFile(argv[2]);
}else{ cout<<"fielters.exe in_file out_file";}
}
--
我從沒禁止討論與JOB有關的程式,只是希望大家討論歸討論不要掀筆戰就好。另外
,希望討論的內容盡量與標題相符。不要標題下岔題又岔題。(道德勸說)
對了,想到一點要提醒:討論發文酸人開玩笑只要不翻臉都可以默許(沒人檢舉為
前提),但是推文仍然嚴禁未經許可的噓文。
※ 編輯: WolfLord 來自: 125.230.66.62 (12/02 02:53)
推
12/02 06:57, , 26F
12/02 06:57, 26F
→
12/02 06:58, , 27F
12/02 06:58, 27F
→
12/02 06:59, , 28F
12/02 06:59, 28F
→
12/02 09:11, , 29F
12/02 09:11, 29F
→
12/02 09:13, , 30F
12/02 09:13, 30F
推
12/02 09:57, , 31F
12/02 09:57, 31F
→
12/02 17:09, , 32F
12/02 17:09, 32F
→
12/02 17:10, , 33F
12/02 17:10, 33F
→
12/02 17:11, , 34F
12/02 17:11, 34F
推
12/03 05:21, , 35F
12/03 05:21, 35F
推
12/03 11:28, , 36F
12/03 11:28, 36F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 12 篇):