• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CharNext函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CharNext函数的典型用法代码示例。如果您正苦于以下问题:C++ CharNext函数的具体用法?C++ CharNext怎么用?C++ CharNext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CharNext函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _ASSERTE

HRESULT CComModule::RegisterTypeLib()
{
	USES_CONVERSION;
	_ASSERTE(m_hInst != NULL);
	TCHAR szModule[_MAX_PATH+4];
	TCHAR szDir[_MAX_PATH];
	GetModuleFileName(GetTypeLibInstance(), szModule, _MAX_PATH);
	CComPtr<ITypeLib> pTypeLib;
	HRESULT hr = LoadTypeLib(T2OLE(szModule), &pTypeLib);
	if (!SUCCEEDED(hr))
	{
		// typelib not in module, try <module>.tlb instead
		LPTSTR lpszExt = szModule + lstrlen(szModule);
		for (LPTSTR lpsz = szModule; *lpsz != '\0'; lpsz = CharNext(lpsz))
		{
			if (*lpsz == '.')
				lpszExt = lpsz;
		}
		_ASSERTE(lpszExt != NULL);
		lstrcpy(lpszExt, _T(".tlb"));
		hr = LoadTypeLib(T2OLE(szModule), &pTypeLib);
	}
	if (SUCCEEDED(hr))
	{
		int nLen = lstrlen(szModule) - AtlGetFileName(szModule, NULL, 0);
		lstrcpy(szDir, szModule);
		szDir[nLen] = 0;
		return ::RegisterTypeLib(pTypeLib, T2OLE(szModule), T2OLE(szDir));
	}
	return S_FALSE;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:31,代码来源:atlimpl.cpp


示例2: FindOneOf

LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2)
{
    while (p1 != NULL && *p1 != NULL)
    {
        LPCTSTR p = p2;
        while (p != NULL && *p != NULL)
        {
            if (*p1 == *p)
                return CharNext(p1);
            p = CharNext(p);
        }
        p1 = CharNext(p1);
    }
    return NULL;
}
开发者ID:AlexS2172,项目名称:IVRM,代码行数:15,代码来源:hyperfeedproviders.cpp


示例3: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
  DWORD               Ret;
  STARTUPINFO         si   = {0};
  PROCESS_INFORMATION pi   = {0};
  char command_line[1024];
  char seekchar=' ';
  char *cmdline;
  
  si.cb = sizeof(si);
  // Make child process use this app's standard files. Not needed because the handles
  // we created when executing this process were inheritable.
  //si.dwFlags    = STARTF_USESTDHANDLES;
  //si.hStdInput  = GetStdHandle (STD_INPUT_HANDLE);
  //si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE);
  //si.hStdError  = GetStdHandle (STD_ERROR_HANDLE);
  lstrcpyn(command_line, GetCommandLine(), 1024);
  
  cmdline = command_line;
  if (*cmdline == '\"') seekchar = *cmdline++;

  while (*cmdline && *cmdline != seekchar) cmdline=CharNext(cmdline);
  cmdline=CharNext(cmdline);
  // skip any spaces before the arguments
  while (*cmdline && *cmdline == ' ') cmdline++;

  Ret = CreateProcess (NULL, cmdline,
    NULL, NULL,
    TRUE, 0,
    NULL, NULL,
    &si, &pi
    );

  if (Ret)
  {
    WaitForSingleObject(pi.hProcess, INFINITE);
    GetExitCodeProcess(pi.hProcess, &Ret);
    CloseHandle (pi.hProcess);
    CloseHandle (pi.hThread);
    ExitProcess(Ret);
  }
  else
  {
    ExitProcess(STATUS_ILLEGAL_INSTRUCTION);
  }

  return 0; // dummy
}
开发者ID:kichik,项目名称:nsis-1,代码行数:48,代码来源:nsexec.c


示例4: push_include_cygwin

static void
push_include_cygwin(const char *path, VALUE (*filter)(VALUE))
{
    const char *p, *s;
    char rubylib[FILENAME_MAX];
    VALUE buf = 0;

    p = path;
    while (*p) {
	unsigned int len;
	while (*p == ';')
	    p++;
	if (!*p) break;
	for (s = p; *s && *s != ';'; s = CharNext(s));
	len = s - p;
	if (*s) {
	    if (!buf) {
		buf = rb_str_new(p, len);
		p = RSTRING_PTR(buf);
	    }
	    else {
		rb_str_resize(buf, len);
		p = strncpy(RSTRING_PTR(buf), p, len);
	    }
	}
	if (cygwin_conv_to_posix_path(p, rubylib) == 0)
	    p = rubylib;
	push_include(p, filter);
	if (!*s) break;
	p = s + 1;
    }
}
开发者ID:Netfart,项目名称:rhodes,代码行数:32,代码来源:ruby.c


示例5: CharFirst

VOID ACLStr::RTrim(VOID)
{
	LPTSTR string			= CharFirst();
	LPTSTR lastWhiteSpace	= NULL;

	//	Loop over the string looking
	//	for white spaces. We start at the
	//	front since we want to be DBCS compatible.
	//	At least that's the HOPE! :-)
	while(*string != '\0')
	{
		if (*string == CH_SPACE)
		{
			if (lastWhiteSpace == NULL)
			{
				lastWhiteSpace = string;
			}
		}
		else
			lastWhiteSpace = NULL;

		//	Bump our current pointer to the next
		//	character in the stream.
		//
		string = CharNext();
	}	//	while.

	//	Move the NULL terminator to the
	//	new location.
	if (lastWhiteSpace != NULL)
	{
		*lastWhiteSpace	= '\0';
		_length			= (lastWhiteSpace - _string);
	}
} // RTrim
开发者ID:Fahrni,项目名称:ACLLib,代码行数:35,代码来源:ACLStr.cpp


示例6: FindFormat

/*--------------------------------------------------
--------------------------------------- Check Format
--------------------------------------------------*/
DWORD FindFormat(const char* fmt)
{
	DWORD ret = 0;
	
	while(*fmt) {
		if(*fmt == '"') {
			do{
				for(++fmt; *fmt&&*fmt++!='"'; );
			}while(*fmt == '"');
			if(!*fmt)
				break;
		}
		
		else if(*fmt == 's') {
			fmt++;
			ret |= FORMAT_SECOND;
		}
		else if(*fmt == 'T' && strncmp(fmt, "TIME", 4) == 0) {
			fmt += 4;
			ret |= FORMAT_SECOND;
		}
		
		else if(*fmt == '@' && fmt[1] == '@' && fmt[2] == '@') {
			fmt += 3;
			if(*fmt == '.' && fmt[1] == '@') {
				ret |= FORMAT_BEAT2;
				fmt += 2;
			} else ret |= FORMAT_BEAT1;
		}
		
		else fmt = CharNext(fmt);
	}
	return ret;
}
开发者ID:dubepaul,项目名称:T-Clock,代码行数:37,代码来源:format.c


示例7: add_title

/*-------------------------------------------
 パス名にファイル名をつける
---------------------------------------------*/
void add_title(char *path, char *title)
{
	char *p;
	
	p = path;

	if(*title && *(title + 1) == ':') ;
	else if(*title == '\\')
	{
		if(*p && *(p + 1) == ':') p += 2;
	}
	else
	{
		while(*p)
		{
			if((*p == '\\' || *p == '/') && *(p + 1) == 0)
			{
				break;
			}
			p = (char *)CharNext(p);
		}
		*p++ = '\\';
	}
	while(*title) *p++ = *title++;
	*p = 0;
}
开发者ID:Nikers,项目名称:T-Clock,代码行数:29,代码来源:UTL.C


示例8: WordCmpI

static int WordCmpI(LPCTSTR psz1, LPCTSTR psz2) throw()
{
    TCHAR c1 = (TCHAR)CharUpper((LPTSTR)*psz1);
    TCHAR c2 = (TCHAR)CharUpper((LPTSTR)*psz2);
    while (c1 != NULL && c1 == c2 && c1 != ' ' && c1 != '\t')
    {
        psz1 = CharNext(psz1);
        psz2 = CharNext(psz2);
        c1 = (TCHAR)CharUpper((LPTSTR)*psz1);
        c2 = (TCHAR)CharUpper((LPTSTR)*psz2);
    }
    if ((c1 == NULL || c1 == ' ' || c1 == '\t') && (c2 == NULL || c2 == ' ' || c2 == '\t'))
        return 0;

    return (c1 < c2) ? -1 : 1;
}
开发者ID:gvsurenderreddy,项目名称:VirtualBox-OSE,代码行数:16,代码来源:svcmain.cpp


示例9: translate_char

static inline void
translate_char(char *p, int from, int to)
{
    while (*p) {
	if ((unsigned char)*p == from)
	    *p = to;
	p = CharNext(p);
    }
}
开发者ID:Netfart,项目名称:rhodes,代码行数:9,代码来源:ruby.c


示例10: _get_cmd_arg

