2008-07-16 16:35:59 +08:00
|
|
|
//
|
2008-07-25 17:08:15 +08:00
|
|
|
// ZoneMinder General Utility Functions, $Date$, $Revision$
|
2008-07-25 17:33:23 +08:00
|
|
|
// Copyright (C) 2001-2008 Philip Coombes
|
2008-07-16 16:35:59 +08:00
|
|
|
//
|
|
|
|
// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ZM_UTILS_H
|
|
|
|
#define ZM_UTILS_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
typedef std::vector<std::string> StringVector;
|
|
|
|
|
|
|
|
const std::string stringtf( const char *format, ... );
|
|
|
|
const std::string stringtf( const std::string &format, ... );
|
|
|
|
|
|
|
|
bool startsWith( const std::string &haystack, const std::string &needle );
|
2009-05-28 16:47:59 +08:00
|
|
|
StringVector split( const std::string &string, const std::string chars, int limit=0 );
|
2008-07-16 16:35:59 +08:00
|
|
|
|
|
|
|
const std::string base64Encode( const std::string &inString );
|
|
|
|
|
2008-10-22 21:10:12 +08:00
|
|
|
inline int max( int a, int b )
|
|
|
|
{
|
|
|
|
return( a>=b?a:b );
|
|
|
|
}
|
|
|
|
|
|
|
|
inline int min( int a, int b )
|
|
|
|
{
|
|
|
|
return( a<=b?a:b );
|
|
|
|
}
|
|
|
|
|
2011-04-29 22:26:50 +08:00
|
|
|
void ssedetect();
|
2011-05-01 02:39:34 +08:00
|
|
|
void sse2_aligned_memcpy(unsigned char* dest, const unsigned char* src, const size_t bytes);
|
2011-04-29 22:26:50 +08:00
|
|
|
|
|
|
|
extern unsigned int sseversion;
|
|
|
|
|
2008-07-16 16:35:59 +08:00
|
|
|
#endif // ZM_UTILS_H
|