shuerhaaken avatar shuerhaaken committed e98f4ce

refactor

Comments (0)

Files changed (25)

+commit 01a52688c2bde3bc248b8eca8a73e8c917057145
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Tue Nov 5 14:07:18 2013 +0100
+
+    update some examples
+
+commit 9993117c8694dbcd5d5d6efcf5d086ae63555a75
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Tue Nov 5 12:18:00 2013 +0100
+
+    refactor
+
+commit 633613ea2553d310ab2ba67391e337ec0377f25e
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Tue Nov 5 11:24:04 2013 +0100
+
+    add checks
+
+commit 12ca91f15bce2b30befda9f07c3b6c931fa64f25
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Mon Nov 4 21:15:25 2013 +0100
+
+    add documentation
+
+commit 261815f6637c4f77667e1f77e9eeaa635a79452a
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Mon Nov 4 21:03:51 2013 +0100
+
+    refactor
+
+commit e2d155349ad5ed19e42e4c3dafa2f177b9dad544
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Mon Nov 4 20:42:03 2013 +0100
+
+    refactor
+
+commit 8f91f7501298417ba39cd4c9bf35b1b86c6f48b3
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Mon Nov 4 20:30:13 2013 +0100
+
+    Allow RAII access to API in C++ code via InfoRef class
+
 commit 2df64b36e85845172c0bb8eff9a4a6a51d66554c
 Author: Jörn Magens <shuerhaaken@googlemail.com>
 Date:   Mon Nov 4 16:22:11 2013 +0100

bindings/c/taginfo_c.cc

 \param img A TagInfo_Image object
 \return image type as TagInfo_ImageContentType
 */
