本文整理汇总了C++中IsAlphaNum函数的典型用法代码示例。如果您正苦于以下问题:C++ IsAlphaNum函数的具体用法?C++ IsAlphaNum怎么用?C++ IsAlphaNum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsAlphaNum函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
//读取一个单词
const char* CXML::ReadWord(const char* xml,char* word,int bufsize,TAG **ppTag)
{
assert(bufsize>0 && word);
char* tempWord = word;
*tempWord = '\0';
xml = SkipBlank(xml);
//名称可以以字母,数字,下划线,[,]开头, 中间可以夹杂 点, 冒号, 破折号,[].
if( xml && *xml
&& ( IsAlphaNum((unsigned char) *xml)
|| IsAlpha((unsigned char) *xml)
|| *xml == '_'
|| *xml == '['
|| *xml == ']') )
{
while( xml && *xml
&& ( IsAlphaNum( (unsigned char ) *xml )
|| *xml == '_'
|| *xml == '-'
|| *xml == '.'
|| *xml == ':'
|| *xml == '['
|| *xml == ']') )
{
*tempWord++ = *xml++;
}
*tempWord = '\0';
}
return SkipBlank(xml);
}
示例2: assert
const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncoding encoding )
{
*name = "";
assert( p );
// Names start with letters or underscores.
// Of course, in unicode, tinyxml has no idea what a letter *is*. The
// algorithm is generous.
//
// After that, they can be letters, underscores, numbers,
// hyphens, or colons. (Colons are valid ony for namespaces,
// but tinyxml can't tell namespaces from names.)
if ( p && *p
&& ( IsAlpha( (unsigned char) *p, encoding ) || *p == '_' ) )
{
while( p && *p
&& ( IsAlphaNum( (unsigned char ) *p, encoding )
|| *p == '_'
|| *p == '-'
|| *p == '.'
|| *p == ':' ) )
{
(*name) += *p;
++p;
}
return p;
}
return 0;
}
示例3: newToken
// id - parses an id
bool opScanner::GetId(const inputtype& Input, int& current) {
char c = Input[current];
int size = Input.Size();
if (IsAlpha(c) || c == '_') {
opToken newToken(T_ID, c, CurrentLine);
++current;
while (current < size) {
c = Input[current];
if (!IsAlphaNum(c) && c != '_') break;
newToken.Value += c;
++current;
}
Tokens.push_back(newToken);
return true;
}
return false;
}
示例4: assert
// One of TinyXML's more performance demanding functions. Try to keep the memory overhead down. The
// "assign" optimization removes over 10% of the execution time.
//
const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncoding encoding ) {
// Oddly, not supported on some comilers,
//name->clear();
// So use this:
*name = "";
assert( p );
// Names start with letters or underscores.
// Of course, in unicode, tinyxml has no idea what a letter *is*. The
// algorithm is generous.
//
// After that, they can be letters, underscores, numbers,
// hyphens, or colons. (Colons are valid ony for namespaces,
// but tinyxml can't tell namespaces from names.)
if ( p && *p
&& ( IsAlpha( (unsigned char) *p, encoding ) || *p == '_' ) ) {
const char* start = p;
while( p && *p
&& ( IsAlphaNum( (unsigned char ) *p, encoding )
|| *p == '_'
|| *p == '-'
|| *p == '.'
|| *p == ':' ) ) {
//(*name) += *p; // expensive
++p;
}
if ( p-start > 0 ) {
name->assign( start, p-start );
}
return p;
}
return 0;
}
示例5: main
int main()
{
int c;
int state;
int len;
state = 0;
len = 0;
do {
c = getchar();
switch (state) {
case 0:
if (IsAlphaNum(c)) {
buf[len] = c;
len++;
state = 1;
}
else {
if (c != EOF) putchar(c);
}
break;
case 1:
if (IsAlphaNum(c)) {
buf[len] = c;
len++;
}
else {
buf[len] = '\0';
PrintName(buf);
len = 0;
if (c != EOF) putchar(c);
state = 0;
}
break;
}
} while (c != EOF);
return 0;
}
示例6: SetAssetNumber
gcc_unused
static bool
SetAssetNumber(const TCHAR *p)
{
size_t length = 0;
while (length < ARRAY_SIZE(asset_number) - 1 && *p != _T('\0')) {
if (IsAlphaNum(*p))
asset_number[length++] = *p;
++p;
}
if (length < 3) {
asset_number[0] = _T('\0');
return false;
}
return true;
}
示例7: while
void CppScanner::GetName()
{
char s[512];
int i = 0;
do
{
s[i++] = f.Get();
if (i > 511) throw CPError(CPError::NAME_TOO_LONG);
f.GetNext();
} while (IsAlphaNum(f.Get()));
s[i] = 0;
type = CToken::SYMBOL;
if (!strcmp(s, "void")) symbol = CToken::SYMB_VOID;
else if (!strcmp(s, "bool")) symbol = CToken::SYMB_BOOL;
else if (!strcmp(s, "int8_t")) symbol = CToken::SYMB_CHAR;
else if (!strcmp(s, "int16_t")) symbol = CToken::SYMB_SHORT;
else if (!strcmp(s, "int32_t")) symbol = CToken::SYMB_INT;
else if (!strcmp(s, "int64_t")) symbol = CToken::SYMB_LONG;
else if (!strcmp(s, "uint8_t")) symbol = CToken::SYMB_UCHAR;
else if (!strcmp(s, "uint16_t")) symbol = CToken::SYMB_USHORT;
else if (!strcmp(s, "uint32_t")) symbol = CToken::SYMB_UINT;
else if (!strcmp(s, "uint64_t")) symbol = CToken::SYMB_ULONG;
else if (!strcmp(s, "vector")) symbol = CToken::SYMB_VECTOR;
else if (!strcmp(s, "vectorR")) symbol = CToken::SYMB_VECTORR;
else if (!strcmp(s, "HWvectorR")) symbol = CToken::SYMB_HWVECTORR;
else if (!strcmp(s, "string")) symbol = CToken::SYMB_STRING;
else if (!strcmp(s, "stringR")) symbol = CToken::SYMB_STRINGR;
else if (!strcmp(s, "stringR")) symbol = CToken::SYMB_STRINGR;
else if (!strcmp(s, "false")) symbol = CToken::SYMB_FALSE;
else if (!strcmp(s, "true")) symbol = CToken::SYMB_TRUE;
else if (!strcmp(s, "static")) symbol = CToken::SYMB_STATIC;
else
{
type = CToken::NAME;
name = new char[i+1];
strcpy(name, s);
}
}
示例8: getToken
//.........这里部分代码省略.........
if (!(buffer[1] == L'x' || buffer[1] == L'X'))
{
for (ptrbuffer=buffer; *ptrbuffer ; ptrbuffer++)
{
if (*ptrbuffer == L'e' || *ptrbuffer == L'E' || *ptrbuffer == L'.')
{
CheckIntNumber=false;
break;
}
else if (!iswdigit(*ptrbuffer))
break;
}
}
}
else
CheckIntNumber=false;
if (CheckIntNumber)
{
currVar = _wcstoi64(buffer,&ptrbuffer,0);
currTok = tInt;
}
else
{
currVar = wcstod(buffer,&ptrbuffer);
currTok = tFloat;
}
break;
}
case L'%':
ch = getChar();
if ((IsAlphaNum(ch) || ch == L'_') || (ch == L'%' && (IsAlphaNum(*sSrcString) || *sSrcString == L'_')))
{
getVarName(ch);
putBack(ch);
currTok = tVar;
}
else
keyMacroParseError(err_Var_Expected,L""); // BUG nameString
break;
default:
{
if (IsAlpha(ch)) // || ch == L'_' ????
{
TToken __currTok = tNo;
getFarName(ch);
if (ch == L' ')
{
while (ch == L' ')
ch = getNextChar();
}
if (ch == L'(') //!!!! а пробелы пропустить? ДА!
__currTok = tFunc;
else
{
putBack(ch);
for (int i = 0 ; i < MKeywordsSize ; i++)
if (!StrCmpI(nameString, MKeywords[i].Name))
{
FARVar = MKeywords[i].Value;
示例9: __parseMacroString
//- AN ----------------------------------------------
// Компиляция строки BufPtr в байткод CurMacroBuffer
//- AN ----------------------------------------------
int __parseMacroString(DWORD *&CurMacroBuffer, int &CurMacroBufferSize, const wchar_t *BufPtr)
{
_KEYMACRO(CleverSysLog Clev(L"parseMacroString"));
//_KEYMACRO(SysLog(L"BufPtr[%p]='%s'", BufPtr,BufPtr));
_macro_nErr = 0;
_macro_nLine= 0;
_macro_nPos = 0;
pSrcString = emptyString;
inloop = 0;
/*pSrcString = */oSrcString = sSrcString = emptyString;
if (!BufPtr || !*BufPtr)
{
keyMacroParseError(err_ZeroLengthMacro);
return FALSE;
}
bool useUDL=true;
const wchar_t *NewBufPtr;
UserDefinedList MacroSrcList(ULF_NOTRIM|ULF_NOUNQUOTE, L"\r\n");
if(!MacroSrcList.Set(BufPtr))
useUDL=false; // все в одну строку
//{
// _SVS(SysLog(L"MacroSrcList.GetTotal()=%d",MacroSrcList.GetTotal()));
// while((NewBufPtr=MacroSrcList.GetNext()) )
// _SVS(SysLog(L"[%s]",NewBufPtr));
// MacroSrcList.Reset();
//}
size_t SizeCurKeyText = (StrLength(BufPtr)*2)*sizeof(wchar_t);
string strCurrKeyText;
//- AN ----------------------------------------------
// Буфер под парсинг выражений
//- AN ----------------------------------------------
DWORD *dwExprBuff = (DWORD*)xf_malloc(SizeCurKeyText*sizeof(DWORD));
if (!dwExprBuff)
return FALSE;
TExec exec;
wchar_t varName[256];
DWORD KeyCode, *CurMacro_Buffer = nullptr;
if(useUDL)
BufPtr=MacroSrcList.GetNext();
pSrcString=BufPtr;
for (;;)
{
int Size = 1;
int SizeVarName = 0;
const wchar_t *oldBufPtr = BufPtr;
if (!(BufPtr = __GetNextWord(BufPtr, strCurrKeyText, _macro_nLine)))
{
if(!useUDL)
break;
NewBufPtr=MacroSrcList.GetNext();
if(!NewBufPtr)
break;
_macro_nLine++;
pSrcString=BufPtr=NewBufPtr;
continue;
}
_SVS(SysLog(L"_macro_nLine = [%d]",_macro_nLine));
_SVS(SysLog(L"BufPtr = [%s]",BufPtr));
_SVS(SysLog(L"pSrcString = [%s]",pSrcString));
_SVS(SysLog(L"strCurrKeyText = [%s]",strCurrKeyText.CPtr()));
//- AN ----------------------------------------------
// Проверка на строковый литерал
// Сделаем $Text опциональным
//- AN ----------------------------------------------
if (strCurrKeyText.At(0) == L'\"' && strCurrKeyText.At(1))
{
KeyCode = MCODE_OP_PLAINTEXT;
BufPtr = oldBufPtr;
}
else if ((KeyCode = KeyNameMacroToKey(strCurrKeyText)) == (DWORD)-1 && (KeyCode = KeyNameToKey(strCurrKeyText)) == (DWORD)-1)
{
int ProcError=0;
if (strCurrKeyText.At(0) == L'%' &&
(
(IsAlphaNum(strCurrKeyText.At(1)) || strCurrKeyText.At(1) == L'_') ||
(
strCurrKeyText.At(1) == L'%' &&
(IsAlphaNum(strCurrKeyText.At(2)) || strCurrKeyText.At(2)==L'_')
)
)
)
{
BufPtr = oldBufPtr;
while (*BufPtr && (IsSpace(*BufPtr) || IsEol(*BufPtr)))
//.........这里部分代码省略.........
示例10: LoggerHeader
//
// This is called by Calc/Task thread, after calling StartLogger
//
void LoggerHeader(void)
{
char datum[]= "HFDTM100GPSDATUM:WGS-84\r\n";
char temp[100];
// Flight recorder ID number MUST go first..
// Do one more check on %C because if one is 0 the string will not be closed by newline
// resulting in a wrong header!
strAssetNumber[0]= IsAlphaNum(strAssetNumber[0]) ? strAssetNumber[0] : _T('A');
strAssetNumber[1]= IsAlphaNum(strAssetNumber[1]) ? strAssetNumber[1] : _T('A');
strAssetNumber[2]= IsAlphaNum(strAssetNumber[0]) ? strAssetNumber[2] : _T('A');
sprintf(temp,
"A%s%C%C%C\r\n",
LOGGER_MANUFACTURER,
strAssetNumber[0],
strAssetNumber[1],
strAssetNumber[2]);
IGCWriteRecord(temp);
sprintf(temp,"HFDTE%02d%02d%02d\r\n",
GPS_INFO.Day,
GPS_INFO.Month,
GPS_INFO.Year % 100);
IGCWriteRecord(temp);
// Example: Hanna.Reitsch
sprintf(temp,"HFPLTPILOT:%S\r\n", PilotName_Config);
IGCWriteRecord(temp);
// Example: DG-300
sprintf(temp,"HFGTYGLIDERTYPE:%S\r\n", AircraftType_Config);
IGCWriteRecord(temp);
// Example: D-7176
sprintf(temp,"HFGIDGLIDERID:%S\r\n", AircraftRego_Config);
IGCWriteRecord(temp);
// 110117 TOCHECK: maybe a 8 char limit is needed.
sprintf(temp,"HFCCLCOMPETITIONCLASS:%S\r\n", CompetitionClass_Config);
IGCWriteRecord(temp);
sprintf(temp,"HFCIDCOMPETITIONID:%S\r\n", CompetitionID_Config);
IGCWriteRecord(temp);
#ifndef LKCOMPETITION
sprintf(temp,"HFFTYFRTYPE:%s\r\n", LKFORK); // default
#else
sprintf(temp,"HFFTYFRTYPE:%sC\r\n", LKFORK); // default
#endif
// PNAs are also PPC2003, so careful
#ifdef PNA
char pnamodel[MAX_PATH+1];
ConvertTToC(pnamodel,GlobalModelName);
pnamodel[_tcslen(GlobalModelName)]='\0';
#ifndef LKCOMPETITION
sprintf(temp,"HFFTYFRTYPE:%s PNA %s\r\n", LKFORK,pnamodel);
#else
sprintf(temp,"HFFTYFRTYPE:%sC PNA %s\r\n", LKFORK,pnamodel);
#endif
#else
#ifdef PPC2002
#ifndef LKCOMPETITION
sprintf(temp,"HFFTYFRTYPE:%s PPC2002\r\n", LKFORK);
#else
sprintf(temp,"HFFTYFRTYPE:%sC PPC2002\r\n", LKFORK);
#endif
#endif
// PNA is also PPC2003..
#ifdef PPC2003
#ifndef LKCOMPETITION
sprintf(temp,"HFFTYFRTYPE:%s PPC2003\r\n", LKFORK);
#else
sprintf(temp,"HFFTYFRTYPE:%sC PPC2003\r\n", LKFORK);
#endif
#endif
#endif
IGCWriteRecord(temp);
#ifndef LKCOMPETITION
sprintf(temp,"HFRFWFIRMWAREVERSION:%s.%s\r\n", LKVERSION, LKRELEASE);
#else
sprintf(temp,"HFRFWFIRMWAREVERSION:%s.%s.COMPETITION\r\n", LKVERSION, LKRELEASE);
#endif
IGCWriteRecord(temp);
IGCWriteRecord(datum);
}
示例11: StartLogger
void StartLogger()
{
HANDLE hFile;
int i;
TCHAR path[MAX_PATH+1];
TCHAR cAsset[3];
// strAsset is initialized with DUM.
if (_tcslen(PilotName_Config)>0) {
strAssetNumber[0]= IsAlphaNum(PilotName_Config[0]) ? PilotName_Config[0] : _T('A');
strAssetNumber[1]= IsAlphaNum(PilotName_Config[1]) ? PilotName_Config[1] : _T('A');
} else {
strAssetNumber[0]= _T('D');
strAssetNumber[1]= _T('U');
}
if (_tcslen(AircraftType_Config)>0) {
strAssetNumber[2]= IsAlphaNum(AircraftType_Config[0]) ? AircraftType_Config[0] : _T('A');
} else {
strAssetNumber[2]= _T('M');
}
strAssetNumber[0]= towupper(strAssetNumber[0]);
strAssetNumber[1]= towupper(strAssetNumber[1]);
strAssetNumber[2]= towupper(strAssetNumber[2]);
strAssetNumber[3]= _T('\0');
for (i=0; i < 3; i++) { // chars must be legal in file names
cAsset[i] = IsAlphaNum(strAssetNumber[i]) ? strAssetNumber[i] : _T('A');
}
LocalPath(path,TEXT(LKD_LOGS));
if (TaskModified) {
SaveDefaultTask();
}
wsprintf(szLoggerFileName, TEXT("%s\\LOGGER_TMP.IGC"), path);
wsprintf(szSLoggerFileName, TEXT("%s\\LOGGER_SIG.IGC"), path);
TCHAR newfile[MAX_PATH+20];
if (GetFileAttributes(szLoggerFileName) != 0xffffffff) {
StartupStore(_T("---- Logger recovery: Existing LOGGER_TMP.IGC found, renamed to LOST%s"),NEWLINE);
wsprintf(newfile, TEXT("%s\\LOST_%02d%02d%02d.IGC"), path, GPS_INFO.Hour, GPS_INFO.Minute, GPS_INFO.Second);
CopyFile(szLoggerFileName,newfile,TRUE);
DeleteFile(szLoggerFileName);
}
if (GetFileAttributes(szSLoggerFileName) != 0xffffffff) {
StartupStore(_T("---- Logger recovery (G): Existing LOGGER_SIG.IGC found, renamed to LOSTG%s"),NEWLINE);
wsprintf(newfile, TEXT("%s\\LOSTG_%02d%02d%02d.IGC"), path, GPS_INFO.Hour, GPS_INFO.Minute, GPS_INFO.Second);
CopyFile(szSLoggerFileName,newfile,TRUE);
DeleteFile(szSLoggerFileName);
}
for(i=1;i<99;i++)
{
// 2003-12-31-XXX-987-01.IGC
// long filename form of IGC file.
// XXX represents manufacturer code
if (!LoggerShortName) {
// Long file name
wsprintf(szFLoggerFileName,
TEXT("%s\\%04d-%02d-%02d-%s-%c%c%c-%02d.IGC"),
path,
GPS_INFO.Year,
GPS_INFO.Month,
GPS_INFO.Day,
_T(LOGGER_MANUFACTURER),
cAsset[0],
cAsset[1],
cAsset[2],
i);
wsprintf(szFLoggerFileNameRoot,
TEXT("%s\\%04d-%02d-%02d-%s-%c%c%c-%02d.IGC"),
TEXT(""), // this creates it in root if MoveFile() fails
GPS_INFO.Year,
GPS_INFO.Month,
GPS_INFO.Day,
_T(LOGGER_MANUFACTURER),
cAsset[0],
cAsset[1],
cAsset[2],
i);
} else {
// Short file name
TCHAR cyear, cmonth, cday, cflight;
cyear = NumToIGCChar((int)GPS_INFO.Year % 10);
cmonth = NumToIGCChar(GPS_INFO.Month);
cday = NumToIGCChar(GPS_INFO.Day);
cflight = NumToIGCChar(i);
wsprintf(szFLoggerFileName,
TEXT("%s\\%c%c%cX%c%c%c%c.IGC"),
path,
cyear,
cmonth,
cday,
cAsset[0],
cAsset[1],
cAsset[2],
cflight);
//.........这里部分代码省略.........
示例12: FilterList
//.........这里部分代码省略.........
case KEY_NUMDEL:
case KEY_DEL:
{
int SelPos=FilterList.GetSelectPos();
if (SelPos<0)
break;
if (SelPos<(int)FilterData.getCount())
{
string strQuotedTitle=FilterData.getItem(SelPos)->GetTitle();
InsertQuote(strQuotedTitle);
if (!Message(0,2,MSG(MFilterTitle),MSG(MAskDeleteFilter),
strQuotedTitle,MSG(MDelete),MSG(MCancel)))
{
FilterData.deleteItem(SelPos);
FilterList.DeleteItem(SelPos);
FilterList.SetSelectPos(SelPos,1);
FilterList.SetPosition(-1,-1,0,0);
FilterList.Show();
bNeedUpdate=true;
}
}
else if (SelPos>(int)FilterData.getCount())
{
Message(MSG_WARNING,1,MSG(MFilterTitle),MSG(MCanDeleteCustomFilterOnly),MSG(MOk));
}
break;
}
case KEY_CTRLUP:
case KEY_RCTRLUP:
case KEY_CTRLDOWN:
case KEY_RCTRLDOWN:
{
int SelPos=FilterList.GetSelectPos();
if (SelPos<0)
break;
if (SelPos<(int)FilterData.getCount() && !((Key==KEY_CTRLUP || Key==KEY_RCTRLUP) && !SelPos) &&
!((Key==KEY_CTRLDOWN || Key==KEY_RCTRLDOWN) && SelPos==(int)(FilterData.getCount()-1)))
{
int NewPos = SelPos + ((Key == KEY_CTRLDOWN || Key == KEY_RCTRLDOWN) ? 1 : -1);
MenuItemEx CurItem = *FilterList.GetItemPtr(SelPos);
MenuItemEx NextItem = *FilterList.GetItemPtr(NewPos);
FilterData.swapItems(NewPos,SelPos);
if (NewPos<SelPos)
{
FilterList.DeleteItem(NewPos,2);
FilterList.AddItem(&CurItem,NewPos);
FilterList.AddItem(&NextItem,SelPos);
}
else
{
FilterList.DeleteItem(SelPos,2);
FilterList.AddItem(&NextItem,SelPos);
FilterList.AddItem(&CurItem,NewPos);
}
FilterList.SetSelectPos(NewPos,1);
FilterList.SetUpdateRequired(TRUE);
FilterList.FastShow();
bNeedUpdate=true;
}
break;
}
default:
{
FilterList.ProcessInput();
//заставляем хоткеи позиционировать курсор на пункте но не закрывать меню
if (Key!=KEY_NUMENTER && Key!=KEY_ENTER && Key!=KEY_ESC && Key!=KEY_F10 && (IsAlphaNum(Key) || Key&(KEY_ALT|KEY_RALT)))
FilterList.ClearDone();
}
}
}
FilterList.Hide();
ExitCode=FilterList.Modal::GetExitCode();
if (ExitCode!=-1)
ProcessSelection(&FilterList);
if (Opt.AutoSaveSetup)
SaveFilters();
if (ExitCode!=-1 || bNeedUpdate)
{
if (m_FilterType == FFT_PANEL)
{
GetHostPanel()->Update(UPDATE_KEEP_SELECTION);
GetHostPanel()->Redraw();
}
}
bMenuOpen = false;
return (ExitCode!=-1);
}
示例13: IsAlphaNum
void
LoggerImpl::StartLogger(const NMEA_INFO &gps_info,
const SETTINGS_COMPUTER &settings,
const TCHAR *astrAssetNumber)
{
HANDLE hFile;
int i;
TCHAR path[MAX_PATH];
TCHAR cAsset[3];
for (i=0; i < 3; i++) { // chars must be legal in file names
cAsset[i] = IsAlphaNum(strAssetNumber[i]) ? strAssetNumber[i] : _T('A');
}
// VENTA3 use logs subdirectory when not in main memory (true for FIVV and PNA)
#if defined(GNAV) || defined(FIVV) || defined(PNA)
LocalPath(path,TEXT("logs"));
#else
LocalPath(path);
#endif
if (task.isTaskModified()) {
task.SaveDefaultTask();
}
#ifdef WINDOWSPC
_stprintf(szLoggerFileName, TEXT("/tmp/tmp.IGC"));
#else
_stprintf(szLoggerFileName, TEXT("\\tmp.IGC"));
#endif
DeleteFile(szLoggerFileName);
LoggerGInit();
for(i=1;i<99;i++)
{
// 2003-12-31-XXX-987-01.IGC
// long filename form of IGC file.
// XXX represents manufacturer code
if (!settings.LoggerShortName) {
// Long file name
_stprintf(szFLoggerFileName,
TEXT("%s\\%04d-%02d-%02d-XCS-%c%c%c-%02d.IGC"),
path,
gps_info.Year,
gps_info.Month,
gps_info.Day,
cAsset[0],
cAsset[1],
cAsset[2],
i);
_stprintf(szFLoggerFileNameRoot,
TEXT("%s\\%04d-%02d-%02d-XCS-%c%c%c-%02d.IGC"),
TEXT(""), // this creates it in root if MoveFile() fails
gps_info.Year,
gps_info.Month,
gps_info.Day,
cAsset[0],
cAsset[1],
cAsset[2],
i);
} else {
// Short file name
TCHAR cyear, cmonth, cday, cflight;
cyear = NumToIGCChar((int)gps_info.Year % 10);
cmonth = NumToIGCChar(gps_info.Month);
cday = NumToIGCChar(gps_info.Day);
cflight = NumToIGCChar(i);
_stprintf(szFLoggerFileName,
TEXT("%s\\%c%c%cX%c%c%c%c.IGC"),
path,
cyear,
cmonth,
cday,
cAsset[0],
cAsset[1],
cAsset[2],
cflight);
_stprintf(szFLoggerFileNameRoot,
TEXT("%s\\%c%c%cX%c%c%c%c.IGC"),
TEXT(""), // this creates it in root if MoveFile() fails
cyear,
cmonth,
cday,
cAsset[0],
cAsset[1],
cAsset[2],
cflight);
} // end if
hFile = CreateFile(szFLoggerFileName, GENERIC_WRITE,
FILE_SHARE_WRITE, NULL, CREATE_NEW,
FILE_ATTRIBUTE_NORMAL, 0);
if(hFile!=INVALID_HANDLE_VALUE )
{
// file already exists
CloseHandle(hFile);
DeleteFile(szFLoggerFileName);
//.........这里部分代码省略.........