aboutsummaryrefslogtreecommitdiffstats
path: root/src/kvilib/ext/KviMiscUtils.h
blob: 279243cc18ada540b0c750d8568e400b664e849c (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _KVI_MISCUTILS_H_
#define _KVI_MISCUTILS_H_
//=============================================================================
//
//   File : KviMiscUtils.h
//   Creation date : Mon 08 Jan 2007 04:07:31 by Szymon Stefanek
//
//   This file is part of the KVIrc IRC Client distribution
//   Copyright (C) 2007-2010 Szymon Stefanek <pragma at kvirc dot net>
//
//   This program is FREE software. You can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation; either version 2
//   of the License, or (at your option) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//=============================================================================

/**
* \file KviMiscUtils.h
* \author Szymon Stefanek
* \brief Helper functions
*/

#include "kvi_settings.h"

class QString;

/**
* \namespace KviMiscUtils
* \brief A namespace for helper functions
*
* This namespace contains single function stuff that doesn't really fit anywhere else
*/
namespace KviMiscUtils
{
	/**
	* \brief Compares two x.y.z... version strings
	* The function behaves like strcmp: it returns 0 when the versions are equal, -1 if
	* the szVersion1 is greater and 1 if szVersion2 is greater
	* \param szVersion1 The first version to check
	* \param szVersion2 The second version to check
	* \return int
	*/
	extern KVILIB_API int compareVersions(const QString & szVersion1, const QString & szVersion2);

	/**
	* \brief Checks if the argument string is a valid x.y.z... version string
	* \param szVersion The version to check
	* \return bool
	*/
	extern KVILIB_API bool isValidVersionString(const QString & szVersion);
}

#endif // _KVI_MISCUTILS_H_