src/misc.h

changeset 20
a5457405cc9b
parent 13
9bdddd2ccde6
child 25
256bb5c6b77f
equal deleted inserted replaced
19:c9b6dd9dd4cd 20:a5457405cc9b
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18 18
19 #ifndef MISC_H 19 #ifndef ZANDEMO_MISC_H
20 #define MISC_H 20 #define ZANDEMO_MISC_H
21 21
22 #include "types.h" 22 #include "types.h"
23 23
24 uint32 makeByteID (uint8 a, uint8 b, uint8 c, uint8 d); 24 uint32 makeByteID (uint8 a, uint8 b, uint8 c, uint8 d);
25 str binaryConfigName (str ver); 25 str binaryConfigName (str ver);
26 str basename (str path); 26 str basename (str path);
27 list<var> getVersionsList();
28 list<var> getReleasesList();
29 void addVersion (str name, bool isRelease, str binaryPath); 27 void addVersion (str name, bool isRelease, str binaryPath);
28
29 QList<QVariant> getVersions();
30 30
31 // ----------------------------------------------------------------------------- 31 // -----------------------------------------------------------------------------
32 // Templated clamp 32 // Templated clamp
33 template<class T> static inline T clamp (T a, T min, T max) { 33 template<class T> static inline T clamp (T a, T min, T max) {
34 return (a > max) ? max : (a < min) ? min : a; 34 return (a > max) ? max : (a < min) ? min : a;
47 // Templated absolute value 47 // Templated absolute value
48 template<class T> static inline T abs (T a) { 48 template<class T> static inline T abs (T a) {
49 return (a >= 0) ? a : -a; 49 return (a >= 0) ? a : -a;
50 } 50 }
51 51
52 #endif // MISC_H 52 #endif // ZANDEMO_MISC_H

mercurial