当前位置: 首页>>代码示例>>C++>>正文


C++ STRCAT函数代码示例

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


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

示例1: acpi_db_set_scope

void
acpi_db_set_scope (
	NATIVE_CHAR             *name)
{

	if (!name || name[0] == 0) {
		acpi_os_printf ("Current scope: %s\n", acpi_gbl_db_scope_buf);
		return;
	}

	acpi_db_prep_namestring (name);

	/* TBD: [Future] Validate scope here */

	if (name[0] == '\\') {
		STRCPY (acpi_gbl_db_scope_buf, name);
		STRCAT (acpi_gbl_db_scope_buf, "\\");
	}

	else {
		STRCAT (acpi_gbl_db_scope_buf, name);
		STRCAT (acpi_gbl_db_scope_buf, "\\");
	}

	acpi_os_printf ("New scope: %s\n", acpi_gbl_db_scope_buf);
}
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:26,代码来源:dbcmds.c

示例2: util_findFile

bool util_findFile(const char* dirs[], unsigned int numDirs,
		const char* relativeFilePath, char* absoluteFilePath) {

	bool found = false;

	// check if it is an absolute file path
	if (util_fileExists(relativeFilePath)) {
		STRCPY(absoluteFilePath, relativeFilePath);
		found = true;
	}

	unsigned int d;
	for (d=0; d < numDirs && !found; ++d) {
		// do the following: tmpPath = dirs[d] + sPS + relativeFilePath
		char* tmpPath = util_allocStr(strlen(dirs[d]) + 1 + strlen(relativeFilePath));
		//char tmpPath[strlen(dirs[d]) + 1 + strlen(relativeFilePath) + 1];
		tmpPath[0]= '\0';
		tmpPath = STRCAT(tmpPath, dirs[d]);
		tmpPath = STRCAT(tmpPath, sPS);
		tmpPath = STRCAT(tmpPath, relativeFilePath);

		if (util_fileExists(tmpPath)) {
			STRCPY(absoluteFilePath, tmpPath);
			found = true;
		}

		free(tmpPath);
	}

	return found;
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:31,代码来源:Util.c

示例3: AcpiDbExecuteSetup

static void
AcpiDbExecuteSetup (
    DB_METHOD_INFO          *Info)
{

    /* Catenate the current scope to the supplied name */

    Info->Pathname[0] = 0;
    if ((Info->Name[0] != '\\') &&
        (Info->Name[0] != '/'))
    {
        STRCAT (Info->Pathname, AcpiGbl_DbScopeBuf);
    }

    STRCAT (Info->Pathname, Info->Name);
    AcpiDbPrepNamestring (Info->Pathname);

    AcpiDbSetOutputDestination (DB_DUPLICATE_OUTPUT);
    AcpiOsPrintf ("Executing %s\n", Info->Pathname);

    if (Info->Flags & EX_SINGLE_STEP)
    {
        AcpiGbl_CmSingleStep = TRUE;
        AcpiDbSetOutputDestination (DB_CONSOLE_OUTPUT);
    }

    else
    {
        /* No single step, allow redirection to a file */

        AcpiDbSetOutputDestination (DB_REDIRECTABLE_OUTPUT);
    }
}
开发者ID:MarginC,项目名称:kame,代码行数:33,代码来源:dbexec.c

示例4: append_path

// Append to_append to path with a slash in between.
int append_path(char *path, const char *to_append, int max_len)
{
  int current_length = STRLEN(path);
  int to_append_length = STRLEN(to_append);

  // Do not append empty strings.
  if (to_append_length == 0) {
    return OK;
  }

  // Do not append a dot.
  if (STRCMP(to_append, ".") == 0) {
    return OK;
  }

  // Glue both paths with a slash.
  if (current_length > 0 && path[current_length-1] != '/') {
    current_length += 1;  // Count the trailing slash.

    // +1 for the NUL at the end.
    if (current_length + 1 > max_len) {
      return FAIL;
    }

    STRCAT(path, "/");
  }

  // +1 for the NUL at the end.
  if (current_length + to_append_length + 1 > max_len) {
    return FAIL;
  }

  STRCAT(path, to_append);
  return OK;
}
开发者ID:ashleyh,项目名称:neovim,代码行数:36,代码来源:fs.c

示例5: acpi_db_execute_setup

void
acpi_db_execute_setup (
	db_method_info          *info)
{

	/* Catenate the current scope to the supplied name */

	info->pathname[0] = 0;
	if ((info->name[0] != '\\') &&
		(info->name[0] != '/')) {
		STRCAT (info->pathname, acpi_gbl_db_scope_buf);
	}

	STRCAT (info->pathname, info->name);
	acpi_db_prep_namestring (info->pathname);

	acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT);
	acpi_os_printf ("Executing %s\n", info->pathname);

	if (info->flags & EX_SINGLE_STEP) {
		acpi_gbl_cm_single_step = TRUE;
		acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
	}

	else {
		/* No single step, allow redirection to a file */

		acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
	}
}
开发者ID:TKr,项目名称:Wive-ng-rt8186,代码行数:30,代码来源:dbexec.c

