openshot-audio  0.1.7
juce_OutputStream.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the juce_core module of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission to use, copy, modify, and/or distribute this software for any purpose with
8  or without fee is hereby granted, provided that the above copyright notice and this
9  permission notice appear in all copies.
10 
11  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
12  TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
13  NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
15  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 
18  ------------------------------------------------------------------------------
19 
20  NOTE! This permissive ISC license applies ONLY to files within the juce_core module!
21  All other JUCE modules are covered by a dual GPL/commercial license, so if you are
22  using any other modules, be sure to check that you also comply with their license.
23 
24  For more details, visit www.juce.com
25 
26  ==============================================================================
27 */
28 
29 #ifndef JUCE_OUTPUTSTREAM_H_INCLUDED
30 #define JUCE_OUTPUTSTREAM_H_INCLUDED
31 
32 
33 //==============================================================================
43 {
44 protected:
45  //==============================================================================
46  OutputStream();
47 
48 public:
54  virtual ~OutputStream();
55 
56  //==============================================================================
59  virtual void flush() = 0;
60 
68  virtual bool setPosition (int64 newPosition) = 0;
69 
74  virtual int64 getPosition() = 0;
75 
76  //==============================================================================
87  virtual bool write (const void* dataToWrite,
88  size_t numberOfBytes) = 0;
89 
90  //==============================================================================
95  virtual bool writeByte (char byte);
96 
102  virtual bool writeBool (bool boolValue);
103 
109  virtual bool writeShort (short value);
110 
116  virtual bool writeShortBigEndian (short value);
117 
122  virtual bool writeInt (int value);
123 
128  virtual bool writeIntBigEndian (int value);
129 
134  virtual bool writeInt64 (int64 value);
135 
140  virtual bool writeInt64BigEndian (int64 value);
141 
147  virtual bool writeFloat (float value);
148 
154  virtual bool writeFloatBigEndian (float value);
155 
161  virtual bool writeDouble (double value);
162 
168  virtual bool writeDoubleBigEndian (double value);
169 
173  virtual bool writeRepeatedByte (uint8 byte, size_t numTimesToRepeat);
174 
186  virtual bool writeCompressedInt (int value);
187 
201  virtual bool writeString (const String& text);
202 
212  virtual bool writeText (const String& text,
213  bool asUTF16,
214  bool writeUTF16ByteOrderMark);
215 
224  virtual int64 writeFromInputStream (InputStream& source, int64 maxNumBytesToWrite);
225 
226  //==============================================================================
231  void setNewLineString (const String& newLineString);
232 
234  const String& getNewLineString() const noexcept { return newLineString; }
235 
236 private:
237  //==============================================================================
238  String newLineString;
239 
241 };
242 
243 //==============================================================================
246 
249 
252 
255 
257 JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const char* text);
258 
261 
263 JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const File& fileToRead);
264 
267 
276 
277 
278 #endif // JUCE_OUTPUTSTREAM_H_INCLUDED
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_MemoryBlock.h:38
Definition: juce_InputStream.h:41
#define JUCE_CALLTYPE
Definition: juce_PlatformDefs.h:50
Definition: juce_String.h:43
JUCE_API OutputStream &JUCE_CALLTYPE operator<<(OutputStream &stream, int number)
Definition: juce_OutputStream.cpp:295
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_NewLine.h:44
#define const
Definition: juce_OutputStream.h:42
long long int64
Definition: juce_MathsFunctions.h:60
const String & getNewLineString() const noexcept
Definition: juce_OutputStream.h:234
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
JSAMPIMAGE data
Definition: jpeglib.h:945
Definition: juce_File.h:45
unsigned char uint8
Definition: juce_MathsFunctions.h:43