本文整理汇总了C++中PCOLDEF::GetLong方法的典型用法代码示例。如果您正苦于以下问题:C++ PCOLDEF::GetLong方法的具体用法?C++ PCOLDEF::GetLong怎么用?C++ PCOLDEF::GetLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PCOLDEF
的用法示例。
在下文中一共展示了PCOLDEF::GetLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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
示例2: 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
示例3: AllocateBuffer
bool DBFFAM::AllocateBuffer(PGLOBAL g)
{
char c;
int rc;
MODE mode = Tdbp->GetMode();
Buflen = Blksize;
To_Buf = (char*)PlugSubAlloc(g, NULL, Buflen);
if (mode == MODE_INSERT) {
#if defined(WIN32)
/************************************************************************/
/* Now we can revert to binary mode in particular because the eventual */
/* writing of a new header must be done in binary mode to avoid */
/* translating 0A bytes (LF) into 0D0A (CRLF) by Windows in text mode. */
/************************************************************************/
if (_setmode(_fileno(Stream), _O_BINARY) == -1) {
sprintf(g->Message, MSG(BIN_MODE_FAIL), strerror(errno));
return true;
} // endif setmode
#endif // WIN32
/************************************************************************/
/* If this is a new file, the header must be generated. */
/************************************************************************/
int len = GetFileLength(g);
if (!len) {
// Make the header for this DBF table file
struct tm *datm;
int hlen, n = 0;
ushort reclen = 1;
time_t t;
DBFHEADER *header;
DESCRIPTOR *descp;
PCOLDEF cdp;
PDOSDEF tdp = (PDOSDEF)Tdbp->GetDef();
// Count the number of columns
for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext())
if (!(cdp->Flags & U_SPECIAL)) {
reclen += cdp->GetLong();
n++;
} // endif Flags
if (Lrecl != reclen) {
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, reclen);
return true;
} // endif Lrecl
hlen = HEADLEN * (n + 1) + 2;
header = (DBFHEADER*)PlugSubAlloc(g, NULL, hlen);
memset(header, 0, hlen);
header->Version = DBFTYPE;
t = time(NULL) - (time_t)DTVAL::GetShift();
datm = gmtime(&t);
header->Filedate[0] = datm->tm_year - 100;
header->Filedate[1] = datm->tm_mon + 1;
header->Filedate[2] = datm->tm_mday;
header->Headlen = (ushort)hlen;
header->Reclen = (ushort)reclen;
descp = (DESCRIPTOR*)header;
// Currently only standard Xbase types are supported
for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext())
if (!(cdp->Flags & U_SPECIAL)) {
descp++;
switch ((c = *GetFormatType(cdp->GetType()))) {
case 'S': // Short integer
case 'L': // Large (big) integer
case 'T': // Tiny integer
c = 'N'; // Numeric
case 'N': // Numeric (integer)
case 'F': // Float (double)
descp->Decimals = (uchar)cdp->F.Prec;
case 'C': // Char
case 'D': // Date
break;
default: // Should never happen
sprintf(g->Message, "Unsupported DBF type %c for column %s",
c, cdp->GetName());
return true;
} // endswitch c
strncpy(descp->Name, cdp->GetName(), 11);
descp->Type = c;
descp->Length = (uchar)cdp->GetLong();
} // endif Flags
*(char*)(++descp) = EOH;
// Now write the header
if (fwrite(header, 1, hlen, Stream) != (unsigned)hlen) {
sprintf(g->Message, MSG(FWRITE_ERROR), strerror(errno));
return true;
} // endif fwrite
Records = 0;
Headlen = hlen;
//.........这里部分代码省略.........