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

C++ copystring函数代码示例

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

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



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

示例1: FreeMeta

void FMetaTable::CopyMeta (const FMetaTable *other)
{
	const FMetaData *meta_src;
	FMetaData **meta_dest;

	FreeMeta ();

	meta_src = other->Meta;
	meta_dest = &Meta;
	while (meta_src != NULL)
	{
		FMetaData *newmeta = new FMetaData (meta_src->Type, meta_src->ID);
		switch (meta_src->Type)
		{
		case META_String:
			newmeta->Value.String = copystring (meta_src->Value.String);
			break;
		default:
			newmeta->Value = meta_src->Value;
			break;
		}
		*meta_dest = newmeta;
		meta_dest = &newmeta->Next;
		meta_src = meta_src->Next;
	}
	*meta_dest = NULL;
}
开发者ID:ddraigcymraeg,项目名称:scoredoomst,代码行数:27,代码来源:dobject.cpp


示例2: odberrorroutine

static boolean odberrorroutine (bigstring bs, ptrvoid refcon) {
#pragma unused (refcon)

	copystring (bs, bserror);
	
	return (false); /*consume the error*/
	} /*odberrorroutine*/
开发者ID:pombredanne,项目名称:Frontier,代码行数:7,代码来源:odbengine.c


示例3: copystring

char *ReadString (uint8_t **stream)
{
	char *string = *((char **)stream);

	*stream += strlen (string) + 1;
	return copystring (string);
}
开发者ID:Blzut3,项目名称:gzdoom,代码行数:7,代码来源:d_protocol.cpp


示例4: compareforcopyvisit

static boolean compareforcopyvisit (hdlheadrecord hnode, ptrvoid refcon) {
	
	bigstring bs, bsnode;
	ptrdraginfo draginfo = (ptrdraginfo) refcon;
	
	if (hnode == (*draginfo).hcompare)
		return (true);
	
	opgetheadstring (hnode, bsnode);
	
	opgetheadstring ((*draginfo).hcompare, bs);
	
	if (!equalidentifiers (bsnode, bs)) 
		return (true);
	
	copystring (BIGSTRING ("\x06" "CanÕt "), bs);
	
	pushstring (pcommand, bs);
	
	pushstring (BIGSTRING ("\x35" " because there are two or more selected items named Ò"), bs);
	
	pushstring (bsnode, bs);
	
	pushstring (BIGSTRING ("\x02" "Ó."), bs);
	
	alertdialog (bs);
	
	return (false); /*stop both traversals*/
	} /*compareforcopyvisit*/
开发者ID:pombredanne,项目名称:Frontier,代码行数:29,代码来源:claybrowservalidate.c


示例5: backup

void backup(char *name, char *backupname)
{
    string backupfile;
    copystring(backupfile, findfile(backupname, "wb"));
    remove(backupfile);
    rename(findfile(name, "wb"), backupfile);
}
开发者ID:ac-stef,项目名称:AC,代码行数:7,代码来源:stream.cpp


示例6: expandEnv

char * expandEnv( char* in ) {
    char * out = in;
    int i;
    int possibleEnv = 0;
    int envStart;
    for (i = 0; i < strlen(out); i++) {
        if( out[i] == '$' ) {
            envStart = i;
        }
        if( out[i] == '{' && i == envStart+1 ) {
            possibleEnv = 1;
        }
        if( out[i] == '}' && possibleEnv ) {
            char temp[5000];
            char * envVar;

            memcpy( temp, &out[envStart], i-envStart+1 );
            temp[i-envStart+1] = '\0';
            copystring( envVar, temp );
            envVar = envVar + 2;
            envVar[i-envStart-2] = '\0';
            
            out = replace( out, temp, getenv(envVar) );
        }
    
    }
    return out;
}
开发者ID:kevinqmcdonald,项目名称:shellproject,代码行数:28,代码来源:turtle.c


示例7: minimessage

static boolean minimessage (bigstring bs, boolean flbackgroundmsg) {
#pragma unused (flbackgroundmsg)

	copystring (bs, (**minidata).bsmsg);
	
	return (minidrawmsg ());
	} /*minimessage*/
开发者ID:dvincent,项目名称:frontier,代码行数:7,代码来源:miniwindow.c


