haiku/headers/private/locale/ICUWrapper.h
Adrien Destugues 33eead339b * Improve the test for TimeFormat (style and error checking)
* Fix the TimeFormat API, there was a double free. Make it work as expected : you send it a number of seconds and it will format it properly in days, hours, minutes, seconds with proper plural.
 * Cleanup other parts of the Format API from useless things. They may get reintroduced later if we feel the need to do so.
 * AboutSystem now use TimeFormat to display the uptime in properly localized way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-17 15:35:28 +00:00

34 lines
769 B
C++

/*
** Copyright 2009, Adrien Destugues, pulkomandy@gmail.com.
** Distributed under the terms of the MIT License.
*/
/* This file holds various wrapper functions to interface easily between ICU
* and the Be API.
*/
#ifndef __ICU_WRAPPER_H__
#define __ICU_WRAPPER_H__
#include <String.h>
#include <unicode/bytestream.h>
#include <String.h>
/* Convert UnicodeString to BString needs an ICU ByteSink to do the work */
class BStringByteSink : public ByteSink {
public:
BStringByteSink(BString* dest) : dest_(dest) {}
virtual void Append(const char* data, int32_t n)
{ dest_->Append(data, n); }
private:
BString* dest_;
BStringByteSink();
BStringByteSink(const BStringByteSink &);
BStringByteSink &operator=(const BStringByteSink &);
};
#endif