TCHAR *
_get_cmd_arg(TCHAR *pCmdLine)
{
    static TCHAR *pArgs = NULL;
    TCHAR *pRetArg;
    BOOL bQuoted;

    if (!pCmdLine && !pArgs)
        return NULL;
    if (!pArgs)
        pArgs = pCmdLine;

    /* skip whitespace */
    for (pRetArg = pArgs; *pRetArg && _istspace(*pRetArg);
         pRetArg = CharNext(pRetArg))
        ;
    if (!*pRetArg) {
        pArgs = NULL;
        return NULL;
    }

    /* check for quote */
    if (*pRetArg == TEXT('"')) {
        bQuoted = TRUE;
        pRetArg = CharNext(pRetArg);
        pArgs = _tcschr(pRetArg, TEXT('"'));
    } else {
        /* skip to whitespace */
        for (pArgs = pRetArg; *pArgs && !_istspace(*pArgs);
             pArgs = CharNext(pArgs))
            ;
    }

    if (pArgs && *pArgs) {
        TCHAR *p;
        p = pArgs;
        pArgs = CharNext(pArgs);
        *p = (TCHAR) 0;
    } else {
        pArgs = NULL;
    }

    return pRetArg;
}
开发者ID:Elronnd,项目名称:nethack-360-nao,代码行数:44,代码来源:winhack.c


示例11: FindChar

