本文整理汇总了C++中Album::getReleaseDateMonth方法的典型用法代码示例。如果您正苦于以下问题:C++ Album::getReleaseDateMonth方法的具体用法?C++ Album::getReleaseDateMonth怎么用?C++ Album::getReleaseDateMonth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::getReleaseDateMonth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
}
示例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;
//.........这里部分代码省略.........