-TagInfo_ImageContentType taginfo_image_get_image_type(const TagInfo_Image * img) {
+TagInfo_ImageContentType taginfo_image_get_content_type(const TagInfo_Image * img) {
     if(!img)
         return TAG_INFO_IMAGE_CONTENT_OTHER;
     const Image *i = reinterpret_cast<const Image *>(img);
-    return static_cast<TagInfo_ImageContentType>(i->get_image_type());
+    return static_cast<TagInfo_ImageContentType>(i->get_content_type());
 }
 
 //! Set the content's type of the image.
 \param img A TagInfo_Image object
 \param itype image type as TagInfo_ImageContentType
 */
-void taginfo_image_set_image_type(TagInfo_Image * img, TagInfo_ImageContentType itype) {
+void taginfo_image_set_content_type(TagInfo_Image * img, TagInfo_ImageContentType itype) {
     if(!img)
         return;
     Image *i = reinterpret_cast<Image *>(img);
-    i->set_image_type(static_cast<Image::ContentType>(itype));
+    i->set_content_type(static_cast<Image::ContentType>(itype));
 }
 
 //! Get the file's type of the image.
 \param img A TagInfo_Image object
 \return image type as TagInfo_ImageFileType
 */
-TagInfo_ImageFileType taginfo_image_get_image_file_type(const TagInfo_Image * img) {
+TagInfo_ImageFileType taginfo_image_get_file_type(const TagInfo_Image * img) {
     if(!img)
         return TAG_INFO_IMAGE_FILE_TYPE_UNKNOWN;
     const Image *i = reinterpret_cast<const Image *>(img);
-    return static_cast<TagInfo_ImageFileType>(i->get_image_file_type());
+    return static_cast<TagInfo_ImageFileType>(i->get_file_type());
 }
 
 //! Set the file's type of the image.
 \param img A TagInfo_Image object
 \param image_f_type image type as TagInfo_ImageFileType
 */
-void taginfo_image_set_image_file_type(TagInfo_Image * img, TagInfo_ImageFileType image_f_type) {
+void taginfo_image_set_file_type(TagInfo_Image * img, TagInfo_ImageFileType image_f_type) {
     if(!img)
         return;
     Image *i = reinterpret_cast<Image *>(img);
-    i->set_image_file_type(static_cast<Image::FileType>(image_f_type));
+    i->set_file_type(static_cast<Image::FileType>(image_f_type));
 }
 
 //! Get the file's type of the image.

bindings/c/taginfo_c.h

                                                 char * bin_data, 
                                                 unsigned int bin_data_length);
 
-TagInfo_ImageContentType taginfo_image_get_image_type(const TagInfo_Image * img);
-void                     taginfo_image_set_image_type(TagInfo_Image * img,
+TagInfo_ImageContentType taginfo_image_get_content_type(const TagInfo_Image * img);
+void                     taginfo_image_set_content_type(TagInfo_Image * img,
                                                       TagInfo_ImageContentType itype);
 
-TagInfo_ImageFileType    taginfo_image_get_image_file_type(const TagInfo_Image * img);
-void                     taginfo_image_set_image_file_type(TagInfo_Image * img,
+TagInfo_ImageFileType    taginfo_image_get_file_type(const TagInfo_Image * img);
+void                     taginfo_image_set_file_type(TagInfo_Image * img,
                                                            TagInfo_ImageFileType image_f_type);
 
 char *                   taginfo_image_get_description(const TagInfo_Image * img);

bindings/vala/libtaginfo_c.vapi

 		public uint8[] get_data();
 		public void set_data([CCode (array_length_cname = "bin_data_length", array_length_type = "unsigned int")] uint8[] data);
 		
-		public ContentType      get_image_type();
-		public void             set_image_type(ContentType itype);
+		public ContentType      get_content_type();
+		public void             set_content_type(ContentType content_type);
 		
-		public FileType         get_image_file_type();
-		public void             set_image_file_type(FileType image_f_type);
+		public FileType         get_file_type();
+		public void             set_file_type(FileType file_type);
 		
 		public string           get_description();
 		public void             set_description(string new_description);

examples/tagwriter_img.vala

         uint8[] data;
         pixbuf.save_to_buffer(out data, "jpeg");
         ia[0].set_data(data);
-        ia[0].set_image_type(Image.ContentType.COVER_FRONT);
+        ia[0].set_content_type(Image.ContentType.COVER_FRONT);
     }
     catch(Error e) {
         print("%s\n", e.message);

libtaginfo/apetaginfo.cc

 }
 
 void extract_image(const APE::Item &image_item, Image *& image) {
-    image->set_image_file_type(Image::TYPE_UNKNOWN);
+    image->set_file_type(Image::TYPE_UNKNOWN);
     if(image_item.type() == APE::Item::Binary) {
         ByteVector CoverData = image_item.binaryData();
         if(CoverData.size() > 0) {
                     extract_image(it->second, image);
                     if(!image->get_data().isEmpty()) {
                         String apetype = String(it->first);
-                        image->set_image_type(ape_image_type_to_image_type(apetype));
+                        image->set_content_type(ape_image_type_to_image_type(apetype));
                         images.prepend(image);
                     }
                     else {
             
             APE::Item imageItem = APE::Item();
             imageItem.setType(APE::Item::Binary);
-            String key = image_type_to_ape_image_name((*it)->get_image_type());
+            String key = image_type_to_ape_image_name((*it)->get_content_type());
             imageItem.setKey(key);
             imageItem.setBinaryData(image_vect);
             taglib_apetag->setItem(key, imageItem);

libtaginfo/asfinfo.cc

     return 5;
 }
 
-Image::ContentType get_image_type_from_pic_type(const ASF::Picture::Type& tpe) {
+Image::ContentType get_content_type_from_pic_type(const ASF::Picture::Type& tpe) {
     switch(tpe) {
         case ASF::Picture::FrontCover :
             return Image::CONTENT_COVER_FRONT;
                         
                         String mimetype = pict.mimeType();
                         if(mimetype.find("/jpeg") != -1 || mimetype.find("/jpg") != -1)
-                            image->set_image_file_type(Image::TYPE_JPEG);
+                            image->set_file_type(Image::TYPE_JPEG);
                         else if(mimetype.find("/png") != -1)
-                            image->set_image_file_type(Image::TYPE_PNG);
+                            image->set_file_type(Image::TYPE_PNG);
                         else if(mimetype.find("/bmp") != -1)
-                            image->set_image_file_type(Image::TYPE_BMP);
+                            image->set_file_type(Image::TYPE_BMP);
                         else if(mimetype.find("/gif") != -1)
-                            image->set_image_file_type(Image::TYPE_GIF);
+                            image->set_file_type(Image::TYPE_GIF);
                         
-                        image->set_image_type(get_image_type_from_pic_type(pict.type())); 
+                        image->set_content_type(get_content_type_from_pic_type(pict.type())); 
                         image->set_description(pict.description());
                         images.prepend(image);
                     }
             if( image->get_data().isEmpty())
                 continue;
             ASF::Picture picture = ASF::Picture();
-            if(image->get_image_file_type() == Image::TYPE_JPEG) //default to jpeg
+            if(image->get_file_type() == Image::TYPE_JPEG) //default to jpeg
                 picture.setMimeType("image/jpeg");
-            else if(image->get_image_file_type() == Image::TYPE_PNG)
+            else if(image->get_file_type() == Image::TYPE_PNG)
                 picture.setMimeType("image/png");
-            else if(image->get_image_file_type() == Image::TYPE_GIF)
+            else if(image->get_file_type() == Image::TYPE_GIF)
                 picture.setMimeType("image/gif");
-            else if(image->get_image_file_type() == Image::TYPE_BMP)
+            else if(image->get_file_type() == Image::TYPE_BMP)
                 picture.setMimeType("image/bmp");
             
             ByteVector img_vect(image->get_data());
             picture.setDescription(image->get_description());
             picture.setPicture(img_vect);
-            picture.setType(image_type_to_picture_type(image->get_image_type()));
+            picture.setType(image_type_to_picture_type(image->get_content_type()));
             ASF::Attribute attr = ASF::Attribute(picture);
             asf_tag->addAttribute(PICTURE_FLAG, attr);
         }

libtaginfo/flacinfo.cc

             for(List<FLAC::Picture *>::Iterator it = plist.begin(); it != plist.end(); ++it) {
                 Image * image = new Image();
                 FLAC::Picture * p = (*it);
-                image->set_image_type(flac_image_type_to_image_type(p->type()));
+                image->set_content_type(flac_image_type_to_image_type(p->type()));
                 image->set_description(p->description());
                 if(!p->data().isEmpty()) {
                     image->set_data(p->data());
             picture->setData(vect);
             picture->setDescription((*it)->get_description());
             picture->setMimeType("image/jpeg"); //TODO
-            picture->setType((FLAC::Picture::Type) (*it)->get_image_type());
+            picture->setType((FLAC::Picture::Type) (*it)->get_content_type());
             flac_file->addPicture(picture);
         }
     }

libtaginfo/id3info.cc

     return Info::save();
 }
 
-Image::ContentType get_image_type_from_pic_frame_type(const ID3v2::AttachedPictureFrame::Type &tpe) {
+Image::ContentType get_content_type_from_pic_frame_type(const ID3v2::AttachedPictureFrame::Type &tpe) {
     switch(tpe) {
         case ID3v2::AttachedPictureFrame::FrontCover:
             return Image::CONTENT_COVER_FRONT;
         for(list<ID3v2::Frame*>::iterator iter = framelist.begin(); iter != framelist.end(); iter++) {
             pic_frame = static_cast<ID3v2::AttachedPictureFrame *>(*iter);
             Image * image = new Image();
-            image->set_image_type(get_image_type_from_pic_frame_type(pic_frame->type()));
+            image->set_content_type(get_content_type_from_pic_frame_type(pic_frame->type()));
             if(pic_frame->picture().size() > 0) {
                 image->set_data(pic_frame->picture());
                 String mimetype = pic_frame->mimeType();
                 if(mimetype.find("/jpeg") != -1 || mimetype.find("/jpg") != -1)
-                    image->set_image_file_type(Image::TYPE_JPEG);
+                    image->set_file_type(Image::TYPE_JPEG);
                 else if(mimetype.find("/png") != -1)
-                    image->set_image_file_type(Image::TYPE_PNG);
+                    image->set_file_type(Image::TYPE_PNG);
                 else if(mimetype.find("/gif") != -1)
-                    image->set_image_file_type(Image::TYPE_GIF);
+                    image->set_file_type(Image::TYPE_GIF);
                 else if(mimetype.find("/bmp") != -1)
-                    image->set_image_file_type(Image::TYPE_BMP);
+                    image->set_file_type(Image::TYPE_BMP);
                 image->set_description(pic_frame->description());
             }
             images.append(image);
             if((*it)->get_data().isEmpty())
                 continue;
             PicFrame = new ID3v2::AttachedPictureFrame;
-            if((*it)->get_image_file_type() == Image::TYPE_JPEG || 
-               (*it)->get_image_file_type() == Image::TYPE_UNKNOWN) //default to jpeg
+            if((*it)->get_file_type() == Image::TYPE_JPEG || 
+               (*it)->get_file_type() == Image::TYPE_UNKNOWN) //default to jpeg
                 PicFrame->setMimeType("image/jpeg");
-            else if((*it)->get_image_file_type() == Image::TYPE_PNG)
+            else if((*it)->get_file_type() == Image::TYPE_PNG)
                 PicFrame->setMimeType("image/png");
-            else if((*it)->get_image_file_type() == Image::TYPE_GIF)
+            else if((*it)->get_file_type() == Image::TYPE_GIF)
                 PicFrame->setMimeType("image/gif");
-            else if((*it)->get_image_file_type() == Image::TYPE_BMP)
+            else if((*it)->get_file_type() == Image::TYPE_BMP)
                 PicFrame->setMimeType("image/bmp");
-            PicFrame->setType(image_type_to_picframetype((*it)->get_image_type()));
+            PicFrame->setType(image_type_to_picframetype((*it)->get_content_type()));
             if(!(*it)->get_description().isEmpty())
                 PicFrame->setDescription((*it)->get_description());
             ByteVector img_vect((*it)->get_data());

libtaginfo/image.cc

 
 //! Get the image content's type from the Image object.
 //! \return type as ImageType
-Image::ContentType Image::get_image_type(void) const {
+Image::ContentType Image::get_content_type(void) const {
     return image_type;
 }
 //! Set the image content's type in the Image object.
 //! \param it as ImageType
-void Image::set_image_type(const Image::ContentType it) {
+void Image::set_content_type(const Image::ContentType it) {
     image_type = it;
 }
 
 //! Get the image file's type from the Image object.
 //! \return type as ImageFileType
-Image::FileType Image::get_image_file_type(void) const {
+Image::FileType Image::get_file_type(void) const {
     return image_file_type;
 }
 //! Set the image file's type in the Image object.
 //! \param ft as ImageFileType
-void Image::set_image_file_type(const Image::FileType ft) {
+void Image::set_file_type(const Image::FileType ft) {
     image_file_type = ft;
 }
 

libtaginfo/mp4info.cc

 }
 
 
-Image::FileType get_image_file_type_from_format(MP4::CoverArt::Format format) {
+Image::FileType get_file_type_from_format(MP4::CoverArt::Format format) {
     switch(format) {
         case MP4::CoverArt::JPEG:
             return Image::TYPE_JPEG;
             Image * image = NULL;
             for(MP4::CoverArtList::Iterator it = covers.begin(); it != covers.end(); it++) {
                 image = new Image();
-                image->set_image_type(Image::CONTENT_OTHER);
+                image->set_content_type(Image::CONTENT_OTHER);
                 image->set_data(it->data());
-                image->set_image_file_type(get_image_file_type_from_format(it->format()));
+                image->set_file_type(get_file_type_from_format(it->format()));
                 if(!it->data().isEmpty())
                     images.append(image);
                 else
             const Image * image = *it;
             if(!image->get_data().isEmpty()) {
                 ByteVector image_data = image->get_data();
-                MP4::CoverArt::Format format = get_format_from_image_file_type(image->get_image_file_type());
+                MP4::CoverArt::Format format = get_format_from_image_file_type(image->get_file_type());
                 MP4::CoverArt cover(format, image_data);
                 cover_list.append(cover);
             }

libtaginfo/taginfo_image.h

             //! \param image_data ByteVector with binary image data
             void set_data(const ByteVector &image_data);
             
-            Image::ContentType get_image_type(void) const;
-            void set_image_type(const Image::ContentType it);
+            Image::ContentType get_content_type(void) const;
+            void set_content_type(const Image::ContentType it);
             
-            Image::FileType get_image_file_type(void) const;
-            void set_image_file_type(const Image::FileType ft);
+            Image::FileType get_file_type(void) const;
+            void set_file_type(const Image::FileType ft);
             
             const String get_description(void) const;
             void set_description(const String &description);

libtaginfo/xiphinfo.cc

             if(i < mimes_cnt) {
                 mimetype = pic_mimes[i];//.to8Bit(false); 
                 if(mimetype.find("/jpeg") != -1 || mimetype.find("/jpg") != -1)
-                    image->set_image_file_type(Image::TYPE_JPEG);
+                    image->set_file_type(Image::TYPE_JPEG);
                 else if(mimetype.find("/png") != -1)
-                    image->set_image_file_type(Image::TYPE_PNG);
+                    image->set_file_type(Image::TYPE_PNG);
                 else if(mimetype.find("/gif") != -1)
-                    image->set_image_file_type(Image::TYPE_GIF);
+                    image->set_file_type(Image::TYPE_GIF);
                 else if(mimetype.find("/bmp") != -1)
-                    image->set_image_file_type(Image::TYPE_BMP);
+                    image->set_file_type(Image::TYPE_BMP);
             }
             if(i < types_cnt) {
                 itype = pic_types[i];
-                image->set_image_type((Image::ContentType) itype.toInt());
+                image->set_content_type((Image::ContentType) itype.toInt());
             }
             if(i < descr_cnt) {
                 description = pic_descr[i];
         for(ImageList::ConstIterator it = images.begin(); it != images.end(); ++it) {
             const Image * image = *it;
             if(!image->get_data().isEmpty()) {
-                if(image->get_image_file_type() == Image::TYPE_UNKNOWN || 
-                   image->get_image_file_type() == Image::TYPE_JPEG)
+                if(image->get_file_type() == Image::TYPE_UNKNOWN || 
+                   image->get_file_type() == Image::TYPE_JPEG)
                     xiphcomment->addField(COVERARTMIME, "image/jpeg", false);
-                else if(image->get_image_file_type() == Image::TYPE_PNG)
+                else if(image->get_file_type() == Image::TYPE_PNG)
                     xiphcomment->addField(COVERARTMIME, "image/png", false);
-                else if(image->get_image_file_type() == Image::TYPE_GIF)
+                else if(image->get_file_type() == Image::TYPE_GIF)
                     xiphcomment->addField(COVERARTMIME, "image/gif", false);
-                else if(image->get_image_file_type() == Image::TYPE_BMP)
+                else if(image->get_file_type() == Image::TYPE_BMP)
                     xiphcomment->addField(COVERARTMIME, "image/bmp", false);
                 String b64Encoded = base64encode(image->get_data().data(), image->get_data().size());
                 xiphcomment->addField(COVERART, 
                                       b64Encoded.toCString(false),
                                       false);
-                xiphcomment->addField(COVERARTTYPE, String::number(static_cast<int>(image->get_image_type())), false);
+                xiphcomment->addField(COVERARTTYPE, String::number(static_cast<int>(image->get_content_type())), false);
                 
                 if(!image->get_description().isEmpty())
                     xiphcomment->addField(COVERARTDESCRIPTION, image->get_description(), false);

tests/ctest_write/main.c

     }
     TagInfo_Image * img = taginfo_image_new();
     taginfo_image_set_data(img, (char*)mmap(0, filestatus.st_size, PROT_READ, MAP_SHARED, fd, 0), (unsigned int)filestatus.st_size);
-    taginfo_image_set_image_type(img, TAG_INFO_IMAGE_CONTENT_OTHER);
+    taginfo_image_set_content_type(img, TAG_INFO_IMAGE_CONTENT_OTHER);
     taginfo_image_set_description(img, strdup(DESCRIPTION));
     TagInfo_Image ** ima = malloc(1 * sizeof(img));
     *ima = img;

tests/write_image_ape/main.cc

     std::ofstream  dst(target.c_str());
     dst << src.rdbuf();
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     // Image description not supported by APE
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
     // Image description not supported by APE
     
     struct stat filestatus;
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
 //                if(images)
 //                    delete [] images;
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
 //                if(images)
 //                    delete [] images;
                 if(read_image)

tests/write_image_flac/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     img->set_description("Bescräibunk");
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
     img2->set_description("Beßcräibunk");
 
     struct stat filestatus;
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;
                     delete read_image;
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;

tests/write_image_mp3/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     img->set_description("Bescräibunk");
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
     img2->set_description("Beßcräibunk");
 
     struct stat filestatus;
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;
                     delete read_image;
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;

tests/write_image_mp4/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-//    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+//    img->set_content_type(Image::CONTENT_COVER_FRONT);
 //    img->set_description("Bescräibunk");
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-//    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+//    img2->set_content_type(Image::CONTENT_COVER_BACK);
 //    img2->set_description("Beßcräibunk");
 
     struct stat filestatus;
                     return EXIT_FAILURE;
                 }
             }
-//            if(img->get_image_type() != read_image->get_image_type()) {
+//            if(img->get_content_type() != read_image->get_content_type()) {
 //                if(read_image)
 //                    delete read_image;
 //                return EXIT_FAILURE;
 //                    delete read_image;
 //                return EXIT_FAILURE;
 //            }
-//            if(img2->get_image_type() != read_image2->get_image_type()) {
+//            if(img2->get_content_type() != read_image2->get_content_type()) {
 //                if(read_image)
 //                    delete read_image;
 //                return EXIT_FAILURE;

tests/write_image_mpc/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
 
     struct stat filestatus;
     stat( image.c_str(), &filestatus );
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
                 return EXIT_FAILURE;
             }
             int i;

tests/write_image_ogg/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     img->set_description("Bescräibunk");
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
     img2->set_description("Beßcräibunk");
 
     struct stat filestatus;
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;
                     delete read_image;
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;

tests/write_image_speex/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     img->set_description("Bescräibunk");
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
     img2->set_description("Beßcräibunk");
 
     struct stat filestatus;
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;
                     delete read_image;
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;

tests/write_image_tta/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     img->set_description("Bescräibunk");
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
     img2->set_description("Beßcräibunk");
 
     struct stat filestatus;
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;
                     delete read_image;
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;

tests/write_image_wav/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     img->set_description("Bescräibunk");
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
     img2->set_description("Beßcräibunk");
 
     struct stat filestatus;
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;
                     delete read_image;
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;

tests/write_image_wma/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     img->set_description("Bescräibunk");
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
     img2->set_description("Beßcräibunk");
 
     struct stat filestatus;
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
                 return EXIT_FAILURE;
             }
             if(img->get_description() != read_image->get_description()) {
             if(img2->get_description() != read_image2->get_description()) {
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
                 return EXIT_FAILURE;
             }
             int i;

tests/write_image_wv/main.cc

     dst << src.rdbuf();
     
     Image * img = new Image();
-    img->set_image_file_type(Image::TYPE_JPEG);
-    img->set_image_type(Image::CONTENT_COVER_FRONT);
+    img->set_file_type(Image::TYPE_JPEG);
+    img->set_content_type(Image::CONTENT_COVER_FRONT);
     
     Image * img2 = new Image();
-    img2->set_image_file_type(Image::TYPE_JPEG);
-    img2->set_image_type(Image::CONTENT_COVER_BACK);
+    img2->set_file_type(Image::TYPE_JPEG);
+    img2->set_content_type(Image::CONTENT_COVER_BACK);
 
     struct stat filestatus;
     stat( image.c_str(), &filestatus );
                     return EXIT_FAILURE;
                 }
             }
-            if(img->get_image_type() != read_image->get_image_type()) {
+            if(img->get_content_type() != read_image->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;
             }
-            if(img2->get_image_type() != read_image2->get_image_type()) {
+            if(img2->get_content_type() != read_image2->get_content_type()) {
                 if(read_image)
                     delete read_image;
                 return EXIT_FAILURE;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.