LPTSTR FindChar(LPTSTR lpsz, TCHAR ch)
{
        while (*lpsz != 0)
        {
                if (*lpsz == ch)
                        return lpsz;
                lpsz = CharNext(lpsz);
        }
        return NULL;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:10,代码来源:utility.cpp


示例12: FindReverseChar

LPTSTR FindReverseChar(LPTSTR lpsz, TCHAR ch)
{
        LPTSTR lpszLast = NULL;
        while (*lpsz != 0)
        {
                if (*lpsz == ch)
                        lpszLast = lpsz;
                lpsz = CharNext(lpsz);
        }
        return lpszLast;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:11,代码来源:utility.cpp


示例13: HasBlanks

BOOL HasBlanks(
    LPTSTR psz)
{
    while (*psz) {
        if (*psz == CHAR_SPACE)
            return TRUE;
        else
            psz = CharNext(psz);
    }

    return FALSE;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:12,代码来源:util.c


示例14: AtlGetFileName

static UINT PASCAL AtlGetFileName(LPCTSTR lpszPathName, LPTSTR lpszTitle, UINT nMax)
{
	_ASSERTE(lpszPathName != NULL);

	// always capture the complete file name including extension (if present)
	LPTSTR lpszTemp = (LPTSTR)lpszPathName;
	for (LPCTSTR lpsz = lpszPathName; *lpsz != '\0'; lpsz = CharNext(lpsz))
	{
		// remember last directory/drive separator
		if (*lpsz == '\\' || *lpsz == '/' || *lpsz == ':')
			lpszTemp = (LPTSTR)CharNext(lpsz);
	}

	// lpszTitle can be NULL which just returns the number of bytes
	if (lpszTitle == NULL)
		return lstrlen(lpszTemp)+1;

	// otherwise copy it into the buffer provided
	lstrcpyn(lpszTitle, lpszTemp, nMax);
	return 0;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:21,代码来源:atlimpl.cpp


示例15: lstrncmpi

static int lstrncmpi (LPCTSTR pszA, LPCTSTR pszB, size_t cch)
{
   if (!pszA || !pszB)
      {
      return (!pszB) - (!pszA);   // A,!B:1, !A,B:-1, !A,!B:0
      }

   for ( ; cch > 0; cch--, pszA = CharNext(pszA), pszB = CharNext(pszB))
      {
      TCHAR chA = toupper( *pszA );
      TCHAR chB = toupper( *pszB );

      if (!chA || !chB)
         return (!chB) - (!chA);    // A,!B:1, !A,B:-1, !A,!B:0

      if (chA != chB)
         return (int)(chA) - (int)(chB);   // -1:A<B, 0:A==B, 1:A>B
      }

   return 0;  // no differences before told to stop comparing, so A==B
}
开发者ID:bagdxk,项目名称:openafs,代码行数:21,代码来源:drivemap.cpp


示例16: rubylib_mangled_path

static VALUE
rubylib_mangled_path(const char *s, unsigned int l)
{
    static char *newp, *oldp;
    static int newl, oldl, notfound;
    char *ptr;
    VALUE ret;

    if (!newp && !notfound) {
	newp = getenv("RUBYLIB_PREFIX");
	if (newp) {
	    oldp = newp = strdup(newp);
	    while (*newp && !ISSPACE(*newp) && *newp != ';') {
		newp = CharNext(newp);	/* Skip digits. */
	    }
	    oldl = newp - oldp;
	    while (*newp && (ISSPACE(*newp) || *newp == ';')) {
		newp = CharNext(newp);	/* Skip whitespace. */
	    }
	    newl = strlen(newp);
	    if (newl == 0 || oldl == 0) {
		rb_fatal("malformed RUBYLIB_PREFIX");
	    }
	    translate_char(newp, '\\', '/');
	}
	else {
	    notfound = 1;
	}
    }
    if (!newp || l < oldl || STRNCASECMP(oldp, s, oldl) != 0) {
	return rb_str_new(s, l);
    }
    ret = rb_str_new(0, l + newl - oldl);
    ptr = RSTRING_PTR(ret);
    memcpy(ptr, newp, newl);
    memcpy(ptr + newl, s + oldl, l - oldl);
    ptr[l + newl - oldl] = 0;
    return ret;
}
开发者ID:Netfart,项目名称:rhodes,代码行数:39,代码来源:ruby.c


示例17: ModuleVersion

MODULEVERSION& ModuleVersion(HINSTANCE instance/* = 0*/)
{
    static bool Initialized = false;
    static MODULEVERSION g_ModuleVersion = { 0 };

    if (!Initialized)
    {
        //  Initialize Module version information
        TCHAR szFileName[MAX_PATH];
        DWORD dwLen;
        BOOL bGotModuleVersion = FALSE;
        if ((dwLen = GetModuleFileName(static_cast<HMODULE>(instance), szFileName, sizeof(szFileName))))
        {
            szFileName[dwLen] = '\0';
            DWORD dwHandle, dwInfoLen;
            if ((dwInfoLen = GetFileVersionInfoSize(szFileName, &dwHandle)))
            {
                char *szVersionBuffer = (char *)malloc(dwInfoLen);
                if (GetFileVersionInfo(szFileName, dwHandle, dwInfoLen, szVersionBuffer))
                {
                    VS_FIXEDFILEINFO *fi;
                    UINT uBlockLen;
                    if (VerQueryValue(szVersionBuffer, _T("\\"), 
                        reinterpret_cast<LPVOID*>(&fi), &uBlockLen))
                    {
                        Initialized = true;
                        g_ModuleVersion.Major = fi->dwProductVersionMS >> 16;
                        g_ModuleVersion.Minor = fi->dwProductVersionMS & 0xff;
                        g_ModuleVersion.Release = fi->dwProductVersionLS >> 16;
                        g_ModuleVersion.Build = fi->dwProductVersionLS & 0xff;
                        //  Get module path
                        g_ModuleVersion.ModuleFullPath = szFileName;
                        TCHAR *eop = _tcsrchr(szFileName, _T('\\'));            //  end of path
                        g_ModuleVersion.ModuleFileName = CharNext(eop);         //  beginning of the file name
                        *CharNext(eop) = _T('\0');
                        g_ModuleVersion.ModulePath = szFileName;
                    }
                }
开发者ID:Erls-Corporation,项目名称:webinaria-source,代码行数:38,代码来源:VersionInfo.cpp


示例18: del_title

/*-------------------------------------------
 パス名からファイル名をとりのぞく
---------------------------------------------*/
void del_title(char *path)
{
	char *p, *ep;

	p = ep = path;
	while(*p)
	{
		if(*p == '\\' || *p == '/')
		{
			if(p > path && *(p - 1) == ':') ep = p + 1;
			else ep = p;
		}
		p = (char *)CharNext(p);
	}
	*ep = 0;
}
开发者ID:Nikers,项目名称:T-Clock,代码行数:19,代码来源:UTL.C


示例19: pGetFilePart

PCTSTR WINAPI
pGetFilePart(
    IN PCTSTR FilePath)
{
    PCTSTR LastComponent = FilePath;
    TCHAR  CurChar;

    while(CurChar = *FilePath) {
        FilePath = CharNext(FilePath);
        if((CurChar == TEXT('\\')) || (CurChar == TEXT('/')) || (CurChar == TEXT(':'))) {
            LastComponent = FilePath;
        }
    }

    return LastComponent;
}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:16,代码来源:setupsup.cpp


示例20: WinMain

int WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR cmdLine, int nShow)
{
    char buf[30];
    if (!cmdLine || !cmdLine[0])
        return 0;
    LPSTR next = CharNext(cmdLine);
    if (*next != 0)
    {
		OutputDebugString("Yes");
    } 
    else 
    {
		OutputDebugString("No");
    }
    return 0;
}
开发者ID:killbug2004,项目名称:reko,代码行数:16,代码来源:win32api.c



注:本文中的CharNext函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CharPointer_UTF8函数代码示例发布时间:2022-05-30
下一篇:
C++ CharGetDatum函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap