Old/mp3_InfoManager/field_string_unicode.cpp
/** Copies the contents of the field into the supplied buffer, up to the
 ** number of characters specified; for fields with multiple entries, the
 ** optional third parameter indicates which of the fields to retrieve.
 **
 ** Performs similarly as the ASCII Get(char *, size_t, size_t) method, taking
 ** a unicode_t string as a parameter rather than an ascii string.  The
 ** maxChars parameter still represents the maximum number of characters, not
 ** bytes.
 **
 ** \code
 **   unicode_t myBuffer[1024];
 **   size_t charsUsed = myFrame.GetField(ID3FN_UNICODE)->Get(buffer, 1024);
 ** \endcode
 **
 ** \param buffer   Where the field's data is copied to
 ** \param maxChars The maximum number of characters to copy to the buffer.
 ** \param itemNum  For fields with multiple items (such as the involved
 **                 people frame, the item number to retrieve.
 ** \sa Get(char *, size_t, size_t)
 **/
Copies the contents of the field into the supplied buffer, up to the
number of characters specified; for fields with multiple entries, the
optional third parameter indicates which of the fields to retrieve.

Performs similarly as the ASCII Get(char *, size_t, size_t) method, taking
a unicode_t string as a parameter rather than an ascii string.  The
maxChars parameter still represents the maximum number of characters, not
bytes.



\param buffer   Where the field's data is copied to
\param maxChars The maximum number of characters to copy to the buffer.
\param itemNum  For fields with multiple items (such as the involved
people frame, the item number to retrieve.
Copies the contents of the field into the supplied buffer up to the number of characters specified ; for fields with multiple entries the optional third parameter indicates which of the fields to retrieve . Performs similarly as the ASCII Get ( char * size_t size_t ) method taking a unicode_t string as a parameter rather than an ascii string . The maxChars parameter still represents the maximum number of characters not bytes . \ param buffer Where the field ' s data is copied to \ param maxChars The maximum number of characters to copy to the buffer . \ param itemNum For fields with multiple items ( such as the involved people frame the item number to retrieve .
size_t ID3_FieldImpl::Get(unicode_t *buffer, size_t maxLength) const
{
  size_t length = 0;
  if (this->GetType() == ID3FTY_TEXTSTRING &&
      this->GetEncoding() == ID3TE_UNICODE &&
      buffer != NULL && maxLength > 0)
  {
    size_t size = this->Size();
    length = dami::min(maxLength, size);
    ::memcpy((void *)buffer, (void *)_text.data(), length * 2);
    if (length < maxLength)
    {
      buffer[length] = NULL_UNICODE;
    }
  }
  return length;
}
size_t ID3_FieldImpl :: Get ( unicode_t * buffer , size_t maxLength ) const { size_t length = 0 ; if ( this -> GetType ( ) == ID3FTY_TEXTSTRING && this -> GetEncoding ( ) == ID3TE_UNICODE && buffer != NULL && maxLength > 0 ) { size_t size = this -> Size ( ) ; length = dami :: min ( maxLength , size ) ; :: memcpy ( ( void * ) buffer , ( void * ) _text . data ( ) , length * 2 ) ; if ( length < maxLength ) { buffer [ length ] = NULL_UNICODE ; } } return length ; }
Copies the contents of the field into the supplied buffer, up to the
 number of characters specified; for fields with multiple entries, the
 optional third parameter indicates which of the fields to retrieve.
Copies the contents of the field into the supplied buffer up to the number of characters specified ; for fields with multiple entries the optional third parameter indicates which of the fields to retrieve .