コード例 #1
0
ファイル: ogrocistringbuf.cpp プロジェクト: 0004c/node-gdal
void OGROCIStringBuf::Append( const char *pszNewText )

{
    int  nNewLen = strlen(pszNewText);

    MakeRoomFor( nNewLen );
    strcat( pszString+nLen, pszNewText );
    nLen += nNewLen;
}
コード例 #2
0
ファイル: objcache.cpp プロジェクト: Amadiro/xara-cairo
CACHE_HANDLE ObjectCache::Add(CachedObject *pObj)
{
	ERROR3IF(pObj==NULL, "Error: the object to cache can't be NULL");

	if (pObj == NULL)
		return 0;

//	MYTRACE( _T("ObjectCache::Add()\n"));

	// if we can make room for the object then assign the object a unique handle and cache it
	if (MakeRoomFor(pObj))
	{
		CACHE_HANDLE hObj = m_HandleFactory++;

		pObj->StoreHandle(hObj);		// store the CachedObject Handle
		m_NumObjects++;					// Increase the number of objects
		m_CurrentSize += pObj->GetSize();	// Increase the space used
		m_ObjectMap[hObj] = pObj;	// set the object in the hash table
		return hObj;
	}

	return 0;
}