示例6: SearchPath

int SearchPath(char* oudzp, char* filename, char* whatever, int maxlen, char* nieuwzp, char** ach) {
	FILE* fp;
	char* p, * f;
	if (filename[0] == '/') {
		STRCPY(nieuwzp, maxlen, filename);
	} else {
		STRCPY(nieuwzp, maxlen, oudzp);
		if (*nieuwzp && nieuwzp[strlen(nieuwzp)] != '/') {
			STRCAT(nieuwzp, maxlen, "/");
		}
		STRCAT(nieuwzp, maxlen, filename);
	}
	if (ach) {
		p = f = nieuwzp;
		while (*p) {
			if (*p == '/') {
				f = p + 1;
			} ++p;
		}
		*ach = f;
	}
	if (FOPEN_ISOK(fp, nieuwzp, "r")) {
		fclose(fp);
		return 1;
	}
	return 0;
}
开发者ID:alexanderk23,项目名称:sjasmplus,代码行数:27,代码来源:support.cpp

示例7: WelsReopenTraceFile

/*! 
*************************************************************************************
* \brief	reopen log file when finish setting current path
*
* \param	pCtx		context pCtx
* \param	pCurPath	current path string
*
* \return	NONE
*
* \note	N/A
*************************************************************************************
*/
void WelsReopenTraceFile( void *pCtx, str_t *pCurPath )
{
#ifdef ENABLE_TRACE_FILE
	sWelsEncCtx *pEncCtx	= (sWelsEncCtx *)pCtx;
	if (wlog == WelsLogDefault)
	{
		str_t strTraceFile[MAX_FNAME_LEN] = {0};
		int32_t len = 0;
		if (pEncCtx->pFileLog != NULL)
		{
			fclose(pEncCtx->pFileLog);
			pEncCtx->pFileLog = NULL;
		}
		pEncCtx->uiSizeLog	= 0;
		len = STRNLEN( pCurPath, MAX_FNAME_LEN-1 );	// confirmed_safe_unsafe_usage
		if (len >= MAX_FNAME_LEN)
			return;
		STRNCPY(strTraceFile, MAX_FNAME_LEN, pCurPath, len);	// confirmed_safe_unsafe_usage
#ifdef __GNUC__		
		STRCAT(strTraceFile, MAX_FNAME_LEN-len, "/wels_encoder_trace.txt");	// confirmed_safe_unsafe_usage
		pEncCtx->pFileLog	= FOPEN(strTraceFile, "wt+");	// confirmed_safe_unsafe_usage
#elif WIN32
		STRCAT(strTraceFile, MAX_FNAME_LEN-len, "\\wels_encoder_trace.txt");// confirmed_safe_unsafe_usage
#if _MSC_VER >= 1500
		FOPEN(&pEncCtx->pFileLog, strTraceFile, "wt+");	// confirmed_safe_unsafe_usage
#else
		pEncCtx->pFileLog	= FOPEN(strTraceFile, "wt+");	// confirmed_safe_unsafe_usage
#endif//_MSC_VER>=1500
#else		
#endif//__GNUC__
	}
#endif//ENABLE_TRACE_FILE
}
开发者ID:andreasgal,项目名称:openh264,代码行数:45,代码来源:utils.cpp

示例8: PocketRocketForBrew_InitAppData

// this function is called when your application is starting up
boolean PocketRocketForBrew_InitAppData(PocketRocketForBrew* pMe)
{
    AECHAR os[] = {'B','r','e','w','\0'};
	char resx[5];
	char resy[5];
	AECHAR wresx[5];
	AECHAR wresy[5];
	AECHAR url[512];
	char curl[512];
	AECHAR fchunk[] = {'?','O','S','=','B','r','e','w','&','H','E','I','G','H','T','=','\0'};
	AECHAR schunk[] = {'&','W','I','D','T','H','=','\0'};
	AECHAR tchunk[] = {'&','I','D','=','1','\0'};
	// Get the device information for this handset.
    // Reference all the data by looking at the pMe->DeviceInfo structure
    // Check the API reference guide for all the handy device info you can get
    pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
	ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);
//	std::string a;
	
	STRCPY(url,XID_URL);
   // str
	
	itoa((int)pMe->DeviceInfo.cyScreen,resx,10);
	itoa((int)pMe->DeviceInfo.cxScreen,resy,10);
	STRTOWSTR(wresx,resx,strlen(resx));
	STRTOWSTR(wresy,resy,strlen(resy));
	//strcp
	STRCAT(url,fchunk);
	STRCAT(url,wresy);
	STRCAT(url,schunk);
	STRCAT(url,wresx);
	STRCAT(url,tchunk);

	WSTRTOSTR(curl,url,strlen(curl));
	printf(url);
	
	//strcat(


	

    // Insert your code here for initializing or allocating resources...

	//XOsApplication *xosApplication = new XOsApplication("Testing");
	
	
	





    // if there have been no failures up to this point then return success
    return TRUE;
}
开发者ID:PabloBorda,项目名称:BrewPocketRocket,代码行数:56,代码来源:PocketRocketForBrew.c

示例9: MakeCompressedName

/*
** char MakeCompressedName(char ARG_PTR *pszFileName);
**
** Make a file name into the corresponding compressed file name.
**
** Arguments:  pszOriginalName - file name to convert to compressed file name
**
** Returns:    char - Uncompressed file name extension character that was
**                    replaced.  '\0' if no character needed to be replaced.
**
** Globals:    none
**
** N.b., assumes pszFileName's buffer is long enough to hold an extra two
** characters ("._").
**
** For DBCS filenames, we know we can have at most one DBCS character in the
** extension.  So instead of just blindly replacing the last character of a
** three-byte extension with an underscore, we replace the last single-byte
** character with an underscore.
*/
CHAR MakeCompressedName(CHAR ARG_PTR *pszFileName)
{
   CHAR chReplaced = '\0';
   CHAR ARG_PTR *pszExt;

#ifdef DBCS
   if ((pszExt = ExtractExtension(pszFileName)) != NULL)
   {
      if (STRLEN(pszExt) >= 3)
      {
         // Replace the last single-byte character in the extension with an
         // underscore.
         if (! IsDBCSLeadByte(*pszExt) && IsDBCSLeadByte(pszExt[1]))
         {
            // Assert: The first character in the extension is a single-byte
            // character and the second character in the extension is a
            // double-byte character.

            chReplaced = *pszExt;
            *pszExt = chEXTENSION_CHAR;
         }
         else
         {
            // Assert: The third character in the extension is a single-byte
            // character.  The first two bytes may be two single-byte
            // characters or a double-byte character.

            chReplaced = pszExt[2];
            pszExt[2] = chEXTENSION_CHAR;
         }
      }
      else
         STRCAT(pszExt, pszEXTENSION_STR);
   }
   else
      STRCAT(pszFileName, pszNULL_EXTENSION);
#else
   if ((pszExt = ExtractExtension(pszFileName)) != NULL)
   {
      if (STRLEN(pszExt) >= 3)
      {
         chReplaced = pszExt[STRLEN(pszExt) - 1];
         pszExt[STRLEN(pszExt) - 1] = chEXTENSION_CHAR;
      }
      else
         STRCAT(pszExt, pszEXTENSION_STR);
   }
   else
      STRCAT(pszFileName, pszNULL_EXTENSION);
#endif

   return(chReplaced);
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:73,代码来源:utils.c

示例10: crypt_append_msg

/*
 * Append a message to IObuff for the encryption/decryption method being used.
 */
    void
crypt_append_msg(
    buf_T *buf)
{
    if (crypt_get_method_nr(buf) == 0)
	STRCAT(IObuff, _("[crypted]"));
    else
    {
	STRCAT(IObuff, "[");
	STRCAT(IObuff, *buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
	STRCAT(IObuff, "]");
    }
}
开发者ID:KarstenHopp,项目名称:vim,代码行数:16,代码来源:crypt.c

示例11: workshop_init

    void
workshop_init(void)
{
    char_u	 buf[64];
    int		 is_dirty = FALSE;
    int		 width, height;
    XtInputMask	 mask;

    /*
     * Turn on MenuBar, ToolBar, and Footer.
     */
    STRCPY(buf, p_go);
    if (vim_strchr(p_go, GO_MENUS) == NULL)
    {
	STRCAT(buf, "m");
	is_dirty = TRUE;
    }
    if (vim_strchr(p_go, GO_TOOLBAR) == NULL)
    {
	STRCAT(buf, "T");
	is_dirty = TRUE;
    }
    if (vim_strchr(p_go, GO_FOOTER) == NULL)
    {
	STRCAT(buf, "F");
	is_dirty = TRUE;
    }
    if (is_dirty)
	set_option_value((char_u *)"go", 0L, buf, 0);

    /*
     * Set size from workshop_get_width_height().
     */
    width = height = 0;
    if (workshop_get_width_height(&width, &height))
    {
	XtVaSetValues(vimShell,
		XmNwidth, width,
		XmNheight, height,
		NULL);
    }

    /*
     * Now read in the initial messages from eserve.
     */
    while ((mask = XtAppPending(app_context))
	    && (mask & XtIMAlternateInput) && !workshopInitDone)
	XtAppProcessEvent(app_context, (XtInputMask)XtIMAlternateInput);
}
开发者ID:KarstenHopp,项目名称:vim,代码行数:49,代码来源:workshop.c

示例12: CTB_unlink

void CTB_unlink(char *name)
{
    char str[MAXPATH], *p = ctb_last_punct(name);

    if (p)
        *p = '\0';

    STRCPY(str, name);
    STRCAT(str, ".CTB");
    UNLINK(str);
    STRCPY(str, name);
    STRCAT(str, ".IND");
    UNLINK(str);
    return;
}
开发者ID:nctan,项目名称:quneiform,代码行数:15,代码来源:ctb_oper.cpp

示例13: main

int main(int argc, char** argv) {

  char_t strExeFullPath[kMAX_PATH];

  UNUSED_PARAM(argc);
  UNUSED_PARAM(argv);

  if (FALSE == lockFile()) {
    PRINTF("Lock File %s Failed.\n  may be the other collector is running.",gStrLockFile );
    getchar();
    return 0;
  }

  signal(SIGINT,ctrl_handler);

  BZERO_ARR(strExeFullPath);
  if (_getcwd(strExeFullPath, sizeof(strExeFullPath))) {
    STRCAT(strExeFullPath, sizeof(strExeFullPath), STR_DIR_SEP);
  }
  else {  
    STRCPY(strExeFullPath, sizeof(strExeFullPath), NULL_STR);
  }

  PRINTF("%s\n", strExeFullPath);

  StartService(&g_Interrupt, strExeFullPath);

  getchar();
  unlockFile();
  return 0;
}
开发者ID:obabywawa,项目名称:logsystem,代码行数:31,代码来源:launcher.cpp

示例14: util_allocStrCpyCat

char* util_allocStrCpyCat(const char* toPart1, const char* toPart2) {

	char* copy = (char*) calloc(strlen(toPart1)+strlen(toPart2)+1, sizeof(char));
	STRCPY(copy, toPart1);
	STRCAT(copy, toPart2);
	return copy;
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:7,代码来源:Util.c

示例15: __create_message

void
__create_message (HWND hwnd,
    SQLPOINTER dsn,
    SQLPOINTER text,
    SQLCHAR waMode,
    AlertType id)
{
  CFStringRef msg, msg1;
  DialogRef dlg;
  SInt16 out;
  char buf[1024];

  if (hwnd == NULL)
    return;

  if (waMode == 'A')
    {
      if (dsn)
        {
          STRCPY(buf, "DSN: ");
          STRCAT(buf, dsn);
          msg = CFStringCreateWithBytes (NULL, (unsigned char*)buf, STRLEN(buf),
            kCFStringEncodingUTF8, false);
          msg1 = CFStringCreateWithBytes (NULL, (unsigned char*)text, STRLEN(text), 
            kCFStringEncodingUTF8, false);
        }
      else
        {
          STRCPY(buf, "");
          msg = CFStringCreateWithBytes (NULL, (unsigned char*)text, STRLEN(text),
            kCFStringEncodingUTF8, false);
          msg1 = CFStringCreateWithBytes (NULL, (unsigned char*)buf, STRLEN(buf), 
            kCFStringEncodingUTF8, false);
        }
    }
  else
    {
      if (dsn)
        {
          WCSCPY(buf, L"DSN: ");
          WCSCAT(buf, dsn);
          msg = convert_wchar_to_CFString((wchar_t*)buf);
          msg1 = convert_wchar_to_CFString((wchar_t*)text);
        }
      else
        {
          WCSCPY(buf, L"");
          msg = convert_wchar_to_CFString((wchar_t*)text);
          msg1 = convert_wchar_to_CFString((wchar_t*)buf);
        }
    }

  CreateStandardAlert (id, msg, msg1, NULL, &dlg);
  RunStandardAlert (dlg, NULL, &out);

  CFRelease(msg);
  CFRelease(msg1);

  return;
}
开发者ID:EvilMcJerkface,项目名称:iODBC,代码行数:60,代码来源:messagebox.c


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