~ubuntu-branches/ubuntu/karmic/me-tv/karmic

« back to all changes in this revision

Viewing changes to src/string_utility.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Lamothe
  • Date: 2007-12-19 23:30:16 UTC
  • Revision ID: james.westby@ubuntu.com-20071219233016-2ng2clfh00xtlevc
Tags: upstream-0.4.19
ImportĀ upstreamĀ versionĀ 0.4.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2007 Michael Lamothe
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 * 
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU Library General Public License for more details.
 
13
 * 
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 
17
 */
 
18
 
 
19
#ifndef __STRING_UTILITY_H__
 
20
#define __STRING_UTILITY_H__
 
21
 
 
22
#include <glib.h>
 
23
#include <glibmm/ustring.h>
 
24
 
 
25
class StringUtility
 
26
{
 
27
public:
 
28
        static Glib::ustring format(const char* fmt, ...);
 
29
        static Glib::ustring get_buffer(const char* buffer, unsigned int length);
 
30
        static Glib::ustring escape(const Glib::ustring& source);
 
31
};
 
32
 
 
33
class StringSplitter
 
34
{
 
35
private:
 
36
        gchar** parts;
 
37
        int             count;
 
38
public:
 
39
        StringSplitter(const Glib::ustring& text, const char* deliminator, int max_length);
 
40
        ~StringSplitter();
 
41
        
 
42
        int get_count() const { return count; }
 
43
        const gchar* get_value(int index);
 
44
        int get_int_value(int index);
 
45
};
 
46
 
 
47
#endif