ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

updates.cpp

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #include "common/system.h"
00024 #include "common/updates.h"
00025 #include "common/translation.h"
00026 
00027 namespace Common {
00028 
00029 static const int updateIntervals[] = {
00030     UpdateManager::kUpdateIntervalNotSupported,
00031     UpdateManager::kUpdateIntervalOneDay,
00032     UpdateManager::kUpdateIntervalOneWeek,
00033     UpdateManager::kUpdateIntervalOneMonth,
00034     -1
00035 };
00036 
00037 const int *UpdateManager::getUpdateIntervals() {
00038     return updateIntervals;
00039 }
00040 
00041 int UpdateManager::normalizeInterval(int interval) {
00042     const int *val = updateIntervals;
00043 
00044     while (*val != -1) {
00045         if (*val >= interval)
00046             return *val;
00047         val++;
00048     }
00049 
00050     return val[-1]; // Return maximal acceptable value
00051 }
00052 
00053 const char *UpdateManager::updateIntervalToString(int interval) {
00054     switch (interval) {
00055     case kUpdateIntervalNotSupported:
00056         return _("Never");
00057     case kUpdateIntervalOneDay:
00058         return _("Daily");
00059     case kUpdateIntervalOneWeek:
00060         return _("Weekly");
00061     case kUpdateIntervalOneMonth:
00062         return _("Monthly");
00063     default:
00064         return _("<Bad value>");
00065     }
00066 }
00067 
00068 } // End of namespace Common


Generated on Sat May 18 2019 05:01:28 for ResidualVM by doxygen 1.7.1
curved edge   curved edge