diff --git a/intl/Encoding.h b/intl/Encoding.h index e478a9b752a3..56f25bcf854a 100644 --- a/intl/Encoding.h +++ b/intl/Encoding.h @@ -645,10 +645,7 @@ class Encoding final { * BOM sniffing may cause the returned decoder to morph into a decoder * for UTF-8, UTF-16LE or UTF-16BE instead of this encoding. */ - inline UniquePtr NewDecoder() const { - UniquePtr decoder(encoding_new_decoder(this)); - return decoder; - } + UniquePtr NewDecoder() const; /** * Instantiates a new decoder for this encoding with BOM sniffing enabled @@ -670,10 +667,7 @@ class Encoding final { * (potentially malformed) input to the decoding algorithm for this * encoding. */ - inline UniquePtr NewDecoderWithBOMRemoval() const { - UniquePtr decoder(encoding_new_decoder_with_bom_removal(this)); - return decoder; - } + UniquePtr NewDecoderWithBOMRemoval() const; /** * Instantiates a new decoder for this encoding with BOM removal @@ -700,10 +694,7 @@ class Encoding final { * removed the BOM, the caller should use `NewDecoderWithBOMRemoval()` * instead of this method to cause the BOM to be removed. */ - inline UniquePtr NewDecoderWithoutBOMHandling() const { - UniquePtr decoder(encoding_new_decoder_without_bom_handling(this)); - return decoder; - } + UniquePtr NewDecoderWithoutBOMHandling() const; /** * Instantiates a new decoder for this encoding with BOM handling disabled @@ -724,10 +715,7 @@ class Encoding final { /** * Instantiates a new encoder for the output encoding of this encoding. */ - inline UniquePtr NewEncoder() const { - UniquePtr encoder(encoding_new_encoder(this)); - return encoder; - } + UniquePtr NewEncoder() const; /** * Instantiates a new encoder for the output encoding of this encoding @@ -1345,6 +1333,26 @@ class Encoder final { Encoder& operator=(const Encoder&) = delete; }; +inline UniquePtr Encoding::NewDecoder() const { + UniquePtr decoder(encoding_new_decoder(this)); + return decoder; +} + +inline UniquePtr Encoding::NewDecoderWithBOMRemoval() const { + UniquePtr decoder(encoding_new_decoder_with_bom_removal(this)); + return decoder; +} + +inline UniquePtr Encoding::NewDecoderWithoutBOMHandling() const { + UniquePtr decoder(encoding_new_decoder_without_bom_handling(this)); + return decoder; +} + +inline UniquePtr Encoding::NewEncoder() const { + UniquePtr encoder(encoding_new_encoder(this)); + return encoder; +} + }; // namespace mozilla #endif // mozilla_Encoding_h