本文整理汇总了C++中PCOLDEF类的典型用法代码示例。如果您正苦于以下问题:C++ PCOLDEF类的具体用法?C++ PCOLDEF怎么用?C++ PCOLDEF使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PCOLDEF类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeFnPattern
int VCTDEF::MakeFnPattern(char *fpat)
{
char pat[8];
#if !defined(UNIX)
char drive[_MAX_DRIVE];
#else
char *drive = NULL;
#endif
char direc[_MAX_DIR];
char fname[_MAX_FNAME];
char ftype[_MAX_EXT]; // File extention
int n, m, ncol = 0;
PCOLDEF cdp;
for (cdp = To_Cols; cdp; cdp = cdp->GetNext())
ncol++;
for (n = 1, m = ncol; m /= 10; n++) ;
sprintf(pat, "%%0%dd", n);
_splitpath(Fn, drive, direc, fname, ftype);
strcat(fname, pat);
_makepath(fpat, drive, direc, fname, ftype);
PlugSetPath(fpat, fpat, GetPath());
return ncol;
} // end of MakeFnPattern
示例2: Erase
bool VCTDEF::Erase(char *filename)
{
bool rc = false;
if (Split) {
char fpat[_MAX_PATH];
int i;
PCOLDEF cdp;
MakeFnPattern(fpat);
for (i = 1, cdp = To_Cols; cdp; i++, cdp = cdp->GetNext()) {
sprintf(filename, fpat, i);
//#if defined(WIN32)
// rc |= !DeleteFile(filename);
//#else // UNIX
rc |= remove(filename);
//#endif // UNIX
} // endfor cdp
} else {
rc = DOSDEF::Erase(filename);
if (Estimate && Header == 2) {
PlugSetPath(filename, Fn, GetPath());
strcat(PlugRemoveType(filename, filename), ".blk");
rc |= remove(filename);
} // endif Header
} // endif Split
return rc; // Return true if error
} // end of Erase
示例3: DefineAM
bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
char buf[8];
// Double check correctness of offset values
if (Catfunc == FNC_NO)
for (PCOLDEF cdp = To_Cols; cdp; cdp = cdp->GetNext())
if (cdp->GetOffset() < 1 && !cdp->IsSpecial()) {
strcpy(g->Message, MSG(BAD_OFFSET_VAL));
return true;
} // endif Offset
// Call DOSDEF DefineAM with am=CSV so FMT is not confused with FIX
if (DOSDEF::DefineAM(g, "CSV", poff))
return true;
GetCharCatInfo("Separator", ",", buf, sizeof(buf));
Sep = (strlen(buf) == 2 && buf[0] == '\\' && buf[1] == 't') ? '\t' : *buf;
Quoted = GetIntCatInfo("Quoted", -1);
GetCharCatInfo("Qchar", "", buf, sizeof(buf));
Qot = *buf;
if (Qot && Quoted < 0)
Quoted = 0;
else if (!Qot && Quoted >= 0)
Qot = '"';
Fmtd = (!Sep || (am && (*am == 'F' || *am == 'f')));
Header = (GetIntCatInfo("Header", 0) != 0);
Maxerr = GetIntCatInfo("Maxerr", 0);
Accept = (GetIntCatInfo("Accept", 0) != 0);
return false;
} // end of DefineAM
示例4: IsSpecial
bool TDBASE::IsSpecial(PSZ name)
{
for (PCOLDEF cdp = To_Def->GetCols(); cdp; cdp = cdp->GetNext())
if (!stricmp(cdp->GetName(), name) && (cdp->Flags & U_SPECIAL))
return true; // Special column to ignore while inserting
return false; // Not found or not special or not inserting
} // end of IsSpecial
示例5: InsertSpcBlk
PCOL TDBASE::InsertSpcBlk(PGLOBAL g, PCOLDEF cdp)
{
//char *name = cdp->GetName();
char *name = cdp->GetFmt();
PCOLUMN cp;
PCOL colp;
cp= new(g) COLUMN(cdp->GetName());
if (! To_Table) {
strcpy(g->Message, "Cannot make special column: To_Table is NULL");
return NULL;
} else
cp->SetTo_Table(To_Table);
if (!stricmp(name, "FILEID") || !stricmp(name, "FDISK") ||
!stricmp(name, "FPATH") || !stricmp(name, "FNAME") ||
!stricmp(name, "FTYPE") || !stricmp(name, "SERVID")) {
if (!To_Def || !(To_Def->GetPseudo() & 2)) {
sprintf(g->Message, MSG(BAD_SPEC_COLUMN));
return NULL;
} // endif Pseudo
if (!stricmp(name, "FILEID"))
colp = new(g) FIDBLK(cp, OP_XX);
else if (!stricmp(name, "FDISK"))
colp = new(g) FIDBLK(cp, OP_FDISK);
else if (!stricmp(name, "FPATH"))
colp = new(g) FIDBLK(cp, OP_FPATH);
else if (!stricmp(name, "FNAME"))
colp = new(g) FIDBLK(cp, OP_FNAME);
else if (!stricmp(name, "FTYPE"))
colp = new(g) FIDBLK(cp, OP_FTYPE);
else
colp = new(g) SIDBLK(cp);
} else if (!stricmp(name, "TABID")) {
colp = new(g) TIDBLK(cp);
} else if (!stricmp(name, "PARTID")) {
colp = new(g) PRTBLK(cp);
//} else if (!stricmp(name, "CONID")) {
// colp = new(g) CIDBLK(cp);
} else if (!stricmp(name, "ROWID")) {
colp = new(g) RIDBLK(cp, false);
} else if (!stricmp(name, "ROWNUM")) {
colp = new(g) RIDBLK(cp, true);
} else {
sprintf(g->Message, MSG(BAD_SPECIAL_COL), name);
return NULL;
} // endif's name
if (!(colp = InsertSpecialColumn(colp))) {
sprintf(g->Message, MSG(BAD_SPECIAL_COL), name);
return NULL;
} // endif Insert
return (colp);
} // end of InsertSpcBlk
示例6: DOSCOL
VCTCOL::VCTCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i)
: DOSCOL(g, cdp, tdbp, cprec, i, "VCT")
{
Deplac = cdp->GetPoff();
Clen = cdp->GetClen(); // Length of the field in the file
ColBlk = -1;
ColPos = -1;
Blk = NULL;
Modif = 0;
} // end of VCTCOL constructor
示例7: EstimatedLength
int TDBCSV::EstimatedLength(PGLOBAL g)
{
int n = 0;
PCOLDEF cdp;
if (trace)
htrc("EstimatedLength: Fields=%d Columns=%p\n", Fields, Columns);
for (cdp = To_Def->GetCols(); cdp; cdp = cdp->GetNext())
if (!cdp->IsSpecial() && !cdp->IsVirtual()) // A true column
n++;
return --n; // Number of separators if all fields are null
} // end of Estimated Length
示例8: ColDB
PCOL TDBASE::ColDB(PGLOBAL g, PSZ name, int num)
{
int i;
PCOLDEF cdp;
PCOL cp, colp = NULL, cprec = NULL;
if (trace)
htrc("ColDB: am=%d colname=%s tabname=%s num=%d\n",
GetAmType(), SVP(name), Name, num);
for (cdp = To_Def->GetCols(), i = 1; cdp; cdp = cdp->GetNext(), i++)
if ((!name && !num) ||
(name && !stricmp(cdp->GetName(), name)) || num == i) {
/*****************************************************************/
/* Check for existence of desired column. */
/* Also find where to insert the new block. */
/*****************************************************************/
for (cp = Columns; cp; cp = cp->GetNext())
if ((num && cp->GetIndex() == i) ||
(name && !stricmp(cp->GetName(), name)))
break; // Found
else if (cp->GetIndex() < i)
cprec = cp;
if (trace)
htrc("cdp(%d).Name=%s cp=%p\n", i, cdp->GetName(), cp);
/*****************************************************************/
/* Now take care of Column Description Block. */
/*****************************************************************/
if (cp)
colp = cp;
else if (!(cdp->Flags & U_SPECIAL))
colp = MakeCol(g, cdp, cprec, i);
else if (Mode != MODE_INSERT)
colp = InsertSpcBlk(g, cdp);
if (trace)
htrc("colp=%p\n", colp);
if (name || num)
break;
else if (colp && !colp->IsSpecial())
cprec = colp;
} // endif Name
return (colp);
} // end of ColDB
示例9: MakeCol
PCOL TDBPIVOT::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
{
PCOL colp;
if (cdp->GetOffset()) {
colp = new(g) FNCCOL(cdp, this, cprec, n);
if (cdp->GetOffset() > 1)
Dcolp = colp;
} else
colp = new(g) SRCCOL(cdp, this, cprec, n);
return colp;
} // end of MakeCol
示例10: COLBLK
CATCOL::CATCOL(PCOLDEF cdp, PTDB tdbp, int n)
: COLBLK(cdp, tdbp, n)
{
Tdbp = (PTDBCAT)tdbp;
Crp = NULL;
Flag = cdp->GetOffset();
} // end of WMICOL constructor
示例11: COLBLK
INICOL::INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
: COLBLK(cdp, tdbp, i)
{
if (cprec) {
Next = cprec->GetNext();
cprec->SetNext(this);
} else {
Next = tdbp->GetColumns();
tdbp->SetColumns(this);
} // endif cprec
// Set additional INI access method information for column.
Valbuf = NULL;
Flag = cdp->GetOffset();
Long = cdp->GetLong();
To_Val = NULL;
} // end of INICOL constructor
示例12: FindDefaultColumns
bool TDBPIVOT::FindDefaultColumns(PGLOBAL g)
{
PCOLDEF cdp;
PTABDEF defp = Tdbp->GetDef();
if (!Fncol) {
for (cdp = defp->GetCols(); cdp; cdp = cdp->GetNext())
if (!Picol || stricmp(Picol, cdp->GetName()))
Fncol = cdp->GetName();
if (!Fncol) {
strcpy(g->Message, MSG(NO_DEF_FNCCOL));
return true;
} // endif Fncol
} // endif Fncol
if (!Picol) {
// Find default Picol as the last one not equal to Fncol
for (cdp = defp->GetCols(); cdp; cdp = cdp->GetNext())
if (stricmp(Fncol, cdp->GetName()))
Picol = cdp->GetName();
if (!Picol) {
strcpy(g->Message, MSG(NO_DEF_PIVOTCOL));
return true;
} // endif Picol
} // endif Picol
return false;
} // end of FindDefaultColumns
示例13: MakeCol
PCOL TDBXCL::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
{
PCOL colp;
if (!stricmp(cdp->GetName(), Xcolumn)) {
Xcolp = new(g) XCLCOL(g, cdp, this, cprec, n);
colp = Xcolp;
} else
colp = new(g) PRXCOL(cdp, this, cprec, n);
return colp;
} // end of MakeCol
示例14: COLBLK
PRXCOL::PRXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
: COLBLK(cdp, tdbp, i)
{
if (cprec) {
Next = cprec->GetNext();
cprec->SetNext(this);
} else {
Next = tdbp->GetColumns();
tdbp->SetColumns(this);
} // endif cprec
// Set additional Dos access method information for column.
Long = cdp->GetLong(); // Useful ???
//strcpy(F_Date, cdp->F_Date);
Colp = NULL;
To_Val = NULL;
Pseudo = false;
Colnum = cdp->GetOffset(); // If columns are retrieved by number
if (trace)
htrc(" making new %sCOL C%d %s at %p\n", am, Index, Name, this);
} // end of PRXCOL constructor
示例15: MakeCol
PCOL TDBOCCUR::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
{
PCOL colp = NULL;
if (!stricmp(cdp->GetName(), Rcolumn)) {
// Allocate a RANK column
colp = new(g) RANKCOL(cdp, this, n);
} else if (!stricmp(cdp->GetName(), Xcolumn)) {
// Allocate the OCCUR column
colp = Xcolp = new(g) OCCURCOL(cdp, this, n);
} else
return new(g) PRXCOL(cdp, this, cprec, n);
if (cprec) {
colp->SetNext(cprec->GetNext());
cprec->SetNext(colp);
} else {
colp->SetNext(Columns);
Columns = colp;
} // endif cprec
return colp;
} // end of MakeCol