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

C++ AddData函数代码示例

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

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



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

示例1: AddFlags

void AuxGroupMember::BuildPacket(unsigned char *buffer, long &index)
{
	AddFlags(Flags, sizeof(Flags), buffer, index);

	if (Flags[0] & 0x10)	//ExtendedFlags[1] & 0x01
	{
		AddString(buffer, Data->Name, index);
	}

	if (Flags[0] & 0x20)	//ExtendedFlags[1] & 0x02
	{
		AddData(buffer, Data->GameID, index);
	}

	if (Flags[0] & 0x40)	//ExtendedFlags[1] & 0x04
	{
		AddData(buffer, Data->Formation, index);
	}

	if (Flags[0] & 0x80)	//ExtendedFlags[1] & 0x08
	{
		AddData(buffer, Data->Position, index);
	}

	memset(Flags,0,sizeof(Flags));
}
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:26,代码来源:AuxGroupMember.cpp


示例2: sprintf

//以普通方式写一整数
bool Ini::Write(char *index, char *name, int num)
{
	//__ENTER_FUNCTION

	char string[32];
	sprintf(string, "%d", num);

	int n=FindIndex(index);
	if( n == -1 )	//新建索引
	{
		AddIndex(index);
		n=FindIndex(index);
		n=GotoLastLine(index);
		AddData(n, name, string);	//在当前位置n加一个数据
		return true;
	}

	//存在索引
	int m=FindData(n, name);
	if( m==-1 )		//新建数据
	{
		n=GotoLastLine(index);
		AddData(n, name, string);	//在当前位置n加一个数据
		return true;
	}

	//存在数据
	ModityData(n, name, string);	//修改一个数据

	return true;

	//__LEAVE_FUNCTION

//	return 0 ;
}
开发者ID:CrazyPro,项目名称:ape,代码行数:36,代码来源:Ini.cpp


示例3: AddFlags

void AuxElement::BuildExtendedPacket(unsigned char *buffer, long &index)
{
	AddFlags(ExtendedFlags, sizeof(ExtendedFlags), buffer, index);

	if (ExtendedFlags[0] & 0x10)	//ExtendedFlags[1] & 0x02
	{
		AddString(buffer, Data->SourceEntity, index);
	}

	if (ExtendedFlags[0] & 0x20)	//ExtendedFlags[1] & 0x04
	{
		AddString(buffer, Data->SourceObject, index);
	}

	if (ExtendedFlags[0] & 0x40)	//ExtendedFlags[1] & 0x08
	{
		AddData(buffer, Data->Magnitude, index);
	}

	if (ExtendedFlags[0] & 0x80)	//ExtendedFlags[1] & 0x10
	{
		AddData(buffer, char(Data->IsActive), index);
	}

	if (ExtendedFlags[1] & 0x01)	//ExtendedFlags[1] & 0x20
	{
		AddData(buffer, Data->ExpirationTime, index);
	}
}
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:29,代码来源:AuxElement.cpp


示例4: ASSERT_VALID