示例8: copystring

 void Client::loadScene(const char* name) {
     if(load_world(name)) {
         copystring(clientmap, name);
     }
     CubeJ::MsgDataType<CubeJ::MSG_SND_SCENEINFO> data(clientmap, getworldsize(), getmapversion());
     SendMessage(data);
 }
开发者ID:offtools,项目名称:cubej,代码行数:7,代码来源:client.cpp


示例9: resolveHashTable

boolean resolveHashTable(bigstring bsnodetype, bigstring bsadrnodepath) {
	bigstring bsname;
	hdlhashtable ht;
	hdlhashnode hn;
	tyvaluerecord iconvalue;
	boolean flexpanded = false;
	boolean fllookup = false;
	
	pushhashtable (roottable);
	
	disablelangerror ();
	
	flexpanded = langexpandtodotparams (bsadrnodepath, &ht, bsname);
	enablelangerror ();
	pophashtable ();
	
	fllookup = hashtablelookup (ht, bsnodetype, &iconvalue, &hn);

	if (fllookup && iconvalue.valuetype == addressvaluetype) {
		copystring(*iconvalue.data.stringvalue, bsadrnodepath);
		return resolveHashTable(bsnodetype, bsadrnodepath);
	}

	return fllookup;
}
开发者ID:pombredanne,项目名称:Frontier,代码行数:25,代码来源:opicons.c


示例10: copystring_lower

static xml_data_node *add_child(xml_data_node *parent, const char *name, const char *value)
{
	xml_data_node **pnode;
	xml_data_node *node;

	/* new element: create a new node */
	node = (xml_data_node *)malloc(sizeof(*node));
	if (node == nullptr)
		return nullptr;

	/* initialize the members */
	node->next = nullptr;
	node->parent = parent;
	node->child = nullptr;
	node->name = copystring_lower(name);
	if (node->name == nullptr)
	{
		free(node);
		return nullptr;
	}
	node->value = copystring(value);
	if (node->value == nullptr && value != nullptr)
	{
		free((void *)node->name);
		free(node);
		return nullptr;
	}
	node->attribute = nullptr;

	/* add us to the end of the list of siblings */
	for (pnode = &parent->child; *pnode; pnode = &(*pnode)->next) { }
	*pnode = node;

	return node;
}
开发者ID:Fulg,项目名称:mame,代码行数:35,代码来源:xmlfile.cpp


示例11: if

void FBaseCVar::SetGenericRep (UCVarValue value, ECVarType type)
{
	if ((Flags & CVAR_NOSET) && m_DoNoSet)
	{
		return;
	}
	else if ((Flags & CVAR_LATCH) && gamestate != GS_FULLCONSOLE && gamestate != GS_STARTUP)
	{
		FLatchedValue latch;

		latch.Variable = this;
		latch.Type = type;
		if (type != CVAR_String)
			latch.Value = value;
		else
			latch.Value.String = copystring(value.String);
		LatchedValues.Push (latch);
	}
	else if ((Flags & CVAR_SERVERINFO) && gamestate != GS_STARTUP && !demoplayback)
	{
		if (netgame && !players[consoleplayer].settings_controller)
		{
			Printf ("Only setting controllers can change %s\n", Name);
			return;
		}
		D_SendServerInfoChange (this, value, type);
	}
	else
	{
		ForceSet (value, type);
	}
}
开发者ID:1Akula1,项目名称:gzdoom,代码行数:32,代码来源:c_cvars.cpp


示例12: MAKE_ID

