Compelete comments on intercaface.

This commit is contained in:
BYVoid 2011-07-10 15:20:05 +08:00
parent 3601900164
commit 9be8afdfb9
3 changed files with 17 additions and 7 deletions

Binary file not shown.

View File

@ -81,11 +81,10 @@ void uchardet_delete(uchardet_t ud)
delete reinterpret_cast<DllDetector*>(ud); delete reinterpret_cast<DllDetector*>(ud);
} }
void uchardet_handle_data(uchardet_t ud, const char * data, size_t len) int uchardet_handle_data(uchardet_t ud, const char * data, size_t len)
{ {
nsresult ret = reinterpret_cast<DllDetector*>(ud)->HandleData(data, (PRUint32)len); nsresult ret = reinterpret_cast<DllDetector*>(ud)->HandleData(data, (PRUint32)len);
if (ret != NS_OK) return (ret != NS_OK);
; //TODO
} }
void uchardet_data_end(uchardet_t ud) void uchardet_data_end(uchardet_t ud)

View File

@ -77,35 +77,46 @@ extern "C" {
typedef void * uchardet_t; typedef void * uchardet_t;
/**
* Create an encoding detector.
* @return a handle of a instance of uchardet
*/
uchardet_t uchardet_new(); uchardet_t uchardet_new();
/**
* Delete an encoding detector.
* @param ud [in] handle of a instance of uchardet
*/
void uchardet_delete(uchardet_t ud); void uchardet_delete(uchardet_t ud);
/** /**
* Feed data to an encoding detector. * Feed data to an encoding detector.
* @param ud [in] handle of a instance of uchardet
* @param data [in] data * @param data [in] data
* @param len [in] number of byte of data
* @return non-zero number on failure.
*/ */
void uchardet_handle_data(uchardet_t ud, const char * data, size_t len); int uchardet_handle_data(uchardet_t ud, const char * data, size_t len);
/** /**
* Notify an end of data to an encoding detctor. * Notify an end of data to an encoding detctor.
* @param ud [in] handle of a instance of uchardet
*/ */
void uchardet_data_end(uchardet_t ud); void uchardet_data_end(uchardet_t ud);
/** /**
* Reset an encoding detector. * Reset an encoding detector.
* @param ud [in] handle of a instance of uchardet
*/ */
void uchardet_reset(uchardet_t ud); void uchardet_reset(uchardet_t ud);
/** /**
* Get the name of encoding that was detected. * Get the name of encoding that was detected.
* @param ud [in] handle of a instance of uchardet
* @return name of charset * @return name of charset
*/ */
const char * uchardet_get_charset(uchardet_t ud); const char * uchardet_get_charset(uchardet_t ud);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif