Commit 1b29d9040e0dbe4e6c27dd96bc0a14d78ea94f70

String-oriented API added
gchardet.cpp
(11 / 0)
  
66#include "gchardet.h"
77#include "nscore.h"
88#include "nsUniversalDetector.h"
9#include <string.h>
910
1011
1112class CharsetDetector : public nsUniversalDetector
8484 g_return_if_fail (cd != NULL);
8585 CharsetDetector *impl = reinterpret_cast <CharsetDetector*> (cd);
8686 impl -> DataEnd ();
87}
88
89
90gchar*
91g_chardet_detect (const gchar *string, guint32 lang_filter)
92{
93 g_return_val_if_fail (string != NULL, NULL);
94 CharsetDetector impl (lang_filter);
95 impl.HandleData (string, strlen (string));
96 return g_strdup (impl.GetCharset ());
8797}
gchardet.h
(1 / 0)
  
3636gboolean g_chardet_found (g_chardet_t* cd);
3737void g_chardet_finish (g_chardet_t* cd);
3838void g_chardet_free (g_chardet_t* cd);
39gchar* g_chardet_detect (const gchar *string, guint32 lang_filter);
3940
4041G_END_DECLS
4142