2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-10 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCER_CODEUTILITIES_H_B86AA5D2__
27 #define __JUCER_CODEUTILITIES_H_B86AA5D2__
30 //==============================================================================
33 const String
indent (const String
& code
, const int numSpaces
, bool indentFirstLine
);
34 const String
makeValidIdentifier (String s
, bool capitalise
, bool removeColons
, bool allowTemplates
);
35 const String
addEscapeChars (const String
& text
);
36 const String
createIncludeStatement (const File
& includeFile
, const File
& targetFile
);
37 const String
makeHeaderGuardName (const File
& file
);
38 const String
makeBinaryDataIdentifierName (const File
& file
);
40 const String
stringLiteral (const String
& text
);
41 const String
stringLiteralIfNotEmpty (const String
& text
); // if the string's empty, this returns an empty string
42 const String
boolLiteral (bool b
);
43 const String
floatLiteral (float v
);
44 const String
doubleLiteral (double v
);
46 const String
colourToCode (const Colour
& col
);
47 const String
justificationToCode (const Justification
& justification
);
48 const String
castToFloat (const String
& expression
);
49 const String
castToInt (const String
& expression
);
50 const String
fontToCode (const Font
& font
);
51 const String
alignFunctionCallParams (const String
& call
, const StringArray
& parameters
, int maxLineLength
);
53 void writeDataAsCppLiteral (const MemoryBlock
& data
, OutputStream
& out
);
55 void createStringMatcher (OutputStream
& out
, const String
& utf8PointerVariable
,
56 const StringArray
& strings
, const StringArray
& codeToExecute
, const int indentLevel
);
61 #endif // __JUCER_CODEUTILITIES_H_B86AA5D2__