OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> | 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // More bytes are coming, don't flush the codec. | 59 // More bytes are coming, don't flush the codec. |
60 DoNotFlush = 0, | 60 DoNotFlush = 0, |
61 | 61 |
62 // A fetch has hit EOF. Some codecs handle fetches differently, for compat r
easons. | 62 // A fetch has hit EOF. Some codecs handle fetches differently, for compat r
easons. |
63 FetchEOF, | 63 FetchEOF, |
64 | 64 |
65 // Do a full flush of the codec. | 65 // Do a full flush of the codec. |
66 DataEOF | 66 DataEOF |
67 }; | 67 }; |
68 | 68 |
69 COMPILE_ASSERT(!DoNotFlush, DoNotFlush_is_falsy); | 69 static_assert(!DoNotFlush, "DoNotFlush should be falsy"); |
70 COMPILE_ASSERT(FetchEOF, FetchEOF_is_truthy); | 70 static_assert(FetchEOF, "FetchEOF should be truthy"); |
71 COMPILE_ASSERT(DataEOF, DataEOF_is_truthy); | 71 static_assert(DataEOF, "DataEOF should be truthy"); |
72 | 72 |
73 | 73 |
74 class TextCodec { | 74 class TextCodec { |
75 WTF_MAKE_NONCOPYABLE(TextCodec); WTF_MAKE_FAST_ALLOCATED; | 75 WTF_MAKE_NONCOPYABLE(TextCodec); WTF_MAKE_FAST_ALLOCATED; |
76 public: | 76 public: |
77 TextCodec() { } | 77 TextCodec() { } |
78 virtual ~TextCodec(); | 78 virtual ~TextCodec(); |
79 | 79 |
80 String decode(const char* str, size_t length, FlushBehavior flush = DoNotFlu
sh) | 80 String decode(const char* str, size_t length, FlushBehavior flush = DoNotFlu
sh) |
81 { | 81 { |
(...skipping 14 matching lines...) Expand all Loading... |
96 typedef void (*EncodingNameRegistrar)(const char* alias, const char* name); | 96 typedef void (*EncodingNameRegistrar)(const char* alias, const char* name); |
97 | 97 |
98 typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const
void* additionalData); | 98 typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const
void* additionalData); |
99 typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const
void* additionalData); | 99 typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const
void* additionalData); |
100 | 100 |
101 } // namespace WTF | 101 } // namespace WTF |
102 | 102 |
103 using WTF::TextCodec; | 103 using WTF::TextCodec; |
104 | 104 |
105 #endif // TextCodec_h | 105 #endif // TextCodec_h |
OLD | NEW |