int FStringTable::LoadLanguage (DWORD code, bool exactMatch, BYTE *start, BYTE *end)
{
	const DWORD orMask = exactMatch ? 0 : MAKE_ID(0,0,0xff,0);
	int count = 0;

	code |= orMask;

	while (start < end)
	{
		const DWORD langLen = LELONG(*(DWORD *)&start[4]);

		if (((*(DWORD *)start) | orMask) == code)
		{
			start[3] = 1;

			const BYTE *probe = start + 8;

			while (probe < start + langLen)
			{
				int index = probe[0] | (probe[1]<<8);

				if (Strings[index] == NULL)
				{
					Strings[index] = copystring ((const char *)(probe + 2));
					++count;
				}
				probe += 3 + strlen ((const char *)(probe + 2));
			}
		}

		start += langLen + 8;
		start += (4 - (ptrdiff_t)start) & 3;
	}
	return count;
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:35,代码来源:stringtable.cpp


示例13: copystring

char *path(const char *s, bool copy)
{
    static string tmp;
    copystring(tmp, s);
    path(tmp);
    return tmp;
}
开发者ID:BenanHamid,项目名称:AC,代码行数:7,代码来源:stream.cpp


示例14: next

    static int next(lua_State * L)
    {
        directory_iterator * self = reinterpret_cast<directory_iterator *>(luaL_checkudata(L, 1, MT));
        if(!self->m_dir) return 0;
        struct dirent * entry = readdir(self->m_dir);
        if(!entry) return 0;
        
        char file[1024];
        copystring(file, self->m_dir_path, sizeof(file));
        concatstring(file, "/", sizeof(file));
        concatstring(file, entry->d_name, sizeof(file));
	    
        struct stat info;
        if (stat(file, &info)) return 0;
        
        unsigned char file_type = DT_UNKNOWN;
        if (S_ISREG(info.st_mode))       file_type = DT_REG;
        else if (S_ISDIR(info.st_mode))  file_type = DT_DIR;
        else if (S_ISFIFO(info.st_mode)) file_type = DT_FIFO;
        else if (S_ISLNK(info.st_mode))  file_type = DT_LNK;
        else if (S_ISBLK(info.st_mode))  file_type = DT_BLK;
        else if (S_ISCHR(info.st_mode))  file_type = DT_CHR;
        else if (S_ISSOCK(info.st_mode)) file_type = DT_SOCK;
	
        lua_pushinteger(L, file_type);
        lua_pushstring(L, entry->d_name);
        
        return 2;
    }
开发者ID:Lumiahna,项目名称:suckerserv,代码行数:29,代码来源:filesystem.cpp


示例15: setdefaultvalue

 void setdefaultvalue()
 {
     const char *p = defaultvalueexp;
     char *r = executeret(p);
     copystring(input.buf, r ? r : "");
     if(r) delete[] r;
 }
开发者ID:Fru5trum,项目名称:acr,代码行数:7,代码来源:menus.cpp


示例16: formatstring

const char *findfile(const char *filename, const char *mode)
{
    static string s;
    formatstring(s)("%s%s", homedir, filename);         // homedir may be ""
    if(fileexists(s, mode)) return s;
    if(mode[0]=='w' || mode[0]=='a')
    { // create missing directories, if necessary
        string dirs;
        copystring(dirs, s);
        char *dir = strchr(dirs[0]==PATHDIV ? dirs+1 : dirs, PATHDIV);
        while(dir)
        {
            *dir = '\0';
            if(!fileexists(dirs, "r") && !createdir(dirs)) return s;
            *dir = PATHDIV;
            dir = strchr(dir+1, PATHDIV);
        }
        return s;
    }
    loopv(packagedirs)
    {
        formatstring(s)("%s%s", packagedirs[i], filename);
        if(fileexists(s, mode)) return s;
    }
    return filename;
}
开发者ID:BenanHamid,项目名称:AC,代码行数:26,代码来源:stream.cpp


示例17: pathtofsref

OSStatus pathtofsref ( bigstring bspath, FSRef *ref ) {

	/*
	2009-08-30 aradke: mac-only helper function for converting from a pascal string (path) to an FSRef
	*/
	
	bigstring bs;
	CFStringRef csref;
	char str[256];

	copystring(bspath,  bs);

	// convert from colon-delimited to slash-delimited path

	stringswapall(':', '/', bs);

	insertstring ( BIGSTRING ( "\x09" "/Volumes/" ), bs );
	
	// convert from Mac Roman to UTF-8 */ 

	csref = CFStringCreateWithPascalString(kCFAllocatorDefault, bs, kCFStringEncodingMacRoman);
	
	CFStringGetCString(csref, str, sizeof(str), kCFStringEncodingUTF8);
		
	CFRelease(csref);

	// finally, pass our temporary copy of the string to the underlying system function
	
	return FSPathMakeRef((UInt8*) str, ref, NULL);
	} /*pathtofsref*/
开发者ID:karstenw,项目名称:frontier,代码行数:30,代码来源:filepath.c


示例18: export_ents

    void export_ents(const char *fname) {
        string tmp;
        copystring(tmp, curr_map_id);
        tmp[strlen(curr_map_id) - 7] = '\0';

        defformatstring(buf)("%smedia%c%s%c%s", homedir, PATHDIV, tmp,
            PATHDIV, fname);

        lua::push_external("entities_save_all");
        lua_call(lua::L, 0, 1);
        const char *data = lua_tostring(lua::L, -1);
        lua_pop(lua::L, 1);
        if (fileexists(buf, "r")) {
            defformatstring(buff)("%s-%d.bak", buf, (int)time(0));
            tools::fcopy(buf, buff);
        }

        FILE *f = fopen(buf, "w");
        if  (!f) {
            logger::log(logger::ERROR, "Cannot open file %s for writing.\n",
                buf);
            return;
        }
        fputs(data, f);
        fclose(f);
    }
开发者ID:bedna-KU,项目名称:OF-Engine,代码行数:26,代码来源:of_world.cpp


示例19: initlogging

bool initlogging(const char *identity, int facility_, int consolethres, int filethres, int syslogthres, bool logtimestamp)
{
    facility = facility_ & 7;
    timestamp = logtimestamp;
    if(consolethres >= 0) consolethreshold = min(consolethres, (int)ACLOG_NUM);
    if(filethres >= 0) filethreshold = min(filethres, (int)ACLOG_NUM);
    if(syslogthres >= 0) syslogthreshold = min(syslogthres, (int)ACLOG_NUM);
    if(ident != identity)
        copystring(ident, identity);
    formatstring(ident_full)("ACR[%s]", identity);
    if(syslogthreshold < ACLOG_NUM)
    {
#ifdef AC_USE_SYSLOG
        openlog(ident_full, LOG_NDELAY, facilities[facility]);
#else
        if((logsock = enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM)) == ENET_SOCKET_NULL || enet_address_set_host(&logdest, "localhost") < 0) syslogthreshold = ACLOG_NUM;
#endif
    }
    static int lognum = 0;
    formatstring(filepath)("serverlog_%s_%s.part%d.txt", timestring(true), identity, ++lognum);
    if(fp) { fclose(fp); fp = NULL; }
    if(filethreshold < ACLOG_NUM)
    {
        fp = fopen(filepath, "w");
        if(!fp) printf("failed to open \"%s\" for writing\n", filepath);
    }
    defformatstring(msg)("logging started: console(%s), file(%s", levelname[consolethreshold], levelname[fp ? filethreshold : ACLOG_NUM]);
    if(fp) concatformatstring(msg, ", \"%s\"", filepath);
    concatformatstring(msg, "), syslog(%s", levelname[syslogthreshold]);
    if(syslogthreshold < ACLOG_NUM) concatformatstring(msg, ", \"%s\", local%d", ident_full, facility);
    concatformatstring(msg, "), timestamp(%s)", timestamp ? "ENABLED" : "DISABLED");
    enabled = consolethreshold < ACLOG_NUM || fp || syslogthreshold < ACLOG_NUM;
    if(enabled) printf("%s\n", msg);
    return enabled;
}
开发者ID:Fred50,项目名称:acr,代码行数:35,代码来源:log.cpp


示例20: execcfg

    bool execcfg(const char *cfgfile, bool ignore_ret)
    {
        string s;
        copystring(s, cfgfile);
        char *buf = loadfile(path(s), NULL);
        if(!buf) return false;
        auto err = lapi::state.do_string(buf, lua::ERROR_TRACEBACK);
        if (types::get<0>(err))
            logger::log(logger::ERROR, "%s\n", types::get<1>(err));

        bool ret = true;
        if (!ignore_ret)
        {
            ret = lapi::state["OF_CFG_VERSION_PASSED"].to<bool>();
            if (!ret)
            {
                conoutf(
                    "Your OctaForge config file was too old to run with "
                    "your current client. Initializing a default set."
                );
            }
            lapi::state["OF_CFG_VERSION_PASSED"] = lua::nil;
        }

        delete[] buf;
        return ret;
    }
开发者ID:Blarget2,项目名称:OF-Engine,代码行数:27,代码来源:of_tools.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ core_fclose函数代码示例发布时间:2022-05-30
下一篇:
C++ copysignf函数代码示例发布时间: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