Commits

Anonymous committed cfb4de2

make set_image() accept const data

Comments (0)

Files changed (16)

bindings/c/taginfo_c.cc

     return v;
 }
 BOOL taginfo_info_set_image(TagInfo_Info *info,
-                            char* data, int data_length, TagInfo_ImageType image_type) {
+                            const char* data, int data_length, TagInfo_ImageType image_type) {
     Info *i = reinterpret_cast<Info *>(info);
     bool v = i->set_image(data, data_length, (ImageType)image_type);
     return v;

bindings/c/taginfo_c.h

 BOOL taginfo_info_get_image(TagInfo_Info *info, 
                             char** data, int *data_length, TagInfo_ImageType *image_type);
 BOOL taginfo_info_set_image(TagInfo_Info *info,
-                            char* data, int data_length, TagInfo_ImageType image_type);
+                            const char* data, int data_length, TagInfo_ImageType image_type);
 
 #ifdef __cplusplus
 }

libtaginfo/ape_common.cc

 }
 
 
-bool set_ape_image(TagLib::APE::Tag * apetag, char* data, int data_length, ImageType image_type) {
+bool set_ape_image(TagLib::APE::Tag * apetag, const char* data, int data_length, ImageType image_type) {
     return false;
 }
 

libtaginfo/asfinfo.cc

     return false;
 }
 
-bool ASFInfo::set_image(char* data, int data_length, ImageType image_type) {
+bool ASFInfo::set_image(const char* data, int data_length, ImageType image_type) {
     //TODO is it possible
     return false;
 }

libtaginfo/flacinfo.cc

     return true;
 }
 
