juce_core.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. /*
  2. ==============================================================================
  3. This file is part of the juce_core module of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software Ltd.
  5. Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. or without fee is hereby granted, provided that the above copyright notice and this
  7. permission notice appear in all copies.
  8. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  9. TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  10. NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  11. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  12. IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. ------------------------------------------------------------------------------
  15. NOTE! This permissive ISC license applies ONLY to files within the juce_core module!
  16. All other JUCE modules are covered by a dual GPL/commercial license, so if you are
  17. using any other modules, be sure to check that you also comply with their license.
  18. For more details, visit www.juce.com
  19. ==============================================================================
  20. */
  21. #ifndef JUCE_CORE_H_INCLUDED
  22. #define JUCE_CORE_H_INCLUDED
  23. #ifndef JUCE_MODULE_AVAILABLE_juce_core
  24. /* If you fail to make sure that all your compile units are building JUCE with the same set of
  25. option flags, then there's a risk that different compile units will treat the classes as having
  26. different memory layouts, leading to very nasty memory corruption errors when they all get
  27. linked together. That's why it's best to always include the Introjucer-generated AppConfig.h
  28. file before any juce headers.
  29. Note that if you do have an AppConfig.h file and hit this warning, it means that it doesn't
  30. contain the JUCE_MODULE_AVAILABLE_xxx flags, which are necessary for some inter-module
  31. functionality to work correctly. In that case, you should either rebuild your AppConfig.h with
  32. the latest introjucer, or fix it manually to contain these flags.
  33. */
  34. #ifdef _MSC_VER
  35. #pragma message ("Have you included your AppConfig.h file before including the JUCE headers?")
  36. #else
  37. #warning "Have you included your AppConfig.h file before including the JUCE headers?"
  38. #endif
  39. #endif
  40. //==============================================================================
  41. #include "system/juce_TargetPlatform.h"
  42. //=============================================================================
  43. /** Config: JUCE_FORCE_DEBUG
  44. Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings,
  45. but if you define this value, you can override this to force it to be true or false.
  46. */
  47. #ifndef JUCE_FORCE_DEBUG
  48. //#define JUCE_FORCE_DEBUG 0
  49. #endif
  50. //=============================================================================
  51. /** Config: JUCE_LOG_ASSERTIONS
  52. If this flag is enabled, the jassert and jassertfalse macros will always use Logger::writeToLog()
  53. to write a message when an assertion happens.
  54. Enabling it will also leave this turned on in release builds. When it's disabled,
  55. however, the jassert and jassertfalse macros will not be compiled in a
  56. release build.
  57. @see jassert, jassertfalse, Logger
  58. */
  59. #ifndef JUCE_LOG_ASSERTIONS
  60. #if JUCE_ANDROID
  61. #define JUCE_LOG_ASSERTIONS 1
  62. #else
  63. #define JUCE_LOG_ASSERTIONS 0
  64. #endif
  65. #endif
  66. //=============================================================================
  67. /** Config: JUCE_CHECK_MEMORY_LEAKS
  68. Enables a memory-leak check for certain objects when the app terminates. See the LeakedObjectDetector
  69. class and the JUCE_LEAK_DETECTOR macro for more details about enabling leak checking for specific classes.
  70. */
  71. #if JUCE_DEBUG && ! defined (JUCE_CHECK_MEMORY_LEAKS)
  72. #define JUCE_CHECK_MEMORY_LEAKS 1
  73. #endif
  74. //=============================================================================
  75. /** Config: JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  76. In a Visual C++ build, this can be used to stop the required system libs being
  77. automatically added to the link stage.
  78. */
  79. #ifndef JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  80. #define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES 0
  81. #endif
  82. /** Config: JUCE_INCLUDE_ZLIB_CODE
  83. This can be used to disable Juce's embedded 3rd-party zlib code.
  84. You might need to tweak this if you're linking to an external zlib library in your app,
  85. but for normal apps, this option should be left alone.
  86. If you disable this, you might also want to set a value for JUCE_ZLIB_INCLUDE_PATH, to
  87. specify the path where your zlib headers live.
  88. */
  89. #ifndef JUCE_INCLUDE_ZLIB_CODE
  90. #define JUCE_INCLUDE_ZLIB_CODE 1
  91. #endif
  92. #ifndef JUCE_ZLIB_INCLUDE_PATH
  93. #define JUCE_ZLIB_INCLUDE_PATH <zlib.h>
  94. #endif
  95. /* Config: JUCE_CATCH_UNHANDLED_EXCEPTIONS
  96. If enabled, this will add some exception-catching code to forward unhandled exceptions
  97. to your JUCEApplicationBase::unhandledException() callback.
  98. */
  99. #ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS
  100. //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1
  101. #endif
  102. #ifndef JUCE_STRING_UTF_TYPE
  103. #define JUCE_STRING_UTF_TYPE 8
  104. #endif
  105. //=============================================================================
  106. //=============================================================================
  107. #if JUCE_MSVC
  108. #pragma warning (disable: 4251) // (DLL build warning, must be disabled before pushing the warning state)
  109. #pragma warning (push)
  110. #pragma warning (disable: 4786) // (long class name warning)
  111. #ifdef __INTEL_COMPILER
  112. #pragma warning (disable: 1125)
  113. #endif
  114. #endif
  115. #include "system/juce_StandardHeader.h"
  116. namespace juce
  117. {
  118. class StringRef;
  119. class MemoryBlock;
  120. class File;
  121. class InputStream;
  122. class OutputStream;
  123. class DynamicObject;
  124. class FileInputStream;
  125. class FileOutputStream;
  126. class XmlElement;
  127. class JSONFormatter;
  128. extern JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger();
  129. extern JUCE_API void JUCE_CALLTYPE logAssertion (const char* file, int line) noexcept;
  130. #include "memory/juce_Memory.h"
  131. #include "maths/juce_MathsFunctions.h"
  132. #include "memory/juce_ByteOrder.h"
  133. #include "memory/juce_Atomic.h"
  134. #include "text/juce_CharacterFunctions.h"
  135. #if JUCE_MSVC
  136. #pragma warning (push)
  137. #pragma warning (disable: 4514 4996)
  138. #endif
  139. #include "text/juce_CharPointer_UTF8.h"
  140. #include "text/juce_CharPointer_UTF16.h"
  141. #include "text/juce_CharPointer_UTF32.h"
  142. #include "text/juce_CharPointer_ASCII.h"
  143. #if JUCE_MSVC
  144. #pragma warning (pop)
  145. #endif
  146. #include "text/juce_String.h"
  147. #include "text/juce_StringRef.h"
  148. #include "logging/juce_Logger.h"
  149. #include "memory/juce_LeakedObjectDetector.h"
  150. #include "memory/juce_ContainerDeletePolicy.h"
  151. #include "memory/juce_HeapBlock.h"
  152. #include "memory/juce_MemoryBlock.h"
  153. #include "memory/juce_ReferenceCountedObject.h"
  154. #include "memory/juce_ScopedPointer.h"
  155. #include "memory/juce_OptionalScopedPointer.h"
  156. #include "memory/juce_Singleton.h"
  157. #include "memory/juce_WeakReference.h"
  158. #include "threads/juce_ScopedLock.h"
  159. #include "threads/juce_CriticalSection.h"
  160. #include "maths/juce_Range.h"
  161. #include "containers/juce_ElementComparator.h"
  162. #include "containers/juce_ArrayAllocationBase.h"
  163. #include "containers/juce_Array.h"
  164. #include "containers/juce_LinkedListPointer.h"
  165. #include "containers/juce_OwnedArray.h"
  166. #include "containers/juce_ReferenceCountedArray.h"
  167. #include "containers/juce_ScopedValueSetter.h"
  168. #include "containers/juce_SortedSet.h"
  169. #include "containers/juce_SparseSet.h"
  170. #include "containers/juce_AbstractFifo.h"
  171. #include "text/juce_NewLine.h"
  172. #include "text/juce_StringPool.h"
  173. #include "text/juce_Identifier.h"
  174. #include "text/juce_StringArray.h"
  175. #include "text/juce_StringPairArray.h"
  176. #include "text/juce_TextDiff.h"
  177. #include "text/juce_LocalisedStrings.h"
  178. #include "misc/juce_Result.h"
  179. #include "containers/juce_Variant.h"
  180. #include "containers/juce_NamedValueSet.h"
  181. #include "containers/juce_DynamicObject.h"
  182. #include "containers/juce_HashMap.h"
  183. #include "time/juce_RelativeTime.h"
  184. #include "time/juce_Time.h"
  185. #include "streams/juce_InputStream.h"
  186. #include "streams/juce_OutputStream.h"
  187. #include "streams/juce_BufferedInputStream.h"
  188. #include "streams/juce_MemoryInputStream.h"
  189. #include "streams/juce_MemoryOutputStream.h"
  190. #include "streams/juce_SubregionStream.h"
  191. #include "streams/juce_InputSource.h"
  192. #include "files/juce_File.h"
  193. #include "files/juce_DirectoryIterator.h"
  194. #include "files/juce_FileInputStream.h"
  195. #include "files/juce_FileOutputStream.h"
  196. #include "files/juce_FileSearchPath.h"
  197. #include "files/juce_MemoryMappedFile.h"
  198. #include "files/juce_TemporaryFile.h"
  199. #include "files/juce_FileFilter.h"
  200. #include "files/juce_WildcardFileFilter.h"
  201. #include "streams/juce_FileInputSource.h"
  202. #include "logging/juce_FileLogger.h"
  203. #include "javascript/juce_JSON.h"
  204. #include "javascript/juce_Javascript.h"
  205. #include "maths/juce_BigInteger.h"
  206. #include "maths/juce_Expression.h"
  207. #include "maths/juce_Random.h"
  208. #include "misc/juce_Uuid.h"
  209. #include "misc/juce_WindowsRegistry.h"
  210. #include "system/juce_PlatformDefs.h"
  211. #include "system/juce_SystemStats.h"
  212. #include "threads/juce_ChildProcess.h"
  213. #include "threads/juce_DynamicLibrary.h"
  214. #include "threads/juce_HighResolutionTimer.h"
  215. #include "threads/juce_InterProcessLock.h"
  216. #include "threads/juce_Process.h"
  217. #include "threads/juce_SpinLock.h"
  218. #include "threads/juce_WaitableEvent.h"
  219. #include "threads/juce_Thread.h"
  220. #include "threads/juce_ThreadLocalValue.h"
  221. #include "threads/juce_ThreadPool.h"
  222. #include "threads/juce_TimeSliceThread.h"
  223. #include "threads/juce_ReadWriteLock.h"
  224. #include "threads/juce_ScopedReadLock.h"
  225. #include "threads/juce_ScopedWriteLock.h"
  226. #include "network/juce_IPAddress.h"
  227. #include "network/juce_MACAddress.h"
  228. #include "network/juce_NamedPipe.h"
  229. #include "network/juce_Socket.h"
  230. #include "network/juce_URL.h"
  231. #include "time/juce_PerformanceCounter.h"
  232. #include "unit_tests/juce_UnitTest.h"
  233. #include "xml/juce_XmlDocument.h"
  234. #include "xml/juce_XmlElement.h"
  235. #include "zip/juce_GZIPCompressorOutputStream.h"
  236. #include "zip/juce_GZIPDecompressorInputStream.h"
  237. #include "zip/juce_ZipFile.h"
  238. #include "containers/juce_PropertySet.h"
  239. #include "memory/juce_SharedResourcePointer.h"
  240. }
  241. #if JUCE_MSVC
  242. #pragma warning (pop)
  243. #endif
  244. #endif // JUCE_CORE_H_INCLUDED