本文整理汇总了C++中SetBuffer函数的典型用法代码示例。如果您正苦于以下问题:C++ SetBuffer函数的具体用法?C++ SetBuffer怎么用?C++ SetBuffer使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetBuffer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetAttribute
bool XMLElement::SetBuffer(const String& name, const PODVector<unsigned char>& value)
{
if (!value.Size())
return SetAttribute(name, String::EMPTY);
else
return SetBuffer(name, &value[0], value.Size());
}
示例2: SetAttribute
bool XMLElement::SetBuffer(const ea::string& name, const ea::vector<unsigned char>& value)
{
if (!value.size())
return SetAttribute(name, EMPTY_STRING);
else
return SetBuffer(name, &value[0], value.size());
}
示例3: m_Buffer
String::String(const String& other) :
m_Buffer(NULL),
m_BufferSize(NULL),
m_Length(NULL)
{
SetBuffer(other.GetBuffer());
}
示例4: ATLTRACE
/// <summary>Read the full method from the supplied buffer.</summary>
void Method::ReadMethod(IMAGE_COR_ILMETHOD* pMethod)
{
BYTE* pCode;
auto fatImage = static_cast<COR_ILMETHOD_FAT*>(&pMethod->Fat);
if (!fatImage->IsFat())
{
#ifdef TRACE_ENABLED
ATLTRACE(_T("TINY"));
#endif
auto tinyImage = static_cast<COR_ILMETHOD_TINY*>(&pMethod->Tiny);
m_header.CodeSize = tinyImage->GetCodeSize();
pCode = tinyImage->GetCode();
#ifdef TRACE_ENABLED
ATLTRACE(_T("TINY(%X) => (%d + 1) : %d"), m_header.CodeSize, m_header.CodeSize, m_header.MaxStack);
#endif
}
else
{
memcpy(&m_header, pMethod, fatImage->Size * sizeof(DWORD));
pCode = fatImage->GetCode();
#ifdef TRACE_ENABLED
ATLTRACE(_T("FAT(%X) => (%d + 12) : %d"), m_header.CodeSize, m_header.CodeSize, m_header.MaxStack);
#endif
}
SetBuffer(pCode);
ReadBody();
}
示例5: Stop
Sound& Sound::operator =(const Sound& right)
{
// Here we don't use the copy-and-swap idiom, because it would mess up
// the list of sound instances contained in the buffers
// Detach the sound instance from the previous buffer (if any)
if (myBuffer)
{
Stop();
myBuffer->DetachSound(this);
myBuffer = NULL;
}
// Copy the sound attributes
if (right.myBuffer)
SetBuffer(*right.myBuffer);
SetLoop(right.GetLoop());
SetPitch(right.GetPitch());
SetVolume(right.GetVolume());
SetPosition(right.GetPosition());
SetRelativeToListener(right.IsRelativeToListener());
SetMinDistance(right.GetMinDistance());
SetAttenuation(right.GetAttenuation());
return *this;
}
示例6: SetBuffer
HRESULT StringBuffer::Concat(__deref_in const WCHAR* pszString, __in_z const UINT &length)
{
if (!m_pszString)
{
return SetBuffer(pszString, length);
}
if (length > 0)
{
size_t actualLen = wcslen(m_pszString);
size_t newSize = (actualLen + length + 1) * sizeof(WCHAR);
WCHAR* temp = (WCHAR*)realloc(m_pszString, newSize);
if (!temp)
{
return E_OUTOFMEMORY;
}
m_pszString = temp;
memcpy(m_pszString + actualLen, pszString, (length + 1) * sizeof(WCHAR));
}
return S_OK;
}
示例7: CMediaBufferDecode
CMediaBufferDecode(const BYTE *pData, DWORD dwLength)
: CMediaBuffer(NULL, 0, false)
{
m_pBuffer = (BYTE *)av_malloc(dwLength + FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(m_pBuffer, pData, dwLength);
SetBuffer(m_pBuffer, dwLength);
}
示例8: SetString
void JSONValue::SetBuffer(const String& name, const PODVector<unsigned char>& value)
{
if (!value.Size())
SetString(name, String::EMPTY);
else
SetBuffer(name, &value[0], value.Size());
}
示例9: SoundSource
Sound::Sound(const Sound& copy) :
SoundSource(copy),
myBuffer (NULL)
{
if (copy.myBuffer)
SetBuffer(*copy.myBuffer);
SetLoop(copy.GetLoop());
}
示例10: sfSound_SetBuffer
////////////////////////////////////////////////////////////
/// Bind a sound buffer to a sound
////////////////////////////////////////////////////////////
void sfSound_SetBuffer(sfSound* Sound, sfSoundBuffer* Buffer)
{
if (Buffer)
{
CSFML_CALL(Sound, SetBuffer(Buffer->This))
Sound->Buffer = Buffer;
}
}
示例11: SetBuffer
void Source::SetBuffer(Buffer* value)
{
#ifdef HAS_AUDIO_SOURCE
impl->SetBuffer(value);
#else
(void)value;
throw System::PunkException(L"Audio source is not available");
#endif
}
示例12: myBuffer
Sound::Sound(const SoundBuffer& buffer, bool loop, float pitch, float volume, const Vector3f& position) :
myBuffer(NULL)
{
SetBuffer(buffer);
SetLoop(loop);
SetPitch(pitch);
SetVolume(volume);
SetPosition(position);
}
示例13: SetBuffer
KaxBlockVirtual::KaxBlockVirtual(const KaxBlockVirtual & ElementToClone)
:EbmlBinary(ElementToClone)
,Timecode(ElementToClone.Timecode)
,TrackNumber(ElementToClone.TrackNumber)
,ParentCluster(ElementToClone.ParentCluster) ///< \todo not exactly
{
SetBuffer(DataBlock,sizeof(DataBlock));
SetValueIsSet(false);
}
示例14: SetParameters
CTokenBufferInfo::CTokenBufferInfo(CTokenParser* Parser, char* pTxt)
{
bUseLineEnd = 0;
pParser = Parser;
pBigBuff = NULL;
bMyBigBuff = 0;
SetParameters();
SetBuffer(pTxt);
}
示例15: TXT_SpinControlDrawer
static void TXT_SpinControlDrawer(TXT_UNCAST_ARG(spincontrol), int selected)
{
TXT_CAST_ARG(txt_spincontrol_t, spincontrol);
unsigned int i;
unsigned int padding;
TXT_FGColor(TXT_COLOR_BRIGHT_CYAN);
TXT_BGColor(TXT_COLOR_BLUE, 0);
TXT_DrawString("\x1b ");
TXT_FGColor(TXT_COLOR_BRIGHT_WHITE);
// Choose background color
if (selected && spincontrol->editing)
{
TXT_BGColor(TXT_COLOR_BLACK, 0);
}
else if (selected)
{
TXT_BGColor(TXT_COLOR_GREY, 0);
}
else
{
TXT_BGColor(TXT_COLOR_BLUE, 0);
}
if (!spincontrol->editing)
{
SetBuffer(spincontrol);
}
i = 0;
padding = spincontrol->widget.w - strlen(spincontrol->buffer) - 4;
while (i < padding)
{
TXT_DrawString(" ");
++i;
}
TXT_DrawString(spincontrol->buffer);
i += strlen(spincontrol->buffer);
while (i < spincontrol->widget.w - 4)
{
TXT_DrawString(" ");
++i;
}
TXT_FGColor(TXT_COLOR_BRIGHT_CYAN);
TXT_BGColor(TXT_COLOR_BLUE, 0);
TXT_DrawString(" \x1a");
}