Old/mp3_InfoManager/field_binary.cpp
/** Copies binary data from the field to the specified file.
 **
 ** \code
 **   myFrame.GetField(ID3FN_DATA)->ToFile("output.bin");
 ** \endcode
 **/
Copies binary data from the field to the specified file.
Copies binary data from the field to the specified file .
void ID3_FieldImpl::ToFile(const char *info 
                           ) const
{
  if (this->GetType() != ID3FTY_BINARY || NULL == info)
  {
    return;
  }
  size_t size = this->Size();
  if (size > 0)
  {
    FILE* temp_file = ::fopen(info, "wb");
    if (temp_file != NULL)
    {
      ::fwrite(_binary.data(), 1, size, temp_file);
      ::fclose(temp_file);
    }
  }
  return ;
}
void ID3_FieldImpl :: ToFile ( const char * info ) const { if ( this -> GetType ( ) != ID3FTY_BINARY || NULL == info ) { return ; } size_t size = this -> Size ( ) ; if ( size > 0 ) { FILE * temp_file = :: fopen ( info , " " ) ; if ( temp_file != NULL ) { :: fwrite ( _binary . data ( ) , 1 , size , temp_file ) ; :: fclose ( temp_file ) ; } } return ; }
Copies binary data from the field to the specified file.
Copies binary data from the field to the specified file .
//< Destination filename