/////////////////////////////////////////////////////////////////////////////
// Name:        utils
// Purpose:     wxBugTracker
// Author:      Aleksandras Gluchovas (mailto:alex@soften.ktu.lt)
// Modified by:
// Created:     20/10/1999
// RCS-ID:      $Id: myutils.h,v 1.4 2001/02/22 12:46:51 georgetasker Exp $
// Copyright:   (c) Aleksandras Gluchovas
// Licence:   	GPL (version 2.0 or later)
/////////////////////////////////////////////////////////////////////////////

#ifndef __MYUTILS_G__
#define __MYUTILS_G__

#include "wx/dynarray.h"
#include "wx/string.h"
#include "strlist.h"
#include "list.h"

///// global helper-functions ///////

wxString IntToStr( int i );
int StrToInt( const wxString& str );

wxString LoadFileContent( const wxString& fname, bool binary = FALSE );
bool   WriteFileContent( const wxString& fname, const wxString& content );
bool   AppendFileContent( const wxString& fname, const wxString& content );

wxString LZO_CompressString( const wxString& s );
wxString LZO_DecompressString( const wxString& s, int expectedOutLen );

void ExtractConcatenatedValues( const wxString& str, StrListT& toList, char separator = '|' );
void ExtractConcatenatedValues( const wxString& str, wxStringList& toList, char separator = '|' );
wxString ConcatenateValues( const StrListT& srcList, char separator = '|' );

wxString GetEscapedString( const wxString& src );
wxString GetUnescapedString( const wxString& src );

wxString RGBIntToStr( int rgb );
int StrToRGbInt( const wxString& str );
int GetIntRedValue( int rgb );
int GetIntBlueValue( int rgb );
int GetIntGreenValue( int rgb );
int MakeRGBInt( int r, int g, int b );

void ConcatString( wxString& toStr, const char* what, size_t len );

void StrListToStringList( wxStringList& dest, StrListT& src );

// result:
//
//-1	First file time is less than second file time.
// 0	First file time is equal to second file time.
//+1	First file time is greater than second file time.

bool CompareMofidcationDates( const wxString& file1,
							  const wxString& file2, int* result );

wxString& MakeTmpString( const wxString& str );
void ClearTmpStrings();

wxString ToPlatformText( const wxString& src );

#endif // __MYUTILS_G__