void CBCGPMSMoneyDemoView::FillGrid ()
{
	ASSERT_VALID (this);

	m_wndGrid.InsertColumn (0, _T(""), 0);
	m_wndGrid.InsertColumn (1, _T("Quarter"), 185);
	m_wndGrid.InsertColumn (2, _T("Amount"), 80);
	m_wndGrid.InsertColumn (3, _T("Change"), 80);

	m_wndGrid.SetColumnAlign (0, HDF_RIGHT);
	m_wndGrid.SetColumnAlign (2, HDF_RIGHT);
	m_wndGrid.SetColumnAlign (3, HDF_RIGHT);
	m_wndGrid.SetHeaderAlign (2, HDF_RIGHT);
	m_wndGrid.SetHeaderAlign (3, HDF_RIGHT);
	m_wndGrid.SetColumnLocked (0);

	AddData (_T("I"), _T("$2,554.00"), 0.0021);
	AddData (_T("II"), _T("$2,370.00"), -0.0052);
	AddData (_T("III"), _T("$1,825.00"), -0.027);
	AddData (_T("IV"), _T("$4,778.00"), 0.0911);

	CBCGPGridRow* pRow5 = m_wndGrid.CreateRow (m_wndGrid.GetColumnCount ());
	
	pRow5->GetItem (0)->SetValue (_T("Total:"));
	pRow5->GetItem (2)->SetValue (_T("$ 1,1527.00"));

	m_wndGrid.AddRow (pRow5);

	m_wndGrid.MergeRange (CBCGPGridRange (0, 4, 1, 4));
	m_wndGrid.MergeRange (CBCGPGridRange (2, 4, 3, 4));

	m_wndGrid.EnableHeader (TRUE, 0);
	m_wndGrid.EnableColumnAutoSize (TRUE);
	m_wndGrid.SetReadOnly (TRUE);
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:35,代码来源:BCGPMSMoneyDemoView.cpp


示例5: EmptyUsed

BOOL CIOCPBuffer::CreatePackage(BYTE Type, UINT iFilesize,UINT iBufferSize, const BYTE *const pData)
{
	UINT nBufLen=iBufferSize;
	if(iBufferSize<(MAXIMUMPACKAGESIZE-MINIMUMPACKAGESIZE-1-sizeof(UINT)))
	{
		// Perpare Package. 
		// Empty the Buffer..
		EmptyUsed();
		
		// Add one to the size header for the Type byte. .  
		nBufLen++;

		// Add The bytes for the iFilesize data. 
		nBufLen+=sizeof(UINT);

		// Add The Header
		AddData(nBufLen);
		
		// Add the Type. 
		AddData(Type);
		
		//Add the size data
		AddData(iFilesize);

		// Add the Buffer. 
		if(iBufferSize>0)
		AddData(pData,iBufferSize);
	return TRUE;
	}
	return FALSE;
}
开发者ID:jeppeter,项目名称:IOCP,代码行数:31,代码来源:IOCPBuffer.cpp


示例6: StringParser

    void StringParser(const std::string& inStr, 
                      const std::string& inSeparator, 
                      Utils::ManagedList<std::string>& outData,
                      bool removeEmpty)
    {
        outData.Clear();

        //if no separator, return full input string
        if (inSeparator.empty()) 
        {
            AddData(inStr, outData, removeEmpty);
            return;
        }

        // if separtor exists, parse string 
        size_t prev = 0;
        while (true)
        {
            size_t next = inStr.find(inSeparator, prev);// inStr.find_first_of(inSeparator, prev);

            // copy symbols after last separator || 
            // copy all string if separator's not found
            if (next == string::npos)  
            {
                AddData(inStr.substr(prev), outData, removeEmpty);
                break;
            }

            AddData(inStr.substr(prev, (next - prev)), outData, removeEmpty);

            prev = next + inSeparator.size();
        }
    }
开发者ID:ixc-software,项目名称:lucksi,代码行数:33,代码来源:StringParser.cpp


示例7: AddFlags

void AuxBuff::BuildExtendedPacket(unsigned char *buffer, long &index)
{
	AddFlags(ExtendedFlags, sizeof(ExtendedFlags), buffer, index);

	if (ExtendedFlags[0] & 0x10)	//ExtendedFlags[1] & 0x02
	{
		AddString(buffer, Data->BuffType, index);
	}

	if (ExtendedFlags[0] & 0x20)	//ExtendedFlags[1] & 0x04
	{
		AddString(buffer, Data->ScrubTypeName, index);
	}

	if (ExtendedFlags[0] & 0x40)	//ExtendedFlags[1] & 0x08
	{
		AddData(buffer, char(Data->IsPermanent), index);
	}

	if (ExtendedFlags[0] & 0x80)	//ExtendedFlags[1] & 0x10
	{
		AddData(buffer, Data->BuffRemovalTime, index);
	}

	if (ExtendedFlags[1] & 0x01)	//ExtendedFlags[1] & 0x20
	{
		Elements.BuildExtendedPacket(buffer, index);
	}
	else if (ExtendedFlags[1] & 0x20)
	{
		AddData(buffer, char(0x05), index);
	}
}
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:33,代码来源:AuxBuff.cpp


示例8: AddFlags

void AuxEffect::BuildPacket(unsigned char *buffer, long &index)
{
	AddFlags(Flags, sizeof(Flags), buffer, index);

	if (Flags[0] & 0x10)	//ExtendedFlags[1] & 0x01
	{
		AddData(buffer, Data->Range, index);
	}

	if (Flags[0] & 0x20)	//ExtendedFlags[1] & 0x02
	{
		AddData(buffer, Data->Usage, index);
	}

	if (Flags[0] & 0x40)	//ExtendedFlags[1] & 0x04
	{
		AddData(buffer, Data->Targets, index);
	}

	if (Flags[0] & 0x80)	//ExtendedFlags[1] & 0x08
	{
		AddData(buffer, Data->Validity, index);
	}

	memset(Flags,0,sizeof(Flags));
}
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:26,代码来源:AuxEffect.cpp


示例9: CFormat

HRESULT CSimpleDataObjectImpl::AddData(UINT cfFormat, HGLOBAL hData)
{
	// Remove existing entry
	CFormat* pFormat=FindFormat(cfFormat, TYMED_HGLOBAL);
	if (pFormat)
	{
		m_Formats.Remove(pFormat);
	}
	
	// Create a new format entry
	pFormat=new CFormat(cfFormat, hData);

	// Add it
	m_Formats.Add(pFormat);

	// Add emulated modes...
	if (cfFormat==CF_TEXT && !FindFormat(CF_UNICODETEXT, TYMED_HGLOBAL) && hData)
	{
		AddData(CF_UNICODETEXT, TYMED_HGLOBAL);
	}
	if (cfFormat==CF_UNICODETEXT && !FindFormat(CF_TEXT, TYMED_HGLOBAL) && hData)
	{
		AddData(CF_TEXT, TYMED_HGLOBAL);
	}

	return S_OK;
}
开发者ID:adhawkins,项目名称:SimpleLib,代码行数:27,代码来源:SimpleDataObject.cpp


示例10: FindIndex

/*================================================================ 
* 函数名:    Write
* 参数:      [in] (char *index_name)当前索引名称
*             [in] (char *key_name)KEY名称
*             [in] (char *value_name)VALUE名称
* 功能描述:   以普通方式写一字符串数据
* 返回值:    成功则返回true, 否则返false
================================================================*/
bool CIni::Write(char *index_name, char *key_name, char *value_name)
{
	int data_pos = FindIndex(index_name);
	if (data_pos == ERROR_DATA_POS)	//新建索引
	{
		AddIndex(index_name);
		data_pos = FindIndex(index_name);
		data_pos = GotoLastLine(index_name);
		AddData(data_pos, key_name, value_name);	//在当前位置n加一个数据
		return true;
	}

	//存在索引
	int data_pos2 = FindData(data_pos, key_name);
	if (data_pos2 == ERROR_DATA_POS)		//新建数据
	{
		data_pos = GotoLastLine(index_name);
		AddData(data_pos, key_name, value_name);	//在当前位置n加一个数据
		return true;
	}

	//存在数据
	ModityData(data_pos, key_name, value_name);	//修改一个数据

	return true;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:34,代码来源:Ini.cpp


示例11: hkvMsgAssetProcessed

 hkvMsgAssetProcessed(bool thumbnailCreated, bool dependenciesDetermined)
 : Message(MSG_ASSET_PROCESSED),
   m_thumbnailCreated(thumbnailCreated), m_dependenciesDetermined(dependenciesDetermined)
 {
   AddData(&m_thumbnailCreated, sizeof(bool));
   AddData(&m_dependenciesDetermined, sizeof(bool));
 }
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:7,代码来源:hkvAssetUpdateIPCMessages.hpp


示例12: sprintf

/*================================================================ 
* 函数名:    Write
* 参数:      [in] (char *index_name)当前索引名称
*             [in] (char *key_name)KEY名称
*             [in] (int int_num)整型值
* 功能描述:   以普通方式写一整数
* 返回值:    成功则返回true, 否则返false
================================================================*/
bool CIni::Write(char *index_name, char *key_name, int int_num)
{
	char string[32];
	sprintf(string, "%d", int_num);

	int data_pos = FindIndex(index_name);
	if (data_pos == ERROR_DATA_POS)	//新建索引
	{
		AddIndex(index_name);
		data_pos = FindIndex(index_name);
		data_pos = GotoLastLine(index_name);
		AddData(data_pos, key_name, string);	//在当前位置n加一个数据
		return true;
	}

	//存在索引
	int data_pos2 = FindData(data_pos, key_name);
	if (data_pos2 == ERROR_DATA_POS)		//新建数据
	{
		data_pos = GotoLastLine(index_name);
		AddData(data_pos, key_name, string);	//在当前位置n加一个数据
		return true;
	}

	//存在数据
	ModityData(data_pos, key_name, string);	//修改一个数据

	return true;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:37,代码来源:Ini.cpp


示例13: guard

bool SymbolMap::LoadNocashSym(const char *filename)
{
	lock_guard guard(lock_);
	FILE *f = File::OpenCFile(filename, "r");
	if (!f)
		return false;

	while (!feof(f)) {
		char line[256], value[256] = {0};
		char *p = fgets(line, 256, f);
		if (p == NULL)
			break;

		u32 address;
		if (sscanf(line, "%08X %s", &address, value) != 2)
			continue;
		if (address == 0 && strcmp(value, "0") == 0)
			continue;

		if (value[0] == '.') {
			// data directives
			char* s = strchr(value, ':');
			if (s != NULL) {
				*s = 0;

				u32 size = 0;
				if (sscanf(s + 1, "%04X", &size) != 1)
					continue;

				if (strcasecmp(value, ".byt") == 0) {
					AddData(address, size, DATATYPE_BYTE);
				} else if (strcasecmp(value, ".wrd") == 0) {
					AddData(address, size, DATATYPE_HALFWORD);
				} else if (strcasecmp(value, ".dbl") == 0) {
					AddData(address, size, DATATYPE_WORD);
				} else if (strcasecmp(value, ".asc") == 0) {
					AddData(address, size, DATATYPE_ASCII);
				}
			}
		} else {				// labels
			int size = 1;
			char* seperator = strchr(value,',');
			if (seperator != NULL) {
				*seperator = 0;
				sscanf(seperator+1,"%08X",&size);
			}

			if (size != 1) {
				AddFunction(value,address,size);
			} else {
				AddLabel(value,address);
			}
		}
	}

	fclose(f);
	return true;
}
开发者ID:CLYBOY,项目名称:ppsspp,代码行数:58,代码来源:SymbolMap.cpp


示例14: AddData

void HexAreaClipboardPasteProxy::DoInit()
{
	AddData(HAPAHCI_NEVER,             wxT("never"),               _("Never"),                         SharedPasterPtr(new HexAreaNerverHexPaster));
	AddData(HAPAHCI_ACCORDINGTOCOPIER, wxT("according_to_copier"), _("According To Copying Behavior"), SharedPasterPtr(new HexAreaAccordingToCopierHexPaster));
	AddData(HAPAHCI_IFPOSSIBLE,        wxT("if_possible"),         _("If Possible"),                   SharedPasterPtr(new HexAreaIfPossibleHexPaster));
	AddData(HAPAHCI_ALWAYS,            wxT("always"),              _("Always"),                        SharedPasterPtr(new HexAreaAlwaysHexPaster));

	SetDefault(HAPAHCI_NEVER, IndexToVal(HAPAHCI_NEVER));
}
开发者ID:hltj,项目名称:wxMEdit,代码行数:9,代码来源:utils.cpp


示例15: translate_plug_process

extern "C" int translate_plug_process(CLogRow* row, std::vector<int8_t> inputFields, std::map<int8_t, std::vector<std::string> >& outputData, std::string function) 
{
	uint32_t size=inputFields.size();
	uint32_t ret=0;
	//g_log->log_error("#############item num :<%d>\n", __FILE__, __LINE__,size);
	if(size <= 1) return 0;
	uint32_t partionNum = 0;
	#if 0
	CLogField*  timeField = row->getField(inputFields[0]);
	if(timeField==NULL)
	{
		return 0;
	}
	std::string sTime = timeField->getFieldValStr();
	CLogField* ipField = row->getField(inputFields[1]);
	if(ipField==NULL)
	{
		return 0;
	}
	std::string strIp = ipField->getFieldValStr();
	#endif
	
	for(uint32_t i=0;i<10;i++)
	{

		CLogField* stepField;
		stepField = row->getField(inputFields[i+2]);
		if(stepField==NULL)
		{
			//g_log->log_error("########can not get item:<%d>\n", __FILE__, __LINE__,i+2);
			continue;
		}
		int64_t usedSpace=stepField->_value.iVal;

		stepField = row->getField(inputFields[i+2+10]);
		if(stepField==NULL)
		{
			//g_log->log_error("########can not get item:<%d>\n", __FILE__, __LINE__,i+12);
			continue;
		}
		int64_t totalSpace=stepField->_value.iVal;
		if((usedSpace<0) || (totalSpace<0))
		{
			//g_log->log_error("########partion:<%d> is -1 \n", __FILE__, __LINE__,i);
			continue;
		}
		uint32_t ratio = (usedSpace*100)/totalSpace;

		AddData(0,i,outputData);
		AddData(1,usedSpace,outputData);
		AddData(2,totalSpace,outputData);
		AddData(3,ratio,outputData);
		partionNum++;
	}
	//g_log->log_error("########total partion:<%d> \n", __FILE__, __LINE__,partionNum);
	return partionNum;
}
开发者ID:ownyang,项目名称:cdp,代码行数:57,代码来源:disk_dispatch.cpp


示例16: AddData

void AsmCode::GenerateData(vector<pair<string, int>>* s)
{
	for(vector<pair<string, int>>::iterator it = s->begin(); it != s->end(); ++it)
	{
		if (it->second == 1)
			AddData(it->first, asm_dd, "0");
		else
			AddData(it->first, asm_dd, IntToStr(it->second)+" dup(0)");
	}
}
开发者ID:ValeevaDA,项目名称:compiler-236,代码行数:10,代码来源:generator.cpp


示例17: AddData

void UpdatePeriods::DoInit()
{
    time_t timemax = std::numeric_limits<time_t>::max();

    AddData(UP_DAILY,   wxT("daily"),   _("every day"),   time_t(3600*24));
    AddData(UP_WEEKLY,  wxT("weekly"),  _("every week"),  time_t(3600*24*7));
    AddData(UP_MONTHLY, wxT("monthly"), _("every month"), time_t(3600*24*30));
    AddData(UP_NEVER,   wxT("never"),   _("never"),       timemax);

    SetDefault(default_idx, default_peroid);
}
开发者ID:modulexcite,项目名称:wxMEdit,代码行数:11,代码来源:update.cpp


示例18: GetData

int Gene::LoadGene(string InFilename) {
	if (InFilename.length() == 0) {
		InFilename = GetData("FILENAME",STRING);
		if (InFilename.length() == 0) {
			InFilename = GetData("DATABASE",STRING);
			if (InFilename.length() == 0) {
				return FAIL;
			}
		}
	}
	if (InFilename.length() == 0) {
		return FAIL; 
	}
	SetData("FILENAME",InFilename.data(),STRING);

	if (!FileExists(InFilename)) {
		InFilename = GetDatabaseDirectory(GetParameter("database"),"gene directory")+InFilename;
		if (!FileExists(InFilename)) {
			return FAIL;
		}
	}

	ifstream Input;
	if (!OpenInput(Input,InFilename)) {
		SetKill(true);
		return FAIL;
	}
	
	do {
		vector<string>* Strings = GetStringsFileline(Input,"\t");
		if (Strings->size() >= 2) {
			//I save the input headings so I can print out the same headings when it's time to save the file
			AddData("INPUT_HEADER",(*Strings)[0].data(),STRING);
			for (int i=1; i < int(Strings->size()); i++) {
				Interpreter((*Strings)[0],(*Strings)[i],true);
			}
		}
		delete Strings;
	} while(!Input.eof());

	if (GetData("DATABASE",STRING).length() == 0) {
		AddData("DATABASE",InFilename.data(),STRING);
	}
	if (MainData != NULL && MainData->GetData("DATABASE",STRING).length() > 0 && GetData("DATABASE",STRING).length() > 0) {
		AddData(MainData->GetData("DATABASE",STRING).data(),GetData("DATABASE",STRING).data(),DATABASE_LINK);
	}

	Input.close();
	return SUCCESS;
}
开发者ID:aabest,项目名称:Model-SEED-core,代码行数:50,代码来源:Gene.cpp


示例19: defined

int CDataFileWriter::AddDataSwapped(int Size, void *pData)
{
#if defined(CONF_ARCH_ENDIAN_BIG)
	void *pSwapped = mem_alloc(Size, 1); // temporary buffer that we use duing compression
	int Index;
	mem_copy(pSwapped, pData, Size);
	swap_endian(&pSwapped, sizeof(int), Size/sizeof(int));
	Index = AddData(Size, Swapped);
	mem_free(pSwapped);
	return Index;
#else
	return AddData(Size, pData);
#endif
}
开发者ID:magnet,项目名称:teeworlds,代码行数:14,代码来源:datafile.cpp


示例20: dbg_assert

int CDataFileWriter::AddDataSwapped(int Size, void *pData)
{
	dbg_assert(Size%sizeof(int) == 0, "incorrect boundary");

#if defined(CONF_ARCH_ENDIAN_BIG)
	void *pSwapped = mem_alloc(Size, 1); // temporary buffer that we use during compression
	mem_copy(pSwapped, pData, Size);
	swap_endian(pSwapped, sizeof(int), Size/sizeof(int));
	int Index = AddData(Size, pSwapped);
	mem_free(pSwapped);
	return Index;
#else
	return AddData(Size, pData);
#endif
}
开发者ID:Berzzzebub,项目名称:teeworlds,代码行数:15,代码来源:datafile.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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