-bool FlacInfo::set_image(char* data, int data_length, ImageType image_type) {
+bool FlacInfo::set_image(const char* data, int data_length, ImageType image_type) {
     return false;
 }
 

libtaginfo/id3_common.cc

 
 
 
-void set_id3v2_image(ID3v2::Tag * tagv2, char* pdata, int pdata_length, ImageType image_type) {
+void set_id3v2_image(ID3v2::Tag * tagv2, const char* pdata, int pdata_length, ImageType image_type) {
     TagLib::ID3v2::AttachedPictureFrame * PicFrame = NULL;
     TagLib::ID3v2::FrameList FrameList = tagv2->frameListMap()["APIC"];
     for(list<TagLib::ID3v2::Frame*>::iterator iter = FrameList.begin(); iter != FrameList.end(); iter++) {

libtaginfo/info.cc

     return false;
 }
 
-bool Info::set_image(char* data, int data_length, ImageType image_type) {
+bool Info::set_image(const char* data, int data_length, ImageType image_type) {
     return false;
 }
 

libtaginfo/mp3info.cc

     return false;
 }
 
-bool Mp3Info::set_image(char* data, int data_length, ImageType image_type) {
+bool Mp3Info::set_image(const char* data, int data_length, ImageType image_type) {
     if(taglib_tagId3v2)
         set_id3v2_image(taglib_tagId3v2, data, data_length, image_type);
     return true;

libtaginfo/mp4info.cc

     return false;
 }
 
-bool Mp4Info::set_image(char* data, int data_length, ImageType image_type) {
+bool Mp4Info::set_image(const char* data, int data_length, ImageType image_type) {
     return false;
 }
 

libtaginfo/mpcinfo.cc

     return false;
 }
 
-bool MpcInfo::set_image(char* data, int data_length, ImageType image_type) {
+bool MpcInfo::set_image(const char* data, int data_length, ImageType image_type) {
     return false;
 }
 

libtaginfo/ogginfo.cc

     return get_xiph_comment_cover_art(m_XiphComment, data, data_length, image_type);
 }
 
-bool OggInfo::set_image(char* data, int data_length, ImageType image_type) {
+bool OggInfo::set_image(const char* data, int data_length, ImageType image_type) {
     return set_xiph_comment_cover_art(m_XiphComment, data, data_length, image_type);
 }
 

libtaginfo/taginfo.h

             
             virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            virtual bool set_image(const char* data, int data_length, ImageType image_type);
 
             virtual bool can_handle_lyrics(void);
             virtual String get_lyrics(void);
             
             virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            virtual bool set_image(const char* data, int data_length, ImageType image_type);
             
             virtual bool can_handle_lyrics(void);
             virtual String get_lyrics(void);
             
             virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            virtual bool set_image(const char* data, int data_length, ImageType image_type);
             
             virtual bool can_handle_lyrics(void);
             virtual String get_lyrics(void);
             
             virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            virtual bool set_image(const char* data, int data_length, ImageType image_type);
             
             virtual bool can_handle_lyrics(void);
             virtual String get_lyrics(void);
             
             virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            virtual bool set_image(const char* data, int data_length, ImageType image_type);
             
             virtual bool can_handle_lyrics(void);
             virtual String get_lyrics(void);
             
             virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            virtual bool set_image(const char* data, int data_length, ImageType image_type);
     };
     
     
             
             virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            virtual bool set_image(const char* data, int data_length, ImageType image_type);
             
             virtual bool can_handle_lyrics(void);
             virtual String get_lyrics(void);
             
             virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            virtual bool set_image(const char* data, int data_length, ImageType image_type);
             
             virtual bool can_handle_lyrics(void);
             virtual String get_lyrics(void);
             
             virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            virtual bool set_image(const char* data, int data_length, ImageType image_type);
             
             virtual bool can_handle_lyrics(void);
             virtual String get_lyrics(void);

libtaginfo/taginfo_internal.h

                              TagLib::ID3v2::AttachedPictureFrame::Type frametype);
 
 bool get_id3v2_image(ID3v2::Tag * tagv2, char*& data, int &data_length, ImageType &image_type);
-void set_id3v2_image(ID3v2::Tag * tagv2, char* data, int data_length, ImageType image_type);
+void set_id3v2_image(ID3v2::Tag * tagv2, const char* data, int data_length, ImageType image_type);
 
 String get_id3v2_lyrics(ID3v2::Tag * tagv2);
 void set_id3v2_lyrics(ID3v2::Tag * tagv2, const String &lyrics);
                                 char*& data, int &data_length, 
                                 ImageType &image_type);
 bool set_xiph_comment_cover_art(Ogg::XiphComment * xiphcomment, 
-                                char* data, int data_length, 
+                                const char* data, int data_length,
                                 ImageType image_type);
 
 ////////// end XIPH
 
 bool get_ape_item_image(const TagLib::APE::Item &item, char*& data, int &data_length, ImageType &image_type);
 bool get_ape_image(TagLib::APE::Tag * apetag, char*& data, int &data_length, ImageType &image_type);
-bool set_ape_image(TagLib::APE::Tag * apetag, char* data, int data_length, ImageType image_type);
+bool set_ape_image(TagLib::APE::Tag * apetag, const char* data, int data_length, ImageType image_type);
 
 String get_ape_lyrics(APE::Tag * apetag);
 bool set_ape_lyrics(APE::Tag * apetag, const String &lyrics);

libtaginfo/trueaudioinfo.cc

     return false;
 }
 
-bool TrueAudioInfo::set_image(char* data, int data_length, ImageType image_type) {
+bool TrueAudioInfo::set_image(const char* data, int data_length, ImageType image_type) {
     if(taglib_tagId3v2)
         set_id3v2_image(taglib_tagId3v2, data, data_length, image_type);
     return true;

libtaginfo/wavpackinfo.cc

     return get_ape_image(taglib_apetag, data, data_length, image_type);
 }
 
-bool WavPackInfo::set_image(char* data, int data_length, ImageType image_type) {
+bool WavPackInfo::set_image(const char* data, int data_length, ImageType image_type) {
     return set_ape_image(taglib_apetag, data, data_length, image_type);
 }
 

libtaginfo/xiph_common.cc

 
 
 bool set_xiph_comment_cover_art(Ogg::XiphComment * xiphcomment, 
-                                char* data, int data_length, 
+                                const char* data, int data_length,
                                 ImageType image_type) {
     if(xiphcomment) {
         if(xiphcomment->contains("COVERART")) {