当前位置: 首页>>代码示例>>C++>>正文


C++ Album::getId方法代码示例

本文整理汇总了C++中Album::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ Album::getId方法的具体用法?C++ Album::getId怎么用?C++ Album::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Album的用法示例。


在下文中一共展示了Album::getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: id

 Album::Album(const Album& album) :
 id(album.getId()),
 name(album.getName()),
 artist(album.getArtist()),
 coverFilepath(album.getCoverFilepath()),
 mixed(album.getMixed()),
 label(album.getLabel()),
 catalogId(album.getCatalogId()),
 releaseDateYear(album.getReleaseDateYear()),
 releaseDateMonth(album.getReleaseDateMonth()),
 releaseDateDay(album.getReleaseDateDay()),
 basicGenreId(album.getBasicGenreId()),
 basicGenre(NULL) {
     if (album.basicGenre) setBasicGenre(*album.basicGenre);
 }
开发者ID:broken,项目名称:soulsifter,代码行数:15,代码来源:Album.cpp

示例2:

 void Album::operator=(const Album& album) {
     id = album.getId();
     name = album.getName();
     artist = album.getArtist();
     coverFilepath = album.getCoverFilepath();
     mixed = album.getMixed();
     label = album.getLabel();
     catalogId = album.getCatalogId();
     releaseDateYear = album.getReleaseDateYear();
     releaseDateMonth = album.getReleaseDateMonth();
     releaseDateDay = album.getReleaseDateDay();
     basicGenreId = album.getBasicGenreId();
     if (!album.getBasicGenreId() && album.basicGenre) {
         if (!basicGenre) basicGenre = new BasicGenre(*album.basicGenre);
         else *basicGenre = *album.basicGenre;
     } else {
         delete basicGenre;
         basicGenre = NULL;
     }
 }
开发者ID:broken,项目名称:soulsifter,代码行数:20,代码来源:Album.cpp

示例3: sync

    bool Album::sync() {
        Album* album = findById(id);
        if (!album) {
            if (!basicGenreId && basicGenre) {
                basicGenre->sync();
                basicGenreId = basicGenre->getId();
            }
        }
        if (!album) album = findByNameAndArtist(getName(), getArtist());
        if (!album) return true;

        // check fields
        bool needsUpdate = false;
        boost::regex decimal("(-?\\d+)\\.?\\d*");
        boost::smatch match1;
        boost::smatch match2;
        if (id != album->getId()) {
            if (id) {
                LOG(INFO) << "updating album " << id << " id from " << album->getId() << " to " << id;
                needsUpdate = true;
            } else {
                id = album->getId();
            }
        }
        if (name.compare(album->getName())  && (!boost::regex_match(name, match1, decimal) || !boost::regex_match(album->getName(), match2, decimal) || match1[1].str().compare(match2[1].str()))) {
            if (!name.empty()) {
                LOG(INFO) << "updating album " << id << " name from " << album->getName() << " to " << name;
                needsUpdate = true;
            } else {
                name = album->getName();
            }
        }
        if (artist.compare(album->getArtist())  && (!boost::regex_match(artist, match1, decimal) || !boost::regex_match(album->getArtist(), match2, decimal) || match1[1].str().compare(match2[1].str()))) {
            if (!artist.empty()) {
                LOG(INFO) << "updating album " << id << " artist from " << album->getArtist() << " to " << artist;
                needsUpdate = true;
            } else {
                artist = album->getArtist();
            }
        }
        if (coverFilepath.compare(album->getCoverFilepath())  && (!boost::regex_match(coverFilepath, match1, decimal) || !boost::regex_match(album->getCoverFilepath(), match2, decimal) || match1[1].str().compare(match2[1].str()))) {
            if (!coverFilepath.empty()) {
                LOG(INFO) << "updating album " << id << " coverFilepath from " << album->getCoverFilepath() << " to " << coverFilepath;
                needsUpdate = true;
            } else {
                coverFilepath = album->getCoverFilepath();
            }
        }
        if (mixed != album->getMixed()) {
            if (mixed) {
                LOG(INFO) << "updating album " << id << " mixed from " << album->getMixed() << " to " << mixed;
                needsUpdate = true;
            } else {
                mixed = album->getMixed();
            }
        }
        if (label.compare(album->getLabel())  && (!boost::regex_match(label, match1, decimal) || !boost::regex_match(album->getLabel(), match2, decimal) || match1[1].str().compare(match2[1].str()))) {
            if (!label.empty()) {
                LOG(INFO) << "updating album " << id << " label from " << album->getLabel() << " to " << label;
                needsUpdate = true;
            } else {
                label = album->getLabel();
            }
        }
        if (catalogId.compare(album->getCatalogId())  && (!boost::regex_match(catalogId, match1, decimal) || !boost::regex_match(album->getCatalogId(), match2, decimal) || match1[1].str().compare(match2[1].str()))) {
            if (!catalogId.empty()) {
                LOG(INFO) << "updating album " << id << " catalogId from " << album->getCatalogId() << " to " << catalogId;
                needsUpdate = true;
            } else {
                catalogId = album->getCatalogId();
            }
        }
        if (releaseDateYear != album->getReleaseDateYear()) {
            if (releaseDateYear) {
                LOG(INFO) << "updating album " << id << " releaseDateYear from " << album->getReleaseDateYear() << " to " << releaseDateYear;
                needsUpdate = true;
            } else {
                releaseDateYear = album->getReleaseDateYear();
            }
        }
        if (releaseDateMonth != album->getReleaseDateMonth()) {
            if (releaseDateMonth) {
                LOG(INFO) << "updating album " << id << " releaseDateMonth from " << album->getReleaseDateMonth() << " to " << releaseDateMonth;
                needsUpdate = true;
            } else {
                releaseDateMonth = album->getReleaseDateMonth();
            }
        }
        if (releaseDateDay != album->getReleaseDateDay()) {
            if (releaseDateDay) {
                LOG(INFO) << "updating album " << id << " releaseDateDay from " << album->getReleaseDateDay() << " to " << releaseDateDay;
                needsUpdate = true;
            } else {
                releaseDateDay = album->getReleaseDateDay();
            }
        }
        if (basicGenreId != album->getBasicGenreId()) {
            if (basicGenreId) {
                LOG(INFO) << "updating album " << id << " basicGenreId from " << album->getBasicGenreId() << " to " << basicGenreId;
                needsUpdate = true;
//.........这里部分代码省略.........
开发者ID:broken,项目名称:soulsifter,代码行数:101,代码来源:Album.cpp

示例4: setAlbum

 void AlbumPart::setAlbum(const Album& album) {
     this->albumId = album.getId();
     delete this->album;
     this->album = new Album(album);
 }
开发者ID:broken,项目名称:soulsifter,代码行数:5,代码来源:AlbumPart.cpp


注:本文中的Album::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。