Browse Source

Minor string literal tidy-ups.

tags/2021-05-28
Julian Storer 16 years ago
parent
commit
841a6665bd
100 changed files with 1828 additions and 1871 deletions
  1. +1
    -1
      extras/Jucer (experimental)/Source/jucer_Main.cpp
  2. +1
    -1
      extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp
  3. +3
    -3
      extras/Jucer (experimental)/Source/model/jucer_Project.cpp
  4. +27
    -27
      extras/Jucer (experimental)/Source/model/jucer_ProjectExport_XCode.h
  5. +2
    -2
      extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h
  6. +1
    -1
      extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp
  7. +3
    -3
      extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp
  8. +14
    -14
      extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp
  9. +1
    -1
      extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp
  10. +18
    -18
      extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp
  11. +1
    -1
      extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h
  12. +6
    -6
      extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h
  13. +6
    -6
      extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp
  14. +29
    -29
      extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp
  15. +1022
    -1049
      juce_amalgamated.cpp
  16. +21
    -21
      juce_amalgamated.h
  17. +1
    -1
      src/application/juce_Application.cpp
  18. +2
    -2
      src/application/juce_Application.h
  19. +2
    -2
      src/application/juce_ApplicationCommandInfo.h
  20. +1
    -1
      src/audio/audio_file_formats/juce_AudioCDReader.cpp
  21. +6
    -6
      src/audio/audio_file_formats/juce_AudioFormatManager.cpp
  22. +1
    -1
      src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp
  23. +8
    -8
      src/audio/audio_sources/juce_ChannelRemappingAudioSource.cpp
  24. +15
    -15
      src/audio/devices/juce_AudioDeviceManager.cpp
  25. +2
    -2
      src/audio/devices/juce_AudioDeviceManager.h
  26. +1
    -1
      src/audio/devices/juce_AudioIODeviceType.cpp
  27. +1
    -1
      src/audio/devices/juce_AudioIODeviceType.h
  28. +3
    -3
      src/audio/dsp/juce_IIRFilter.cpp
  29. +3
    -3
      src/audio/dsp/juce_IIRFilter.h
  30. +12
    -12
      src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm
  31. +8
    -8
      src/audio/plugins/formats/juce_VSTPluginFormat.cpp
  32. +9
    -9
      src/audio/plugins/juce_KnownPluginList.cpp
  33. +27
    -27
      src/audio/plugins/juce_PluginDescription.cpp
  34. +5
    -5
      src/containers/juce_BitArray.cpp
  35. +8
    -8
      src/containers/juce_MemoryBlock.cpp
  36. +8
    -8
      src/containers/juce_PropertySet.cpp
  37. +1
    -1
      src/containers/juce_Variant.cpp
  38. +1
    -1
      src/core/juce_FileLogger.cpp
  39. +1
    -1
      src/core/juce_RelativeTime.cpp
  40. +1
    -1
      src/core/juce_RelativeTime.h
  41. +6
    -6
      src/core/juce_Uuid.cpp
  42. +1
    -1
      src/cryptography/juce_RSAKey.cpp
  43. +63
    -63
      src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp
  44. +9
    -9
      src/gui/components/code_editor/juce_CodeDocument.cpp
  45. +13
    -13
      src/gui/components/code_editor/juce_CodeEditorComponent.cpp
  46. +1
    -1
      src/gui/components/controls/juce_ListBox.cpp
  47. +1
    -1
      src/gui/components/controls/juce_ProgressBar.cpp
  48. +1
    -1
      src/gui/components/controls/juce_Slider.cpp
  49. +19
    -19
      src/gui/components/controls/juce_TextEditor.cpp
  50. +2
    -2
      src/gui/components/controls/juce_Toolbar.cpp
  51. +11
    -11
      src/gui/components/controls/juce_TreeView.cpp
  52. +3
    -3
      src/gui/components/filebrowser/juce_DirectoryContentsList.cpp
  53. +2
    -2
      src/gui/components/filebrowser/juce_FileBrowserComponent.cpp
  54. +1
    -1
      src/gui/components/filebrowser/juce_FileChooser.cpp
  55. +3
    -3
      src/gui/components/filebrowser/juce_FileChooserDialogBox.cpp
  56. +3
    -3
      src/gui/components/filebrowser/juce_FileChooserDialogBox.h
  57. +1
    -1
      src/gui/components/filebrowser/juce_FileListComponent.cpp
  58. +2
    -2
      src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp
  59. +1
    -1
      src/gui/components/filebrowser/juce_FileTreeComponent.cpp
  60. +2
    -2
      src/gui/components/filebrowser/juce_FilenameComponent.cpp
  61. +4
    -4
      src/gui/components/filebrowser/juce_WildcardFileFilter.cpp
  62. +1
    -1
      src/gui/components/juce_Component.cpp
  63. +1
    -1
      src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp
  64. +56
    -53
      src/gui/components/keyboard/juce_KeyPress.cpp
  65. +14
    -14
      src/gui/components/keyboard/juce_KeyPressMappingSet.cpp
  66. +3
    -10
      src/gui/components/lookandfeel/juce_LookAndFeel.cpp
  67. +1
    -1
      src/gui/components/menus/juce_PopupMenu.cpp
  68. +5
    -5
      src/gui/components/properties/juce_PropertyPanel.cpp
  69. +4
    -4
      src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp
  70. +1
    -1
      src/gui/components/special/juce_ColourSelector.cpp
  71. +3
    -10
      src/gui/components/special/juce_DropShadower.cpp
  72. +3
    -3
      src/gui/components/windows/juce_AlertWindow.cpp
  73. +1
    -1
      src/gui/components/windows/juce_DocumentWindow.cpp
  74. +1
    -1
      src/gui/components/windows/juce_SplashScreen.h
  75. +2
    -2
      src/gui/components/windows/juce_ThreadWithProgressWindow.h
  76. +1
    -1
      src/gui/graphics/drawables/juce_Drawable.cpp
  77. +1
    -1
      src/gui/graphics/drawables/juce_DrawableComposite.cpp
  78. +1
    -1
      src/gui/graphics/drawables/juce_DrawableImage.cpp
  79. +9
    -9
      src/gui/graphics/drawables/juce_DrawablePath.cpp
  80. +1
    -1
      src/gui/graphics/drawables/juce_DrawableText.cpp
  81. +143
    -143
      src/gui/graphics/drawables/juce_SVGParser.cpp
  82. +22
    -20
      src/gui/graphics/fonts/juce_Font.cpp
  83. +2
    -2
      src/gui/graphics/fonts/juce_Font.h
  84. +10
    -10
      src/gui/graphics/fonts/juce_GlyphArrangement.cpp
  85. +2
    -2
      src/gui/graphics/fonts/juce_TextLayout.cpp
  86. +15
    -15
      src/gui/graphics/geometry/juce_Path.cpp
  87. +17
    -17
      src/gui/graphics/geometry/juce_PositionedRectangle.cpp
  88. +1
    -1
      src/gui/graphics/geometry/juce_Rectangle.h
  89. +2
    -3
      src/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp
  90. +3
    -3
      src/gui/graphics/imaging/juce_ImageFileFormat.cpp
  91. +1
    -1
      src/io/files/juce_DirectoryIterator.cpp
  92. +1
    -1
      src/io/files/juce_DirectoryIterator.h
  93. +30
    -30
      src/io/files/juce_File.cpp
  94. +2
    -2
      src/io/files/juce_File.h
  95. +3
    -3
      src/io/files/juce_FileSearchPath.cpp
  96. +1
    -1
      src/io/files/juce_FileSearchPath.h
  97. +3
    -3
      src/io/files/juce_TemporaryFile.cpp
  98. +1
    -1
      src/io/files/juce_ZipFile.cpp
  99. +2
    -2
      src/io/network/juce_Socket.cpp
  100. +26
    -32
      src/io/network/juce_URL.cpp

+ 1
- 1
extras/Jucer (experimental)/Source/jucer_Main.cpp View File

@@ -53,7 +53,7 @@ public:
ImageCache::setCacheTimeout (30 * 1000);
if (commandLine.trim().isNotEmpty()
&& ! commandLine.trim().startsWithChar (T('-')))
&& ! commandLine.trim().startsWithChar ('-'))
anotherInstanceStarted (commandLine);
theMainWindow->reloadLastProject();


+ 1
- 1
extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp View File

@@ -220,7 +220,7 @@ void NewFileWizard::showFailedToWriteMessage (const File& file)
const File NewFileWizard::askUserToChooseNewFile (const String& suggestedFilename, const String& wildcard,
const Project::Item& projectGroupToAddTo)
{
FileChooser fc (T("Select File to Create"),
FileChooser fc ("Select File to Create",
projectGroupToAddTo.determineGroupFolder()
.getChildFile (suggestedFilename)
.getNonexistentSibling(),


+ 3
- 3
extras/Jucer (experimental)/Source/model/jucer_Project.cpp View File

@@ -417,7 +417,7 @@ Project::Item Project::createNewItem (const File& file)
Item item (*this, ValueTree (Tags::file));
item.createUIDIfMissing();
item.getName() = file.getFileName();
item.getShouldCompileValue() = file.hasFileExtension (T("cpp;mm;c;m"));
item.getShouldCompileValue() = file.hasFileExtension ("cpp;mm;c;m");
item.getShouldAddToResourceValue() = shouldBeAddedToBinaryResourcesByDefault (file);
return item;
}
@@ -845,7 +845,7 @@ void Project::BuildConfiguration::createPropertyEditors (Array <PropertyComponen
const StringArray Project::BuildConfiguration::parsePreprocessorDefs() const
{
StringArray defines;
defines.addTokens (getPreprocessorDefs().toString(), T(" ,;"), String::empty);
defines.addTokens (getPreprocessorDefs().toString(), " ,;", String::empty);
defines.removeEmptyStrings (true);
return defines;
}
@@ -853,7 +853,7 @@ const StringArray Project::BuildConfiguration::parsePreprocessorDefs() const
const StringArray Project::BuildConfiguration::getHeaderSearchPaths() const
{
StringArray s;
s.addTokens (getHeaderSearchPath().toString(), T(";"), String::empty);
s.addTokens (getHeaderSearchPath().toString(), ";", String::empty);
return s;
}


+ 27
- 27
extras/Jucer (experimental)/Source/model/jucer_ProjectExport_XCode.h View File

@@ -136,7 +136,7 @@ private:
static const String sanitisePath (const String& path)
{
if (path.startsWithChar (T('~')))
if (path.startsWithChar ('~'))
return "$(HOME)" + path.substring (1);
return path;
@@ -211,7 +211,7 @@ private:
if (! hasPList())
return true;
XmlElement plist (T("plist"));
XmlElement plist ("plist");
XmlElement* dict = plist.createNewChildElement ("dict");
addPlistDictionaryKey (dict, "CFBundleExecutable", "${EXECUTABLE_NAME}");
@@ -303,7 +303,7 @@ private:
void getLinkerFlagsForStaticLibrary (const RelativePath& library, StringArray& flags, StringArray& librarySearchPaths)
{
jassert (library.getFileNameWithoutExtension().substring (0, 3) == T("lib"));
jassert (library.getFileNameWithoutExtension().substring (0, 3) == "lib");
flags.add ("-l" + library.getFileNameWithoutExtension().substring (3));
@@ -433,7 +433,7 @@ private:
getLinkerFlags (config, linkerFlags, librarySearchPaths);
if (linkerFlags.size() > 0)
settings.add ("OTHER_LDFLAGS = \"" + linkerFlags.joinIntoString (T(" ")) + "\"");
settings.add ("OTHER_LDFLAGS = \"" + linkerFlags.joinIntoString (" ") + "\"");
if (librarySearchPaths.size() > 0)
{
@@ -489,19 +489,19 @@ private:
if (iPhone)
{
s.addTokens (T("UIKit Foundation CoreGraphics AudioToolbox"), false);
s.addTokens ("UIKit Foundation CoreGraphics AudioToolbox", false);
if ((int) project.getJuceConfigFlag ("JUCE_OPENGL").getValue() == 1)
s.addTokens (T("QuartzCore OpenGLES"), false);
s.addTokens ("QuartzCore OpenGLES", false);
}
else
{
s.addTokens (T("Cocoa Carbon IOKit CoreAudio CoreMIDI WebKit DiscRecording OpenGL QuartzCore QTKit QuickTime"), false);
s.addTokens ("Cocoa Carbon IOKit CoreAudio CoreMIDI WebKit DiscRecording OpenGL QuartzCore QTKit QuickTime", false);
if (isAU())
s.addTokens (T("AudioUnit CoreAudioKit AudioToolbox"), false);
s.addTokens ("AudioUnit CoreAudioKit AudioToolbox", false);
else if ((int) project.getJuceConfigFlag ("JUCE_PLUGINHOST_AU").getValue() == 1)
s.addTokens (T("AudioUnit CoreAudioKit"), false);
s.addTokens ("AudioUnit CoreAudioKit", false);
}
for (int i = 0; i < s.size(); ++i)
@@ -536,8 +536,8 @@ private:
String val (o.getProperty (name).toString());
if (val.isEmpty() || (val.containsAnyOf (T(" \t;<>()=,-\r\n"))
&& ! (val.trimStart().startsWithChar (T('('))
|| val.trimStart().startsWithChar (T('{')))))
&& ! (val.trimStart().startsWithChar ('(')
|| val.trimStart().startsWithChar ('{'))))
val = val.quoted();
output << name.name << " = " << val << "; ";
@@ -602,20 +602,20 @@ private:
static const String getFileType (const RelativePath& file)
{
if (file.hasFileExtension (T(".cpp"))) return "sourcecode.cpp.cpp";
else if (file.hasFileExtension (T(".mm"))) return "sourcecode.cpp.objcpp";
else if (file.hasFileExtension (T(".m"))) return "sourcecode.c.objc";
else if (file.hasFileExtension (T(".h;.hpp"))) return "sourcecode.c.h";
else if (file.hasFileExtension (T(".framework"))) return "wrapper.framework";
else if (file.hasFileExtension (T(".jpeg;.jpg"))) return "image.jpeg";
else if (file.hasFileExtension (T("png;gif"))) return "image" + file.getFileExtension();
else if (file.hasFileExtension (T("html;htm"))) return "text.html";
else if (file.hasFileExtension (T("txt;rtf"))) return "text" + file.getFileExtension();
else if (file.hasFileExtension (T("plist"))) return "text.plist.xml";
else if (file.hasFileExtension (T("app"))) return "wrapper.application";
else if (file.hasFileExtension (T("component;vst;plugin"))) return "wrapper.cfbundle";
else if (file.hasFileExtension (T("xcodeproj"))) return "wrapper.pb-project";
else if (file.hasFileExtension (T("a"))) return "archive.ar";
if (file.hasFileExtension (".cpp")) return "sourcecode.cpp.cpp";
else if (file.hasFileExtension (".mm")) return "sourcecode.cpp.objcpp";
else if (file.hasFileExtension (".m")) return "sourcecode.c.objc";
else if (file.hasFileExtension (".h;.hpp")) return "sourcecode.c.h";
else if (file.hasFileExtension (".framework")) return "wrapper.framework";
else if (file.hasFileExtension (".jpeg;.jpg")) return "image.jpeg";
else if (file.hasFileExtension ("png;gif")) return "image" + file.getFileExtension();
else if (file.hasFileExtension ("html;htm")) return "text.html";
else if (file.hasFileExtension ("txt;rtf")) return "text" + file.getFileExtension();
else if (file.hasFileExtension ("plist")) return "text.plist.xml";
else if (file.hasFileExtension ("app")) return "wrapper.application";
else if (file.hasFileExtension ("component;vst;plugin")) return "wrapper.cfbundle";
else if (file.hasFileExtension ("xcodeproj")) return "wrapper.pb-project";
else if (file.hasFileExtension ("a")) return "archive.ar";
return "file" + file.getFileExtension();
}
@@ -869,7 +869,7 @@ private:
return " ";
return "\n\t\t\t\t" + list.joinIntoString (separator + "\n\t\t\t\t")
+ (separator == T(";") ? separator : String::empty);
+ (separator == ";" ? separator : String::empty);
}
const String createID (const RelativePath& path) const
@@ -896,7 +896,7 @@ private:
bool shouldFileBeCompiledByDefault (const RelativePath& file) const
{
return file.hasFileExtension (T("cpp;mm;c;m"));
return file.hasFileExtension ("cpp;mm;c;m");
}
//==============================================================================


+ 2
- 2
extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h View File

@@ -296,7 +296,7 @@ private:
static int countMaxPluginChannels (const String& configString, bool isInput)
{
StringArray configs;
configs.addTokens (configString, T(", {}"), String::empty);
configs.addTokens (configString, ", {}", String::empty);
configs.trim();
configs.removeEmptyStrings();
jassert ((configs.size() & 1) == 0); // looks like a syntax error in the configs?
@@ -311,7 +311,7 @@ private:
static const String createVersionCode (const String& version)
{
StringArray configs;
configs.addTokens (version, T(",."), String::empty);
configs.addTokens (version, ",.", String::empty);
configs.trim();
configs.removeEmptyStrings();


+ 1
- 1
extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp View File

@@ -44,7 +44,7 @@ ResourceFile::~ResourceFile()
bool ResourceFile::isResourceFile (const File& file)
{
if (file.hasFileExtension (T("cpp;h")))
if (file.hasFileExtension ("cpp;h"))
{
ScopedPointer <InputStream> in (file.createInputStream());


+ 3
- 3
extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp View File

@@ -82,21 +82,21 @@ void DocumentEditorComponent::getCommandInfo (const CommandID commandID, Applica
result.setInfo ("Save" + name,
"Saves the current document",
CommandCategories::general, 0);
result.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier, 0));
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier, 0));
break;
case CommandIDs::saveDocumentAs:
result.setInfo ("Save" + name + " As...",
"Saves the current document to a different filename",
CommandCategories::general, 0);
result.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
case CommandIDs::closeDocument:
result.setInfo ("Close" + name,
"Closes the current document",
CommandCategories::general, 0);
result.defaultKeypresses.add (KeyPress (T('w'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
default:


+ 14
- 14
extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp View File

@@ -273,7 +273,7 @@ const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex,
PopupMenu recentFiles;
StoredSettings::getInstance()->recentFiles.createPopupMenuItems (recentFiles, 100, true, true);
menu.addSubMenu (T("Open recent file"), recentFiles);
menu.addSubMenu ("Open recent file", recentFiles);
menu.addSeparator();
menu.addCommandItem (commandManager, CommandIDs::closeDocument);
@@ -415,36 +415,36 @@ void MainWindow::getCommandInfo (const CommandID commandID, ApplicationCommandIn
switch (commandID)
{
case CommandIDs::newProject:
result.setInfo (T("New Project..."),
T("Creates a new Jucer project"),
result.setInfo ("New Project...",
"Creates a new Jucer project",
CommandCategories::general, 0);
result.defaultKeypresses.add (KeyPress (T('o'), ModifierKeys::commandModifier, 0));
result.defaultKeypresses.add (KeyPress ('o', ModifierKeys::commandModifier, 0));
break;
case CommandIDs::open:
result.setInfo (T("Open..."),
T("Opens a Jucer project"),
result.setInfo ("Open...",
"Opens a Jucer project",
CommandCategories::general, 0);
result.defaultKeypresses.add (KeyPress (T('o'), ModifierKeys::commandModifier, 0));
result.defaultKeypresses.add (KeyPress ('o', ModifierKeys::commandModifier, 0));
break;
case CommandIDs::showPrefs:
result.setInfo (T("Preferences..."),
T("Shows the preferences panel."),
result.setInfo ("Preferences...",
"Shows the preferences panel.",
CommandCategories::general, 0);
result.defaultKeypresses.add (KeyPress (T(','), ModifierKeys::commandModifier, 0));
result.defaultKeypresses.add (KeyPress (',', ModifierKeys::commandModifier, 0));
break;
case CommandIDs::closeAllDocuments:
result.setInfo (T("Close All Documents"),
T("Closes all open documents"),
result.setInfo ("Close All Documents",
"Closes all open documents",
CommandCategories::general, 0);
result.setActive (OpenDocumentManager::getInstance()->getNumOpenDocuments() > 0);
break;
case CommandIDs::saveAll:
result.setInfo (T("Save All"),
T("Saves all open documents"),
result.setInfo ("Save All",
"Saves all open documents",
CommandCategories::general, 0);
result.setActive (OpenDocumentManager::getInstance()->anyFilesNeedSaving());
break;


+ 1
- 1
extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp View File

@@ -270,7 +270,7 @@ FileBasedDocument::SaveResult OpenDocumentManager::saveIfNeededAndUserAgrees (Op
const int r = AlertWindow::showYesNoCancelBox (AlertWindow::QuestionIcon,
TRANS("Closing document..."),
TRANS("Do you want to save the changes to \"")
+ doc->getName() + T("\"?"),
+ doc->getName() + "\"?",
TRANS("save"),
TRANS("discard changes"),
TRANS("cancel"));


+ 18
- 18
extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp View File

@@ -204,53 +204,53 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica
switch (commandID)
{
case CommandIDs::saveProject:
result.setInfo (T("Save Project"),
T("Saves the current project"),
result.setInfo ("Save Project",
"Saves the current project",
CommandCategories::general, 0);
result.setActive (project != 0);
result.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier, 0));
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier, 0));
break;
case CommandIDs::saveProjectAs:
result.setInfo (T("Save Project As..."),
T("Saves the current project to a different filename"),
result.setInfo ("Save Project As...",
"Saves the current project to a different filename",
CommandCategories::general, 0);
result.setActive (project != 0);
result.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
case CommandIDs::closeProject:
result.setInfo (T("Close Project"),
T("Closes the current project"),
result.setInfo ("Close Project",
"Closes the current project",
CommandCategories::general, 0);
result.setActive (project != 0);
result.defaultKeypresses.add (KeyPress (T('w'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
case CommandIDs::openProjectInIDE:
#if JUCE_MAC
result.setInfo (T("Save Project and Open in XCode..."),
result.setInfo ("Save Project and Open in XCode...",
#elif JUCE_WINDOWS
result.setInfo (T("Save Project and Open in Visual Studio..."),
result.setInfo ("Save Project and Open in Visual Studio...",
#else
result.setInfo (T("Save Project and Open as a Makefile..."),
result.setInfo ("Save Project and Open as a Makefile...",
#endif
T("Saves the project and launches it in an external IDE"),
"Saves the project and launches it in an external IDE",
CommandCategories::general, 0);
result.setActive (project != 0);
result.defaultKeypresses.add (KeyPress (T('l'), ModifierKeys::commandModifier, 0));
result.defaultKeypresses.add (KeyPress ('l', ModifierKeys::commandModifier, 0));
break;
case CommandIDs::showProjectSettings:
result.setInfo (T("Show Project Build Settings"),
T("Shows the build options for the project"),
result.setInfo ("Show Project Build Settings",
"Shows the build options for the project",
CommandCategories::general, 0);
result.setActive (project != 0);
result.defaultKeypresses.add (KeyPress (T('i'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
result.defaultKeypresses.add (KeyPress ('i', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
case StandardApplicationCommandIDs::del:
result.setInfo (T("Delete"), String::empty, CommandCategories::general, 0);
result.setInfo ("Delete", String::empty, CommandCategories::general, 0);
result.setActive (projectTree != 0);
result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0));
break;


+ 1
- 1
extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h View File

@@ -115,7 +115,7 @@ private:
if (canResetToDefault)
{
addAndMakeVisible (defaultButton = new TextButton (T("Reset to Default")));
addAndMakeVisible (defaultButton = new TextButton ("Reset to Default"));
defaultButton->addButtonListener (this);
}
}


+ 6
- 6
extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h View File

@@ -71,13 +71,13 @@ public:
const RelativePath withFileExtension (const String& extension) const
{
return RelativePath (path.upToLastOccurrenceOf (T("."), ! extension.startsWithChar (T('.')), false) + extension, root);
return RelativePath (path.upToLastOccurrenceOf (T("."), ! extension.startsWithChar ('.'), false) + extension, root);
}
const RelativePath getParentDirectory() const
{
String p (path);
if (path.endsWithChar (T('/')))
if (path.endsWithChar ('/'))
p = p.dropLastCharacters (1);
return RelativePath (p.upToLastOccurrenceOf (T("/"), false, false), root);
@@ -89,7 +89,7 @@ public:
return RelativePath (subpath, root);
String p (toUnixStyle());
if (! p.endsWithChar (T('/')))
if (! p.endsWithChar ('/'))
p << '/';
return RelativePath (p + subpath, root);
@@ -116,9 +116,9 @@ private:
static bool isAbsolute (const String& path)
{
return File::isAbsolutePath (path)
|| path.startsWithChar (T('$'))
|| path.startsWithChar (T('~'))
|| (CharacterFunctions::isLetter (path[0]) && path[1] == T(':'));
|| path.startsWithChar ('$')
|| path.startsWithChar ('~')
|| (CharacterFunctions::isLetter (path[0]) && path[1] == ':');
}
};


+ 6
- 6
extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp View File

@@ -54,26 +54,26 @@ void StoredSettings::flush()
{
if (props != 0)
{
props->setValue (T("recentFiles"), recentFiles.toString());
props->setValue ("recentFiles", recentFiles.toString());
props->removeValue (T("keyMappings"));
props->removeValue ("keyMappings");
ScopedPointer <XmlElement> keys (commandManager->getKeyMappings()->createXml (true));
if (keys != 0)
props->setValue (T("keyMappings"), (XmlElement*) keys);
props->setValue ("keyMappings", (XmlElement*) keys);
}
deleteAndZero (props);
props = PropertiesFile::createDefaultAppPropertiesFile (T("Jucer2"),
T("settings"),
props = PropertiesFile::createDefaultAppPropertiesFile ("Jucer2",
"settings",
String::empty,
false, 3000,
PropertiesFile::storeAsXML);
// recent files...
recentFiles.restoreFromString (props->getValue (T("recentFiles")));
recentFiles.restoreFromString (props->getValue ("recentFiles"));
recentFiles.removeNonExistentFiles();
}


+ 29
- 29
extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp View File

@@ -150,27 +150,27 @@ const String createGUID (const String& seed)
const String unixStylePath (const String& path)
{
return path.replaceCharacter (T('\\'), T('/'));
return path.replaceCharacter ('\\', '/');
}
const String windowsStylePath (const String& path)
{
return path.replaceCharacter (T('/'), T('\\'));
return path.replaceCharacter ('/', '\\');
}
const String appendPath (const String& path, const String& subpath)
{
if (File::isAbsolutePath (subpath)
|| subpath.startsWithChar (T('$'))
|| subpath.startsWithChar (T('~'))
|| (CharacterFunctions::isLetter (subpath[0]) && subpath[1] == T(':')))
return subpath.replaceCharacter (T('\\'), T('/'));
|| subpath.startsWithChar ('$')
|| subpath.startsWithChar ('~')
|| (CharacterFunctions::isLetter (subpath[0]) && subpath[1] == ':'))
return subpath.replaceCharacter ('\\', '/');
String path1 (path.replaceCharacter (T('\\'), T('/')));
if (! path1.endsWithChar (T('/')))
String path1 (path.replaceCharacter ('\\', '/'));
if (! path1.endsWithChar ('/'))
path1 << '/';
return path1 + subpath.replaceCharacter (T('\\'), T('/'));
return path1 + subpath.replaceCharacter ('\\', '/');
}
bool shouldPathsBeRelative (String path1, String path2)
@@ -275,34 +275,34 @@ const String replaceCEscapeChars (const String& s)
switch (c)
{
case '\t':
r << T("\\t");
r << "\\t";
lastWasHexEscapeCode = false;
break;
case '\r':
r << T("\\r");
r << "\\r";
lastWasHexEscapeCode = false;
break;
case '\n':
r << T("\\n");
r << "\\n";
lastWasHexEscapeCode = false;
break;
case '\\':
r << T("\\\\");
r << "\\\\";
lastWasHexEscapeCode = false;
break;
case '\'':
r << T("\\\'");
r << "\\\'";
lastWasHexEscapeCode = false;
break;
case '\"':
r << T("\\\"");
r << "\\\"";
lastWasHexEscapeCode = false;
break;
default:
if (c < 128 &&
! (lastWasHexEscapeCode
&& String (T("0123456789abcdefABCDEF")).containsChar (c))) // (have to avoid following a hex escape sequence with a valid hex digit)
&& String ("0123456789abcdefABCDEF").containsChar (c))) // (have to avoid following a hex escape sequence with a valid hex digit)
{
r << c;
lastWasHexEscapeCode = false;
@@ -310,7 +310,7 @@ const String replaceCEscapeChars (const String& s)
else
{
lastWasHexEscapeCode = true;
r << T("\\x") << String::toHexString ((int) c);
r << "\\x" << String::toHexString ((int) c);
}
break;
@@ -339,12 +339,12 @@ const String makeValidCppIdentifier (String s,
&& ! CharacterFunctions::isUpperCase (s[i - 1]))
s = s.substring (0, i) + T(" ") + s.substring (i);
String allowedChars (T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ 0123456789"));
String allowedChars ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ 0123456789");
if (allowTemplates)
allowedChars += T("<>");
allowedChars += "<>";
if (! removeColons)
allowedChars += T(":");
allowedChars += ":";
StringArray words;
words.addTokens (s.retainCharacters (allowedChars), false);
@@ -365,7 +365,7 @@ const String makeValidCppIdentifier (String s,
}
if (CharacterFunctions::isDigit (n[0]))
n = T("_") + n;
n = "_" + n;
// make sure it's not a reserved c++ keyword..
static const tchar* const reservedWords[] =
@@ -417,7 +417,7 @@ const String doubleToCode (const double v)
const String boolToCode (const bool b)
{
return b ? T("true") : T("false");
return b ? "true" : "false";
}
const String colourToCode (const Colour& col)
@@ -441,9 +441,9 @@ const String colourToCode (const Colour& col)
for (int i = 0; i < numElementsInArray (colourNames) - 1; ++i)
if (col == colours[i])
return T("Colours::") + String (colourNames[i]);
return "Colours::" + String (colourNames[i]);
return T("Colour (0x") + hexString8Digits ((int) col.getARGB()) + T(')');
return "Colour (0x" + hexString8Digits ((int) col.getARGB()) + T(')');
}
const String justificationToCode (const Justification& justification)
@@ -469,7 +469,7 @@ const String justificationToCode (const Justification& justification)
default: jassertfalse; break;
}
return T("Justification (") + String (justification.getFlags()) + T(")");
return "Justification (" + String (justification.getFlags()) + ")";
}
const String castToFloat (const String& expression)
@@ -479,12 +479,12 @@ const String castToFloat (const String& expression)
String s (expression.getFloatValue());
if (s.containsChar (T('.')))
return s + T("f");
return s + "f";
return s + T(".0f");
return s + ".0f";
}
return T("(float) (") + expression + T(")");
return "(float) (" + expression + ")";
}
const String indentCode (const String& code, const int numSpaces)
@@ -506,7 +506,7 @@ const String indentCode (const String& code, const int numSpaces)
lines.set (i, s);
}
return lines.joinIntoString (T("\n"));
return lines.joinIntoString ("\n");
}
int indexOfLineStartingWith (const StringArray& lines, const String& text, int startIndex)


+ 1022
- 1049
juce_amalgamated.cpp
File diff suppressed because it is too large
View File


+ 21
- 21
juce_amalgamated.h View File

@@ -1271,7 +1271,7 @@ public:

const String unquoted() const;

const String quoted (juce_wchar quoteCharacter = JUCE_T('"')) const;
const String quoted (juce_wchar quoteCharacter = '"') const;

static const String repeatedString (const juce_wchar* stringToRepeat,
int numberOfTimesToRepeat);
@@ -4076,7 +4076,7 @@ public:

double inWeeks() const throw();

const String getDescription (const String& returnValueForZeroTime = JUCE_T("0")) const throw();
const String getDescription (const String& returnValueForZeroTime = "0") const throw();

bool operator== (const RelativeTime& other) const throw();
bool operator!= (const RelativeTime& other) const throw();
@@ -4342,10 +4342,10 @@ public:
int findChildFiles (Array<File>& results,
int whatToLookFor,
bool searchRecursively,
const String& wildCardPattern = JUCE_T("*")) const;
const String& wildCardPattern = "*") const;

int getNumberOfChildFiles (int whatToLookFor,
const String& wildCardPattern = JUCE_T("*")) const;
const String& wildCardPattern = "*") const;

bool containsSubDirectories() const;

@@ -4485,19 +4485,19 @@ public:
const String createDocument (const String& dtdToUse,
bool allOnOneLine = false,
bool includeXmlHeader = true,
const String& encodingType = JUCE_T("UTF-8"),
const String& encodingType = "UTF-8",
int lineWrapLength = 60) const;

void writeToStream (OutputStream& output,
const String& dtdToUse,
bool allOnOneLine = false,
bool includeXmlHeader = true,
const String& encodingType = JUCE_T("UTF-8"),
const String& encodingType = "UTF-8",
int lineWrapLength = 60) const;

bool writeToFile (const File& destinationFile,
const String& dtdToUse,
const String& encodingType = JUCE_T("UTF-8"),
const String& encodingType = "UTF-8",
int lineWrapLength = 60) const;

inline const String& getTagName() const throw() { return tagName; }
@@ -7598,7 +7598,7 @@ public:

DirectoryIterator (const File& directory,
bool isRecursive,
const String& wildCard = JUCE_T("*"),
const String& wildCard = "*",
int whatToLookFor = File::findFiles);

~DirectoryIterator();
@@ -7754,7 +7754,7 @@ public:
int findChildFiles (Array<File>& results,
int whatToLookFor,
bool searchRecursively,
const String& wildCardPattern = JUCE_T("*")) const;
const String& wildCardPattern = "*") const;

bool isFileInPath (const File& fileToCheck,
bool checkRecursively) const;
@@ -10146,7 +10146,7 @@ public:
static const Rectangle fromString (const String& stringVersion)
{
StringArray toks;
toks.addTokens (stringVersion.trim(), JUCE_T(",; \t\r\n"), String::empty);
toks.addTokens (stringVersion.trim(), ",; \t\r\n", String::empty);

return Rectangle (toks[0].trim().getIntValue(),
toks[1].trim().getIntValue(),
@@ -10708,7 +10708,7 @@ public:

static const String getDefaultMonospacedFontName() throw();

static void getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw();
static void getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed);

float getHeight() const throw() { return font->height; }

@@ -10756,7 +10756,7 @@ public:

static void findFonts (Array<Font>& results) throw();

static const StringArray findAllTypefaceNames() throw();
static const StringArray findAllTypefaceNames();

static const String getFallbackFontName() throw();

@@ -14914,11 +14914,11 @@ class JUCE_API IIRFilter
{
public:

IIRFilter() throw();
IIRFilter();

IIRFilter (const IIRFilter& other) throw();
IIRFilter (const IIRFilter& other);

~IIRFilter() throw();
~IIRFilter();

void reset() throw();

@@ -15142,7 +15142,7 @@ public:
virtual ~AudioIODeviceType();

protected:
AudioIODeviceType (const tchar* const typeName);
AudioIODeviceType (const String& typeName);

private:
String typeName;
@@ -16984,7 +16984,7 @@ public:

AudioIODevice* getCurrentAudioDevice() const throw() { return currentAudioDevice; }

const String getCurrentAudioDeviceType() const throw() { return currentDeviceType; }
const String getCurrentAudioDeviceType() const { return currentDeviceType; }

AudioIODeviceType* getCurrentDeviceTypeObject() const;

@@ -17014,7 +17014,7 @@ public:

void setDefaultMidiOutput (const String& deviceName);

const String getDefaultMidiOutputName() const throw() { return defaultMidiOutputName; }
const String getDefaultMidiOutputName() const { return defaultMidiOutputName; }

MidiOutput* getDefaultMidiOutput() const throw() { return defaultMidiOutput; }

@@ -27308,7 +27308,7 @@ public:
bool hasProgressBar,
bool hasCancelButton,
int timeOutMsWhenCancelling = 10000,
const String& cancelButtonText = JUCE_T("Cancel"));
const String& cancelButtonText = "Cancel");

~ThreadWithProgressWindow();

@@ -28490,9 +28490,9 @@ private:
class JUCE_API SystemClipboard
{
public:
static void copyTextToClipboard (const String& text) throw();
static void copyTextToClipboard (const String& text);

static const String getTextFromClipboard() throw();
static const String getTextFromClipboard();
};

#endif // __JUCE_SYSTEMCLIPBOARD_JUCEHEADER__


+ 1
- 1
src/application/juce_Application.cpp View File

@@ -144,7 +144,7 @@ void JUCEApplication::getCommandInfo (const CommandID commandID, ApplicationComm
"Application",
0);
result.defaultKeypresses.add (KeyPress (T('q'), ModifierKeys::commandModifier, 0));
result.defaultKeypresses.add (KeyPress ('q', ModifierKeys::commandModifier, 0));
}
}


+ 2
- 2
src/application/juce_Application.h View File

@@ -78,12 +78,12 @@
const String getApplicationName()
{
return T("Super JUCE-o-matic");
return "Super JUCE-o-matic";
}
const String getApplicationVersion()
{
return T("1.0");
return "1.0";
}
};


+ 2
- 2
src/application/juce_ApplicationCommandInfo.h View File

@@ -76,11 +76,11 @@ struct JUCE_API ApplicationCommandInfo
This is just so you can write things like:
@code
myinfo.addDefaultKeypress (T('s'), ModifierKeys::commandModifier);
myinfo.addDefaultKeypress ('s', ModifierKeys::commandModifier);
@endcode
instead of
@code
myinfo.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier));
myinfo.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier));
@endcode
*/
void addDefaultKeypress (int keyCode,


+ 1
- 1
src/audio/audio_file_formats/juce_AudioCDReader.cpp View File

@@ -112,7 +112,7 @@ void AudioCDReader::refreshTrackLengths()
{
tracks.clear();
trackStartSamples.clear();
volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, T("*.aiff"));
volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, "*.aiff");
tracks.sort (*this);


+ 6
- 6
src/audio/audio_file_formats/juce_AudioFormatManager.cpp View File

@@ -122,8 +122,8 @@ AudioFormat* AudioFormatManager::getDefaultFormat() const
AudioFormat* AudioFormatManager::findFormatForFileExtension (const String& fileExtension) const
{
String e (fileExtension);
if (! e.startsWithChar (T('.')))
e = T(".") + e;
if (! e.startsWithChar ('.'))
e = "." + e;
for (int i = 0; i < getNumKnownFormats(); ++i)
if (getKnownFormat(i)->getFileExtensions().contains (e, true))
@@ -146,15 +146,15 @@ const String AudioFormatManager::getWildcardForAllFormats() const
String s;
for (i = 0; i < allExtensions.size(); ++i)
{
s << T('*');
s << '*';
if (! allExtensions[i].startsWithChar (T('.')))
s << T('.');
if (! allExtensions[i].startsWithChar ('.'))
s << '.';
s << allExtensions[i];
if (i < allExtensions.size() - 1)
s << T(';');
s << ';';
}
return s;


+ 1
- 1
src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp View File

@@ -44,7 +44,7 @@ struct ThumbnailCacheEntry
//==============================================================================
AudioThumbnailCache::AudioThumbnailCache (const int maxNumThumbsToStore_)
: TimeSliceThread (T("thumb cache")),
: TimeSliceThread ("thumb cache"),
maxNumThumbsToStore (maxNumThumbsToStore_)
{
startThread (2);


+ 8
- 8
src/audio/audio_sources/juce_ChannelRemappingAudioSource.cpp View File

@@ -163,7 +163,7 @@ void ChannelRemappingAudioSource::getNextAudioBlock (const AudioSourceChannelInf
//==============================================================================
XmlElement* ChannelRemappingAudioSource::createXml() const throw()
{
XmlElement* e = new XmlElement (T("MAPPINGS"));
XmlElement* e = new XmlElement ("MAPPINGS");
String ins, outs;
int i;
@@ -171,28 +171,28 @@ XmlElement* ChannelRemappingAudioSource::createXml() const throw()
const ScopedLock sl (lock);
for (i = 0; i < remappedInputs.size(); ++i)
ins << remappedInputs.getUnchecked(i) << T(' ');
ins << remappedInputs.getUnchecked(i) << ' ';
for (i = 0; i < remappedOutputs.size(); ++i)
outs << remappedOutputs.getUnchecked(i) << T(' ');
outs << remappedOutputs.getUnchecked(i) << ' ';
e->setAttribute (T("inputs"), ins.trimEnd());
e->setAttribute (T("outputs"), outs.trimEnd());
e->setAttribute ("inputs", ins.trimEnd());
e->setAttribute ("outputs", outs.trimEnd());
return e;
}
void ChannelRemappingAudioSource::restoreFromXml (const XmlElement& e) throw()
{
if (e.hasTagName (T("MAPPINGS")))
if (e.hasTagName ("MAPPINGS"))
{
const ScopedLock sl (lock);
clearAllMappings();
StringArray ins, outs;
ins.addTokens (e.getStringAttribute (T("inputs")), false);
outs.addTokens (e.getStringAttribute (T("outputs")), false);
ins.addTokens (e.getStringAttribute ("inputs"), false);
outs.addTokens (e.getStringAttribute ("outputs"), false);
int i;
for (i = 0; i < ins.size(); ++i)


+ 15
- 15
src/audio/devices/juce_AudioDeviceManager.cpp View File

@@ -155,7 +155,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
numInputChansNeeded = numInputChannelsNeeded;
numOutputChansNeeded = numOutputChannelsNeeded;
if (e != 0 && e->hasTagName (T("DEVICESETUP")))
if (e != 0 && e->hasTagName ("DEVICESETUP"))
{
lastExplicitSettings = new XmlElement (*e);
@@ -165,18 +165,18 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
if (preferredSetupOptions != 0)
setup = *preferredSetupOptions;
if (e->getStringAttribute (T("audioDeviceName")).isNotEmpty())
if (e->getStringAttribute ("audioDeviceName").isNotEmpty())
{
setup.inputDeviceName = setup.outputDeviceName
= e->getStringAttribute (T("audioDeviceName"));
= e->getStringAttribute ("audioDeviceName");
}
else
{
setup.inputDeviceName = e->getStringAttribute (T("audioInputDeviceName"));
setup.outputDeviceName = e->getStringAttribute (T("audioOutputDeviceName"));
setup.inputDeviceName = e->getStringAttribute ("audioInputDeviceName");
setup.outputDeviceName = e->getStringAttribute ("audioOutputDeviceName");
}
currentDeviceType = e->getStringAttribute (T("deviceType"));
currentDeviceType = e->getStringAttribute ("deviceType");
if (currentDeviceType.isEmpty())
{
AudioIODeviceType* const type = findType (setup.inputDeviceName, setup.outputDeviceName);
@@ -187,20 +187,20 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
currentDeviceType = availableDeviceTypes[0]->getTypeName();
}
setup.bufferSize = e->getIntAttribute (T("audioDeviceBufferSize"));
setup.sampleRate = e->getDoubleAttribute (T("audioDeviceRate"));
setup.bufferSize = e->getIntAttribute ("audioDeviceBufferSize");
setup.sampleRate = e->getDoubleAttribute ("audioDeviceRate");
setup.inputChannels.parseString (e->getStringAttribute (T("audioDeviceInChans"), T("11")), 2);
setup.outputChannels.parseString (e->getStringAttribute (T("audioDeviceOutChans"), T("11")), 2);
setup.inputChannels.parseString (e->getStringAttribute ("audioDeviceInChans", "11"), 2);
setup.outputChannels.parseString (e->getStringAttribute ("audioDeviceOutChans", "11"), 2);
setup.useDefaultInputChannels = ! e->hasAttribute (T("audioDeviceInChans"));
setup.useDefaultOutputChannels = ! e->hasAttribute (T("audioDeviceOutChans"));
setup.useDefaultInputChannels = ! e->hasAttribute ("audioDeviceInChans");
setup.useDefaultOutputChannels = ! e->hasAttribute ("audioDeviceOutChans");
error = setAudioDeviceSetup (setup, true);
midiInsFromXml.clear();
forEachXmlChildElementWithTagName (*e, c, T("MIDIINPUT"))
midiInsFromXml.add (c->getStringAttribute (T("name")));
forEachXmlChildElementWithTagName (*e, c, "MIDIINPUT")
midiInsFromXml.add (c->getStringAttribute ("name"));
const StringArray allMidiIns (MidiInput::getDevices());
@@ -211,7 +211,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
error = initialise (numInputChannelsNeeded, numOutputChannelsNeeded, 0,
false, preferredDefaultDeviceName);
setDefaultMidiOutput (e->getStringAttribute (T("defaultMidiOutput")));
setDefaultMidiOutput (e->getStringAttribute ("defaultMidiOutput"));
return error;
}


+ 2
- 2
src/audio/devices/juce_AudioDeviceManager.h View File

@@ -224,7 +224,7 @@ public:
/** Returns the type of audio device currently in use.
@see setCurrentAudioDeviceType
*/
const String getCurrentAudioDeviceType() const throw() { return currentDeviceType; }
const String getCurrentAudioDeviceType() const { return currentDeviceType; }
/** Returns the currently active audio device type object.
Don't keep a copy of this pointer - it's owned by the device manager and could
@@ -356,7 +356,7 @@ public:
@see setDefaultMidiOutput, getDefaultMidiOutput
*/
const String getDefaultMidiOutputName() const throw() { return defaultMidiOutputName; }
const String getDefaultMidiOutputName() const { return defaultMidiOutputName; }
/** Returns the current default midi output device.


+ 1
- 1
src/audio/devices/juce_AudioIODeviceType.cpp View File

@@ -31,7 +31,7 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
AudioIODeviceType::AudioIODeviceType (const tchar* const name)
AudioIODeviceType::AudioIODeviceType (const String& name)
: typeName (name)
{
}


+ 1
- 1
src/audio/devices/juce_AudioIODeviceType.h View File

@@ -132,7 +132,7 @@ public:
virtual ~AudioIODeviceType();
protected:
AudioIODeviceType (const tchar* const typeName);
AudioIODeviceType (const String& typeName);
private:
String typeName;


+ 3
- 3
src/audio/dsp/juce_IIRFilter.cpp View File

@@ -32,13 +32,13 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
IIRFilter::IIRFilter() throw()
IIRFilter::IIRFilter()
: active (false)
{
reset();
}
IIRFilter::IIRFilter (const IIRFilter& other) throw()
IIRFilter::IIRFilter (const IIRFilter& other)
: active (other.active)
{
const ScopedLock sl (other.processLock);
@@ -46,7 +46,7 @@ IIRFilter::IIRFilter (const IIRFilter& other) throw()
reset();
}
IIRFilter::~IIRFilter() throw()
IIRFilter::~IIRFilter()
{
}


+ 3
- 3
src/audio/dsp/juce_IIRFilter.h View File

@@ -46,13 +46,13 @@ public:
you process with it. Use the appropriate method to turn it into the type
of filter needed.
*/
IIRFilter() throw();
IIRFilter();
/** Creates a copy of another filter. */
IIRFilter (const IIRFilter& other) throw();
IIRFilter (const IIRFilter& other);
/** Destructor. */
~IIRFilter() throw();
~IIRFilter();
//==============================================================================
/** Resets the filter's processing pipeline, ready to start a new stream of data.


+ 12
- 12
src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm View File

@@ -92,7 +92,7 @@ static const tchar* auIdentifierPrefix = T("AudioUnit:");
static const String createAUPluginIdentifier (const ComponentDescription& desc)
{
jassert (osTypeToString ('abcd') == T("abcd")); // agh, must have got the endianness wrong..
jassert (osTypeToString ('abcd') == "abcd"); // agh, must have got the endianness wrong..
jassert (stringToOSType ("abcd") == (OSType) 'abcd'); // ditto
String s (auIdentifierPrefix);
@@ -158,11 +158,11 @@ static bool getComponentDescFromIdentifier (const String& fileOrIdentifier, Comp
if (fileOrIdentifier.startsWithIgnoreCase (auIdentifierPrefix))
{
String s (fileOrIdentifier.substring (jmax (fileOrIdentifier.lastIndexOfChar (T(':')),
fileOrIdentifier.lastIndexOfChar (T('/'))) + 1));
String s (fileOrIdentifier.substring (jmax (fileOrIdentifier.lastIndexOfChar (':'),
fileOrIdentifier.lastIndexOfChar ('/')) + 1));
StringArray tokens;
tokens.addTokens (s, T(","), String::empty);
tokens.addTokens (s, ",", String::empty);
tokens.trim();
tokens.removeEmptyStrings();
@@ -378,7 +378,7 @@ AudioUnitPluginInstance::AudioUnitPluginInstance (const String& fileOrIdentifier
{
++insideCallback;
log (T("Opening AU: ") + fileOrIdentifier);
log ("Opening AU: " + fileOrIdentifier);
if (getComponentDescFromFile (fileOrIdentifier))
{
@@ -423,7 +423,7 @@ bool AudioUnitPluginInstance::getComponentDescFromFile (const String& fileOrIden
return true;
const File file (fileOrIdentifier);
if (! file.hasFileExtension (T(".component")))
if (! file.hasFileExtension (".component"))
return false;
const char* const utf8 = fileOrIdentifier.toUTF8();
@@ -497,7 +497,7 @@ void AudioUnitPluginInstance::initialise()
if (initialised || audioUnit == 0)
return;
log (T("Initialising AU: ") + pluginName);
log ("Initialising AU: " + pluginName);
parameterIds.clear();
@@ -1044,7 +1044,7 @@ private:
HIViewRef attachView (WindowRef windowRef, HIViewRef rootView)
{
log (T("Opening AU GUI: ") + owner->plugin.getName());
log ("Opening AU GUI: " + owner->plugin.getName());
AudioUnitCarbonView viewComponent = owner->getViewComponent();
@@ -1069,7 +1069,7 @@ private:
void removeView (HIViewRef)
{
log (T("Closing AU GUI: ") + owner->plugin.getName());
log ("Closing AU GUI: " + owner->plugin.getName());
owner->closeViewComponent();
}
@@ -1297,7 +1297,7 @@ void AudioUnitPluginInstance::changeProgramName (int index, const String& newNam
const String AudioUnitPluginInstance::getInputChannelName (const int index) const
{
if (((unsigned int) index) < (unsigned int) getNumInputChannels())
return T("Input ") + String (index + 1);
return "Input " + String (index + 1);
return String::empty;
}
@@ -1314,7 +1314,7 @@ bool AudioUnitPluginInstance::isInputChannelStereoPair (int index) const
const String AudioUnitPluginInstance::getOutputChannelName (const int index) const
{
if (((unsigned int) index) < (unsigned int) getNumOutputChannels())
return T("Output ") + String (index + 1);
return "Output " + String (index + 1);
return String::empty;
}
@@ -1485,7 +1485,7 @@ bool AudioUnitPluginFormat::fileMightContainThisPluginType (const String& fileOr
const File f (fileOrIdentifier);
return f.hasFileExtension (T(".component"))
return f.hasFileExtension (".component")
&& f.isDirectory();
}


+ 8
- 8
src/audio/plugins/formats/juce_VSTPluginFormat.cpp View File

@@ -469,7 +469,7 @@ public:
bool ok = false;
const String filename (file.getFullPathName());
if (file.hasFileExtension (T(".vst")))
if (file.hasFileExtension (".vst"))
{
const char* const utf8 = filename.toUTF8();
CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*) utf8,
@@ -823,7 +823,7 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr <ModuleHan
++insideVSTCallback;
name = module->pluginName;
log (T("Creating VST instance: ") + name);
log ("Creating VST instance: " + name);
#if JUCE_MAC
if (module->resFileId != 0)
@@ -907,7 +907,7 @@ void VSTPluginInstance::initialise()
if (initialised || effect == 0)
return;
log (T("Initialising VST: ") + module->pluginName);
log ("Initialising VST: " + module->pluginName);
initialised = true;
dispatch (effIdentify, 0, 0, 0, 0);
@@ -1454,7 +1454,7 @@ private:
if (isOpen || getWindowHandle() == 0)
return;
log (T("Opening VST UI: ") + plugin.name);
log ("Opening VST UI: " + plugin.name);
isOpen = true;
ERect* rect = 0;
@@ -1569,7 +1569,7 @@ private:
{
if (isOpen)
{
log (T("Closing VST UI: ") + plugin.getName());
log ("Closing VST UI: " + plugin.getName());
isOpen = false;
dispatch (effEditClose, 0, 0, 0, 0);
@@ -2937,7 +2937,7 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti
const File f (fileOrIdentifier);
#if JUCE_MAC
if (f.isDirectory() && f.hasFileExtension (T(".vst")))
if (f.isDirectory() && f.hasFileExtension (".vst"))
return true;
#if JUCE_PPC
@@ -2960,10 +2960,10 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti
return false;
#elif JUCE_WIN32
return f.existsAsFile()
&& f.hasFileExtension (T(".dll"));
&& f.hasFileExtension (".dll");
#elif JUCE_LINUX
return f.existsAsFile()
&& f.hasFileExtension (T(".so"));
&& f.hasFileExtension (".so");
#endif
}


+ 9
- 9
src/audio/plugins/juce_KnownPluginList.cpp View File

@@ -95,8 +95,8 @@ void KnownPluginList::removeType (const int index) throw()
static Time getFileModTime (const String& fileOrIdentifier) throw()
{
if (fileOrIdentifier.startsWithChar (T('/'))
|| fileOrIdentifier[1] == T(':'))
if (fileOrIdentifier.startsWithChar ('/')
|| fileOrIdentifier[1] == ':')
{
return File (fileOrIdentifier).getLastModificationTime();
}
@@ -229,9 +229,9 @@ public:
else if (method == KnownPluginList::sortByManufacturer)
diff = first->manufacturerName.compareLexicographically (second->manufacturerName);
else if (method == KnownPluginList::sortByFileSystemLocation)
diff = first->fileOrIdentifier.replaceCharacter (T('\\'), T('/'))
diff = first->fileOrIdentifier.replaceCharacter ('\\', '/')
.upToLastOccurrenceOf (T("/"), false, false)
.compare (second->fileOrIdentifier.replaceCharacter (T('\\'), T('/'))
.compare (second->fileOrIdentifier.replaceCharacter ('\\', '/')
.upToLastOccurrenceOf (T("/"), false, false));
if (diff == 0)
@@ -256,7 +256,7 @@ void KnownPluginList::sort (const SortMethod method)
//==============================================================================
XmlElement* KnownPluginList::createXml() const
{
XmlElement* const e = new XmlElement (T("KNOWNPLUGINS"));
XmlElement* const e = new XmlElement ("KNOWNPLUGINS");
for (int i = 0; i < types.size(); ++i)
e->addChildElement (types.getUnchecked(i)->createXml());
@@ -268,7 +268,7 @@ void KnownPluginList::recreateFromXml (const XmlElement& xml)
{
clear();
if (xml.hasTagName (T("KNOWNPLUGINS")))
if (xml.hasTagName ("KNOWNPLUGINS"))
{
forEachXmlChildElement (xml, e)
{
@@ -345,10 +345,10 @@ public:
for (int i = 0; i < allPlugins.size(); ++i)
{
String path (allPlugins.getUnchecked(i)
->fileOrIdentifier.replaceCharacter (T('\\'), T('/'))
->fileOrIdentifier.replaceCharacter ('\\', '/')
.upToLastOccurrenceOf (T("/"), false, false));
if (path.substring (1, 2) == T(":"))
if (path.substring (1, 2) == ":")
path = path.substring (2);
addPlugin (allPlugins.getUnchecked(i), path);
@@ -411,7 +411,7 @@ void KnownPluginList::addToMenu (PopupMenu& menu, const SortMethod sortMethod) c
: pd->manufacturerName);
if (! thisSubMenuName.containsNonWhitespaceChars())
thisSubMenuName = T("Other");
thisSubMenuName = "Other";
if (thisSubMenuName != lastSubMenuName)
{


+ 27
- 27
src/audio/plugins/juce_PluginDescription.cpp View File

@@ -85,44 +85,44 @@ bool PluginDescription::isDuplicateOf (const PluginDescription& other) const
const String PluginDescription::createIdentifierString() const throw()
{
return pluginFormatName
+ T("-") + name
+ T("-") + String::toHexString (fileOrIdentifier.hashCode())
+ T("-") + String::toHexString (uid);
+ "-" + name
+ "-" + String::toHexString (fileOrIdentifier.hashCode())
+ "-" + String::toHexString (uid);
}
XmlElement* PluginDescription::createXml() const
{
XmlElement* const e = new XmlElement (T("PLUGIN"));
e->setAttribute (T("name"), name);
e->setAttribute (T("format"), pluginFormatName);
e->setAttribute (T("category"), category);
e->setAttribute (T("manufacturer"), manufacturerName);
e->setAttribute (T("version"), version);
e->setAttribute (T("file"), fileOrIdentifier);
e->setAttribute (T("uid"), String::toHexString (uid));
e->setAttribute (T("isInstrument"), isInstrument);
e->setAttribute (T("fileTime"), String::toHexString (lastFileModTime.toMilliseconds()));
e->setAttribute (T("numInputs"), numInputChannels);
e->setAttribute (T("numOutputs"), numOutputChannels);
XmlElement* const e = new XmlElement ("PLUGIN");
e->setAttribute ("name", name);
e->setAttribute ("format", pluginFormatName);
e->setAttribute ("category", category);
e->setAttribute ("manufacturer", manufacturerName);
e->setAttribute ("version", version);
e->setAttribute ("file", fileOrIdentifier);
e->setAttribute ("uid", String::toHexString (uid));
e->setAttribute ("isInstrument", isInstrument);
e->setAttribute ("fileTime", String::toHexString (lastFileModTime.toMilliseconds()));
e->setAttribute ("numInputs", numInputChannels);
e->setAttribute ("numOutputs", numOutputChannels);
return e;
}
bool PluginDescription::loadFromXml (const XmlElement& xml)
{
if (xml.hasTagName (T("PLUGIN")))
if (xml.hasTagName ("PLUGIN"))
{
name = xml.getStringAttribute (T("name"));
pluginFormatName = xml.getStringAttribute (T("format"));
category = xml.getStringAttribute (T("category"));
manufacturerName = xml.getStringAttribute (T("manufacturer"));
version = xml.getStringAttribute (T("version"));
fileOrIdentifier = xml.getStringAttribute (T("file"));
uid = xml.getStringAttribute (T("uid")).getHexValue32();
isInstrument = xml.getBoolAttribute (T("isInstrument"), false);
lastFileModTime = Time (xml.getStringAttribute (T("fileTime")).getHexValue64());
numInputChannels = xml.getIntAttribute (T("numInputs"));
numOutputChannels = xml.getIntAttribute (T("numOutputs"));
name = xml.getStringAttribute ("name");
pluginFormatName = xml.getStringAttribute ("format");
category = xml.getStringAttribute ("category");
manufacturerName = xml.getStringAttribute ("manufacturer");
version = xml.getStringAttribute ("version");
fileOrIdentifier = xml.getStringAttribute ("file");
uid = xml.getStringAttribute ("uid").getHexValue32();
isInstrument = xml.getBoolAttribute ("isInstrument", false);
lastFileModTime = Time (xml.getStringAttribute ("fileTime").getHexValue64());
numInputChannels = xml.getIntAttribute ("numInputs");
numOutputChannels = xml.getIntAttribute ("numOutputs");
return true;
}


+ 5
- 5
src/containers/juce_BitArray.cpp View File

@@ -877,7 +877,7 @@ const String BigInteger::toString (const int base, const int minimumNumCharacter
if (base == 2 || base == 8 || base == 16)
{
const int bits = (base == 2) ? 1 : (base == 8 ? 3 : 4);
static const juce_wchar* const hexDigits = T("0123456789abcdef");
static const char* const hexDigits = "0123456789abcdef";
for (;;)
{
@@ -914,7 +914,7 @@ const String BigInteger::toString (const int base, const int minimumNumCharacter
s = s.paddedLeft ('0', minimumNumCharacters);
return isNegative() ? T("-") + s : s;
return isNegative() ? "-" + s : s;
}
void BigInteger::parseString (const String& text, const int base)
@@ -950,10 +950,10 @@ void BigInteger::parseString (const String& text, const int base)
{
const juce_wchar c = *t++;
if (c >= T('0') && c <= T('9'))
if (c >= '0' && c <= '9')
{
operator*= (ten);
operator+= ((int) (c - T('0')));
operator+= ((int) (c - '0'));
}
else if (c == 0)
{
@@ -962,7 +962,7 @@ void BigInteger::parseString (const String& text, const int base)
}
}
setNegative (text.trimStart().startsWithChar (T('-')));
setNegative (text.trimStart().startsWithChar ('-'));
}
const MemoryBlock BigInteger::toMemoryBlock() const


+ 8
- 8
src/containers/juce_MemoryBlock.cpp View File

@@ -309,19 +309,19 @@ void MemoryBlock::loadFromHexString (const String& hex) throw()
{
const juce_wchar c = hex [i++];
if (c >= T('0') && c <= T('9'))
if (c >= '0' && c <= '9')
{
byte |= c - T('0');
byte |= c - '0';
break;
}
else if (c >= T('a') && c <= T('z'))
else if (c >= 'a' && c <= 'z')
{
byte |= c - (T('a') - 10);
byte |= c - ('a' - 10);
break;
}
else if (c >= T('A') && c <= T('Z'))
else if (c >= 'A' && c <= 'Z')
{
byte |= c - (T('A') - 10);
byte |= c - ('A' - 10);
break;
}
else if (c == 0)
@@ -349,7 +349,7 @@ const String MemoryBlock::toBase64Encoding() const throw()
destString.preallocateStorage (initialLen + 2 + numChars);
tchar* d = const_cast <tchar*> (((const tchar*) destString) + initialLen);
*d++ = T('.');
*d++ = '.';
for (size_t i = 0; i < numChars; ++i)
*d++ = encodingTable [getBitRange (i * 6, 6)];
@@ -361,7 +361,7 @@ const String MemoryBlock::toBase64Encoding() const throw()
bool MemoryBlock::fromBase64Encoding (const String& s) throw()
{
const int startPos = s.indexOfChar (T('.')) + 1;
const int startPos = s.indexOfChar ('.') + 1;
if (startPos <= 0)
return false;


+ 8
- 8
src/containers/juce_PropertySet.cpp View File

@@ -184,7 +184,7 @@ void PropertySet::setValue (const String& keyName, const double value) throw()
void PropertySet::setValue (const String& keyName, const bool value) throw()
{
setValue (keyName, String ((value) ? T("1") : T("0")));
setValue (keyName, String (value ? "1" : "0"));
}
void PropertySet::setValue (const String& keyName, const XmlElement* const xml)
@@ -213,8 +213,8 @@ XmlElement* PropertySet::createXml (const String& nodeName) const throw()
for (int i = 0; i < properties.getAllKeys().size(); ++i)
{
XmlElement* const e = xml->createNewChildElement ("VALUE");
e->setAttribute (T("name"), properties.getAllKeys()[i]);
e->setAttribute (T("val"), properties.getAllValues()[i]);
e->setAttribute ("name", properties.getAllKeys()[i]);
e->setAttribute ("val", properties.getAllValues()[i]);
}
return xml;
@@ -225,13 +225,13 @@ void PropertySet::restoreFromXml (const XmlElement& xml) throw()
const ScopedLock sl (lock);
clear();
forEachXmlChildElementWithTagName (xml, e, T("VALUE"))
forEachXmlChildElementWithTagName (xml, e, "VALUE")
{
if (e->hasAttribute (T("name"))
&& e->hasAttribute (T("val")))
if (e->hasAttribute ("name")
&& e->hasAttribute ("val"))
{
properties.set (e->getStringAttribute (T("name")),
e->getStringAttribute (T("val")));
properties.set (e->getStringAttribute ("name"),
e->getStringAttribute ("val"));
}
}


+ 1
- 1
src/containers/juce_Variant.cpp View File

@@ -188,7 +188,7 @@ const String var::toString() const
{
case voidType: return String::empty;
case intType: return String (value.intValue);
case boolType: return value.boolValue ? T("1") : T("0");
case boolType: return String::charToString (value.boolValue ? '1' : '0');
case doubleType: return String (value.doubleValue);
case stringType: return *(value.stringValue);
case objectType: return "Object 0x" + String::toHexString ((int) (pointer_sized_int) value.objectValue);


+ 1
- 1
src/core/juce_FileLogger.cpp View File

@@ -75,7 +75,7 @@ void FileLogger::logMessage (const String& message)
DBG (message);
const ScopedLock sl (logLock);
(*logStream) << message << T("\r\n");
(*logStream) << message << "\r\n";
logStream->flush();
}
}


+ 1
- 1
src/core/juce_RelativeTime.cpp View File

@@ -112,7 +112,7 @@ const String RelativeTime::getDescription (const String& returnValueForZeroTime)
String result;
if (seconds < 0)
result = T("-");
result = "-";
int fieldsShown = 0;
int n = abs ((int) inWeeks());


+ 1
- 1
src/core/juce_RelativeTime.h View File

@@ -146,7 +146,7 @@ public:
@see inMilliseconds, inSeconds, inMinutes, inHours, inDays, inWeeks
*/
const String getDescription (const String& returnValueForZeroTime = JUCE_T("0")) const throw();
const String getDescription (const String& returnValueForZeroTime = "0") const throw();
//==============================================================================


+ 6
- 6
src/core/juce_Uuid.cpp View File

@@ -123,19 +123,19 @@ Uuid& Uuid::operator= (const String& uuidString)
{
const tchar c = uuidString [i++];
if (c >= T('0') && c <= T('9'))
if (c >= '0' && c <= '9')
{
byte |= c - T('0');
byte |= c - '0';
break;
}
else if (c >= T('a') && c <= T('z'))
else if (c >= 'a' && c <= 'z')
{
byte |= c - (T('a') - 10);
byte |= c - ('a' - 10);
break;
}
else if (c >= T('A') && c <= T('Z'))
else if (c >= 'A' && c <= 'Z')
{
byte |= c - (T('A') - 10);
byte |= c - ('A' - 10);
break;
}
else if (c == 0)


+ 1
- 1
src/cryptography/juce_RSAKey.cpp View File

@@ -39,7 +39,7 @@ RSAKey::RSAKey()
RSAKey::RSAKey (const String& s)
{
if (s.containsChar (T(',')))
if (s.containsChar (','))
{
part1.parseString (s.upToFirstOccurrenceOf (T(","), false, false), 16);
part2.parseString (s.fromFirstOccurrenceOf (T(","), false, false), 16);


+ 63
- 63
src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp View File

@@ -46,14 +46,14 @@ namespace CppTokeniser
static bool isIdentifierStart (const tchar c) throw()
{
return CharacterFunctions::isLetter (c)
|| c == T('_') || c == T('@');
|| c == '_' || c == '@';
}
static bool isIdentifierBody (const tchar c) throw()
{
return CharacterFunctions::isLetter (c)
|| CharacterFunctions::isDigit (c)
|| c == T('_') || c == T('@');
|| c == '_' || c == '@';
}
static int parseIdentifier (CodeDocument::Iterator& source) throw()
@@ -314,7 +314,7 @@ static void skipComment (CodeDocument::Iterator& source) throw()
{
const juce_wchar c = source.nextChar();
if (c == 0 || (c == T('/') && lastWasStar))
if (c == 0 || (c == '/' && lastWasStar))
break;
lastWasStar = (c == '*');
@@ -337,20 +337,20 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source)
source.skip();
break;
case T('0'):
case T('1'):
case T('2'):
case T('3'):
case T('4'):
case T('5'):
case T('6'):
case T('7'):
case T('8'):
case T('9'):
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
result = CppTokeniser::parseNumber (source);
break;
case T('.'):
case '.':
result = CppTokeniser::parseNumber (source);
if (result == tokenType_error)
@@ -358,41 +358,41 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source)
break;
case T(','):
case T(';'):
case T(':'):
case ',':
case ';':
case ':':
source.skip();
result = tokenType_punctuation;
break;
case T('('):
case T(')'):
case T('{'):
case T('}'):
case T('['):
case T(']'):
case '(':
case ')':
case '{':
case '}':
case '[':
case ']':
source.skip();
result = tokenType_bracket;
break;
case T('"'):
case T('\''):
case '"':
case '\'':
CppTokeniser::skipQuotedString (source);
result = tokenType_stringLiteral;
break;
case T('+'):
case '+':
result = tokenType_operator;
source.skip();
if (source.peekNextChar() == T('+'))
if (source.peekNextChar() == '+')
source.skip();
else if (source.peekNextChar() == T('='))
else if (source.peekNextChar() == '=')
source.skip();
break;
case T('-'):
case '-':
source.skip();
result = CppTokeniser::parseNumber (source);
@@ -400,39 +400,39 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source)
{
result = tokenType_operator;
if (source.peekNextChar() == T('-'))
if (source.peekNextChar() == '-')
source.skip();
else if (source.peekNextChar() == T('='))
else if (source.peekNextChar() == '=')
source.skip();
}
break;
case T('*'):
case T('%'):
case T('='):
case T('!'):
case '*':
case '%':
case '=':
case '!':
result = tokenType_operator;
source.skip();
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
source.skip();
break;
case T('/'):
case '/':
result = tokenType_operator;
source.skip();
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
{
source.skip();
}
else if (source.peekNextChar() == T('/'))
else if (source.peekNextChar() == '/')
{
result = tokenType_comment;
source.skipToEndOfLine();
}
else if (source.peekNextChar() == T('*'))
else if (source.peekNextChar() == '*')
{
source.skip();
result = tokenType_comment;
@@ -441,103 +441,103 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source)
break;
case T('?'):
case T('~'):
case '?':
case '~':
source.skip();
result = tokenType_operator;
break;
case T('<'):
case '<':
source.skip();
result = tokenType_operator;
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
{
source.skip();
}
else if (source.peekNextChar() == T('<'))
else if (source.peekNextChar() == '<')
{
source.skip();
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
source.skip();
}
break;
case T('>'):
case '>':
source.skip();
result = tokenType_operator;
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
{
source.skip();
}
else if (source.peekNextChar() == T('<'))
else if (source.peekNextChar() == '<')
{
source.skip();
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
source.skip();
}
break;
case T('|'):
case '|':
source.skip();
result = tokenType_operator;
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
{
source.skip();
}
else if (source.peekNextChar() == T('|'))
else if (source.peekNextChar() == '|')
{
source.skip();
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
source.skip();
}
break;
case T('&'):
case '&':
source.skip();
result = tokenType_operator;
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
{
source.skip();
}
else if (source.peekNextChar() == T('&'))
else if (source.peekNextChar() == '&')
{
source.skip();
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
source.skip();
}
break;
case T('^'):
case '^':
source.skip();
result = tokenType_operator;
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
{
source.skip();
}
else if (source.peekNextChar() == T('^'))
else if (source.peekNextChar() == '^')
{
source.skip();
if (source.peekNextChar() == T('='))
if (source.peekNextChar() == '=')
source.skip();
}
break;
case T('#'):
case '#':
result = tokenType_preprocessor;
source.skipToEndOfLine();
break;


+ 9
- 9
src/gui/components/code_editor/juce_CodeDocument.cpp View File

@@ -61,12 +61,12 @@ public:
while (t[pos] != 0)
{
if (t[pos] == T('\r'))
if (t[pos] == '\r')
{
++numNewLineChars;
++pos;
if (t[pos] == T('\n'))
if (t[pos] == '\n')
{
++numNewLineChars;
++pos;
@@ -75,7 +75,7 @@ public:
break;
}
if (t[pos] == T('\n'))
if (t[pos] == '\n')
{
++numNewLineChars;
++pos;
@@ -567,7 +567,7 @@ bool CodeDocument::writeToStream (OutputStream& stream)
void CodeDocument::setNewLineCharacters (const String& newLine) throw()
{
jassert (newLine == T("\r\n") || newLine == T("\n") || newLine == T("\r"));
jassert (newLine == "\r\n" || newLine == "\n" || newLine == "\r");
newLineChars = newLine;
}
@@ -617,8 +617,8 @@ const CodeDocument::Position CodeDocument::findWordBreakAfter (const Position& p
while (i < maxDistance
&& CharacterFunctions::isWhitespace (p.getCharacter())
&& (i == 0 || (p.getCharacter() != T('\n')
&& p.getCharacter() != T('\r'))))
&& (i == 0 || (p.getCharacter() != '\n'
&& p.getCharacter() != '\r')))
{
++i;
p.moveBy (1);
@@ -636,8 +636,8 @@ const CodeDocument::Position CodeDocument::findWordBreakAfter (const Position& p
while (i < maxDistance
&& CharacterFunctions::isWhitespace (p.getCharacter())
&& (i == 0 || (p.getCharacter() != T('\n')
&& p.getCharacter() != T('\r'))))
&& (i == 0 || (p.getCharacter() != '\n'
&& p.getCharacter() != '\r')))
{
++i;
p.moveBy (1);
@@ -658,7 +658,7 @@ const CodeDocument::Position CodeDocument::findWordBreakBefore (const Position&
{
const tchar c = p.movedBy (-1).getCharacter();
if (c == T('\r') || c == T('\n'))
if (c == '\r' || c == '\n')
{
stoppedAtLineStart = true;


+ 13
- 13
src/gui/components/code_editor/juce_CodeEditorComponent.cpp View File

@@ -245,7 +245,7 @@ private:
for (;;)
{
int tabPos = t.text.indexOfChar (T('\t'));
int tabPos = t.text.indexOfChar ('\t');
if (tabPos < 0)
break;
@@ -264,7 +264,7 @@ private:
int col = 0;
for (int i = 0; i < index; ++i)
{
if (line[i] != T('\t'))
if (line[i] != '\t')
++col;
else
col += spacesPerTab - (col % spacesPerTab);
@@ -636,7 +636,7 @@ void CodeEditorComponent::insertTabAtCaret()
}
else
{
insertTextAtCaret (T("\t"));
insertTextAtCaret ("\t");
}
}
@@ -952,28 +952,28 @@ bool CodeEditorComponent::keyPressed (const KeyPress& key)
{
deleteForward (moveInWholeWordSteps);
}
else if (key == KeyPress (T('c'), ModifierKeys::commandModifier, 0))
else if (key == KeyPress ('c', ModifierKeys::commandModifier, 0))
{
copy();
}
else if (key == KeyPress (T('x'), ModifierKeys::commandModifier, 0))
else if (key == KeyPress ('x', ModifierKeys::commandModifier, 0))
{
copyThenCut();
}
else if (key == KeyPress (T('v'), ModifierKeys::commandModifier, 0))
else if (key == KeyPress ('v', ModifierKeys::commandModifier, 0))
{
paste();
}
else if (key == KeyPress (T('z'), ModifierKeys::commandModifier, 0))
else if (key == KeyPress ('z', ModifierKeys::commandModifier, 0))
{
undo();
}
else if (key == KeyPress (T('y'), ModifierKeys::commandModifier, 0)
|| key == KeyPress (T('z'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0))
else if (key == KeyPress ('y', ModifierKeys::commandModifier, 0)
|| key == KeyPress ('z', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0))
{
redo();
}
else if (key == KeyPress (T('a'), ModifierKeys::commandModifier, 0))
else if (key == KeyPress ('a', ModifierKeys::commandModifier, 0))
{
selectAll();
}
@@ -1098,7 +1098,7 @@ int CodeEditorComponent::indexToColumn (int lineNum, int index) const throw()
int col = 0;
for (int i = 0; i < index; ++i)
{
if (line[i] != T('\t'))
if (line[i] != '\t')
++col;
else
col += getTabSize() - (col % getTabSize());
@@ -1115,7 +1115,7 @@ int CodeEditorComponent::columnToIndex (int lineNum, int column) const throw()
int i, col = 0;
for (i = 0; i < lineLength; ++i)
{
if (line[i] != T('\t'))
if (line[i] != '\t')
++col;
else
col += getTabSize() - (col % getTabSize());
@@ -1131,7 +1131,7 @@ int CodeEditorComponent::columnToIndex (int lineNum, int column) const throw()
void CodeEditorComponent::setFont (const Font& newFont)
{
font = newFont;
charWidth = font.getStringWidthFloat (T("0"));
charWidth = font.getStringWidthFloat ("0");
lineHeight = roundToInt (font.getHeight());
resized();
}


+ 1
- 1
src/gui/components/controls/juce_ListBox.cpp View File

@@ -767,7 +767,7 @@ bool ListBox::keyPressed (const KeyPress& key)
if (model != 0)
model->deleteKeyPressed (lastRowSelected);
}
else if (multiple && key == KeyPress (T('a'), ModifierKeys::commandModifier, 0))
else if (multiple && key == KeyPress ('a', ModifierKeys::commandModifier, 0))
{
selectRangeOfRows (0, std::numeric_limits<int>::max());
}


+ 1
- 1
src/gui/components/controls/juce_ProgressBar.cpp View File

@@ -74,7 +74,7 @@ void ProgressBar::paint (Graphics& g)
if (displayPercentage)
{
if (currentValue >= 0 && currentValue <= 1.0)
text << roundToInt (currentValue * 100.0) << T("%");
text << roundToInt (currentValue * 100.0) << '%';
}
else
{


+ 1
- 1
src/gui/components/controls/juce_Slider.cpp View File

@@ -647,7 +647,7 @@ double Slider::getValueFromText (const String& text)
if (t.endsWith (textSuffix))
t = t.substring (0, t.length() - textSuffix.length());
while (t.startsWithChar (T('+')))
while (t.startsWithChar ('+'))
t = t.substring (1).trimStart();
return t.initialSectionContainingOnly (T("0123456789.,-"))


+ 19
- 19
src/gui/components/controls/juce_TextEditor.cpp View File

@@ -47,7 +47,7 @@ struct TextAtom
//==============================================================================
bool isWhitespace() const { return CharacterFunctions::isWhitespace (atomText[0]); }
bool isNewLine() const { return atomText[0] == T('\r') || atomText[0] == T('\n'); }
bool isNewLine() const { return atomText[0] == '\r' || atomText[0] == '\n'; }
const String getText (const tchar passwordCharacter) const
{
@@ -285,30 +285,30 @@ private:
// create a whitespace atom unless it starts with non-ws
if (CharacterFunctions::isWhitespace (text[i])
&& text[i] != T('\r')
&& text[i] != T('\n'))
&& text[i] != '\r'
&& text[i] != '\n')
{
while (i < len
&& CharacterFunctions::isWhitespace (text[i])
&& text[i] != T('\r')
&& text[i] != T('\n'))
&& text[i] != '\r'
&& text[i] != '\n')
{
++i;
}
}
else
{
if (text[i] == T('\r'))
if (text[i] == '\r')
{
++i;
if ((i < len) && (text[i] == T('\n')))
if ((i < len) && (text[i] == '\n'))
{
++start;
++i;
}
}
else if (text[i] == T('\n'))
else if (text[i] == '\n')
{
++i;
}
@@ -1585,7 +1585,7 @@ void TextEditor::insertTextAtCaret (const String& newText_)
if (allowedCharacters.isNotEmpty())
newText = newText.retainCharacters (allowedCharacters);
if ((! returnKeyStartsNewLine) && newText == T("\n"))
if ((! returnKeyStartsNewLine) && newText == "\n")
{
returnPressed();
return;
@@ -1847,7 +1847,7 @@ void TextEditor::mouseDoubleClick (const MouseEvent& e)
{
while (tokenEnd < totalLength)
{
if (t [tokenEnd] != T('\r') && t [tokenEnd] != T('\n'))
if (t [tokenEnd] != '\r' && t [tokenEnd] != '\n')
++tokenEnd;
else
break;
@@ -1855,7 +1855,7 @@ void TextEditor::mouseDoubleClick (const MouseEvent& e)
while (tokenStart > 0)
{
if (t [tokenStart - 1] != T('\r') && t [tokenStart - 1] != T('\n'))
if (t [tokenStart - 1] != '\r' && t [tokenStart - 1] != '\n')
--tokenStart;
else
break;
@@ -1876,7 +1876,7 @@ void TextEditor::mouseWheelMove (const MouseEvent& e, float wheelIncrementX, flo
//==============================================================================
bool TextEditor::keyPressed (const KeyPress& key)
{
if (isReadOnly() && key != KeyPress (T('c'), ModifierKeys::commandModifier, 0))
if (isReadOnly() && key != KeyPress ('c', ModifierKeys::commandModifier, 0))
return false;
const bool moveInWholeWordSteps = key.getModifiers().isCtrlDown() || key.getModifiers().isAltDown();
@@ -1971,35 +1971,35 @@ bool TextEditor::keyPressed (const KeyPress& key)
cut();
}
else if (key == KeyPress (T('c'), ModifierKeys::commandModifier, 0)
else if (key == KeyPress ('c', ModifierKeys::commandModifier, 0)
|| key == KeyPress (KeyPress::insertKey, ModifierKeys::ctrlModifier, 0))
{
newTransaction();
copy();
}
else if (key == KeyPress (T('x'), ModifierKeys::commandModifier, 0))
else if (key == KeyPress ('x', ModifierKeys::commandModifier, 0))
{
newTransaction();
copy();
cut();
}
else if (key == KeyPress (T('v'), ModifierKeys::commandModifier, 0)
else if (key == KeyPress ('v', ModifierKeys::commandModifier, 0)
|| key == KeyPress (KeyPress::insertKey, ModifierKeys::shiftModifier, 0))
{
newTransaction();
paste();
}
else if (key == KeyPress (T('z'), ModifierKeys::commandModifier, 0))
else if (key == KeyPress ('z', ModifierKeys::commandModifier, 0))
{
newTransaction();
doUndoRedo (false);
}
else if (key == KeyPress (T('y'), ModifierKeys::commandModifier, 0))
else if (key == KeyPress ('y', ModifierKeys::commandModifier, 0))
{
newTransaction();
doUndoRedo (true);
}
else if (key == KeyPress (T('a'), ModifierKeys::commandModifier, 0))
else if (key == KeyPress ('a', ModifierKeys::commandModifier, 0))
{
newTransaction();
moveCursorTo (getTotalNumChars(), false);
@@ -2008,7 +2008,7 @@ bool TextEditor::keyPressed (const KeyPress& key)
else if (key == KeyPress::returnKey)
{
newTransaction();
insertTextAtCaret (T("\n"));
insertTextAtCaret ("\n");
}
else if (key.isKeyCode (KeyPress::escapeKey))
{


+ 2
- 2
src/gui/components/controls/juce_Toolbar.cpp View File

@@ -420,10 +420,10 @@ void Toolbar::setStyle (const ToolbarItemStyle& newStyle)
const String Toolbar::toString() const
{
String s (T("TB:"));
String s ("TB:");
for (int i = 0; i < getNumItems(); ++i)
s << getItemId(i) << T(' ');
s << getItemId(i) << ' ';
return s.trimEnd();
}


+ 11
- 11
src/gui/components/controls/juce_TreeView.cpp View File

@@ -583,7 +583,7 @@ XmlElement* TreeView::getOpennessState (const bool alsoIncludeScrollPosition) co
e = rootItem->getOpennessState();
if (e != 0 && alsoIncludeScrollPosition)
e->setAttribute (T("scrollPos"), viewport->getViewPositionY());
e->setAttribute ("scrollPos", viewport->getViewPositionY());
}
return e;
@@ -595,9 +595,9 @@ void TreeView::restoreOpennessState (const XmlElement& newState)
{
rootItem->restoreOpennessState (newState);
if (newState.hasAttribute (T("scrollPos")))
if (newState.hasAttribute ("scrollPos"))
viewport->setViewPosition (viewport->getViewPositionX(),
newState.getIntAttribute (T("scrollPos")));
newState.getIntAttribute ("scrollPos"));
}
}
@@ -1699,7 +1699,7 @@ const String TreeViewItem::getItemIdentifierString() const
if (parentItem != 0)
s = parentItem->getItemIdentifierString();
return s + T("/") + getUniqueName().replaceCharacter (T('/'), T('\\'));
return s + "/" + getUniqueName().replaceCharacter ('/', '\\');
}
TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString)
@@ -1709,7 +1709,7 @@ TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifi
if (uid == identifierString)
return this;
if (identifierString.startsWith (uid + T("/")))
if (identifierString.startsWith (uid + "/"))
{
const String remainingPath (identifierString.substring (uid.length() + 1));
@@ -1732,17 +1732,17 @@ TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifi
void TreeViewItem::restoreOpennessState (const XmlElement& e) throw()
{
if (e.hasTagName (T("CLOSED")))
if (e.hasTagName ("CLOSED"))
{
setOpen (false);
}
else if (e.hasTagName (T("OPEN")))
else if (e.hasTagName ("OPEN"))
{
setOpen (true);
forEachXmlChildElement (e, n)
{
const String id (n->getStringAttribute (T("id")));
const String id (n->getStringAttribute ("id"));
for (int i = 0; i < subItems.size(); ++i)
{
@@ -1768,17 +1768,17 @@ XmlElement* TreeViewItem::getOpennessState() const throw()
if (isOpen())
{
e = new XmlElement (T("OPEN"));
e = new XmlElement ("OPEN");
for (int i = 0; i < subItems.size(); ++i)
e->addChildElement (subItems.getUnchecked(i)->getOpennessState());
}
else
{
e = new XmlElement (T("CLOSED"));
e = new XmlElement ("CLOSED");
}
e->setAttribute (T("id"), name);
e->setAttribute ("id", name);
return e;
}


+ 3
- 3
src/gui/components/filebrowser/juce_DirectoryContentsList.cpp View File

@@ -121,7 +121,7 @@ void DirectoryContentsList::refresh()
jassert (fileFindHandle == 0);
fileFindHandle = juce_findFileStart (path, T("*"), fileFound,
fileFindHandle = juce_findFileStart (path, "*", fileFound,
&fileFoundIsDir,
&isHidden,
&fileSize,
@@ -265,8 +265,8 @@ bool DirectoryContentsList::addFile (const String& filename,
const Time& creationTime,
const bool isReadOnly)
{
if (filename == T("..")
|| filename == T(".")
if (filename == ".."
|| filename == "."
|| (ignoreHiddenFiles && isHidden))
return false;


+ 2
- 2
src/gui/components/filebrowser/juce_FileBrowserComponent.cpp View File

@@ -333,7 +333,7 @@ void FileBrowserComponent::selectionChanged()
}
if (newFilenames.size() > 0)
filenameBox->setText (newFilenames.joinIntoString (T(", ")), false);
filenameBox->setText (newFilenames.joinIntoString (", "), false);
sendListenerChangeMessage();
}
@@ -516,7 +516,7 @@ const BigInteger FileBrowserComponent::getRoots (StringArray& rootNames, StringA
{
const File& volume = volumes.getReference(i);
if (volume.isDirectory() && ! volume.getFileName().startsWithChar (T('.')))
if (volume.isDirectory() && ! volume.getFileName().startsWithChar ('.'))
{
rootPaths.add (volume.getFullPathName());
rootNames.add (volume.getFileName());


+ 1
- 1
src/gui/components/filebrowser/juce_FileChooser.cpp View File

@@ -49,7 +49,7 @@ FileChooser::FileChooser (const String& chooserBoxTitle,
#endif
if (! fileFilters.containsNonWhitespaceChars())
filters = T("*");
filters = "*";
}
FileChooser::~FileChooser()


+ 3
- 3
src/gui/components/filebrowser/juce_FileChooserDialogBox.cpp View File

@@ -106,9 +106,9 @@ void FileChooserDialogBox::buttonClicked (Button* button)
{
if (! AlertWindow::showOkCancelBox (AlertWindow::WarningIcon,
TRANS("File already exists"),
TRANS("There's already a file called:\n\n")
+ content->chooserComponent->getSelectedFile(0).getFullPathName()
+ T("\n\nAre you sure you want to overwrite it?"),
TRANS("There's already a file called:")
+ "\n\n" + content->chooserComponent->getSelectedFile(0).getFullPathName()
+ "\n\n" + TRANS("Are you sure you want to overwrite it?"),
TRANS("overwrite"),
TRANS("cancel")))
{


+ 3
- 3
src/gui/components/filebrowser/juce_FileChooserDialogBox.h View File

@@ -43,15 +43,15 @@
@code
{
WildcardFileFilter wildcardFilter (T("*.foo"), T("Foo files"));
WildcardFileFilter wildcardFilter ("*.foo", "Foo files");
FileBrowserComponent browser (FileBrowserComponent::loadFileMode,
File::nonexistent,
&wildcardFilter,
0);
FileChooserDialogBox dialogBox (T("Open some kind of file"),
T("Please choose some kind of file that you want to open..."),
FileChooserDialogBox dialogBox ("Open some kind of file",
"Please choose some kind of file that you want to open...",
browser,
getLookAndFeel().alertWindowBackground);


+ 1
- 1
src/gui/components/filebrowser/juce_FileListComponent.cpp View File

@@ -206,7 +206,7 @@ private:
{
if (icon == 0)
{
const int hashCode = (file.getFullPathName() + T("_iconCacheSalt")).hashCode();
const int hashCode = (file.getFullPathName() + "_iconCacheSalt").hashCode();
Image* im = ImageCache::getFromHashCode (hashCode);
if (im == 0 && ! onlyUpdateIfCached)


+ 2
- 2
src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp View File

@@ -153,7 +153,7 @@ void FileSearchPathListComponent::deleteKeyPressed (int row)
void FileSearchPathListComponent::returnKeyPressed (int row)
{
FileChooser chooser (TRANS("Change folder..."), path [row], T("*"));
FileChooser chooser (TRANS("Change folder..."), path [row], "*");
if (chooser.browseForDirectory())
{
@@ -234,7 +234,7 @@ void FileSearchPathListComponent::buttonClicked (Button* button)
if (start == File::nonexistent)
start = File::getCurrentWorkingDirectory();
FileChooser chooser (TRANS("Add a folder..."), start, T("*"));
FileChooser chooser (TRANS("Add a folder..."), start, "*");
if (chooser.browseForDirectory())
{


+ 1
- 1
src/gui/components/filebrowser/juce_FileTreeComponent.cpp View File

@@ -207,7 +207,7 @@ private:
{
if (icon == 0)
{
const int hashCode = (file.getFullPathName() + T("_iconCacheSalt")).hashCode();
const int hashCode = (file.getFullPathName() + "_iconCacheSalt").hashCode();
Image* im = ImageCache::getFromHashCode (hashCode);
if (im == 0 && ! onlyUpdateIfCached)


+ 2
- 2
src/gui/components/filebrowser/juce_FilenameComponent.cpp View File

@@ -50,14 +50,14 @@ FilenameComponent::FilenameComponent (const String& name,
wildcard (fileBrowserWildcard),
enforcedSuffix (enforcedSuffix_)
{
addAndMakeVisible (filenameBox = new ComboBox (T("fn")));
addAndMakeVisible (filenameBox = new ComboBox ("fn"));
filenameBox->setEditableText (canEditFilename);
filenameBox->addListener (this);
filenameBox->setTextWhenNothingSelected (textWhenNothingSelected);
filenameBox->setTextWhenNoChoicesAvailable (TRANS("(no recently seleced files)"));
browseButton = 0;
setBrowseButtonText (T("..."));
setBrowseButtonText ("...");
setCurrentFile (currentFile, true);
}


+ 4
- 4
src/gui/components/filebrowser/juce_WildcardFileFilter.cpp View File

@@ -35,7 +35,7 @@ WildcardFileFilter::WildcardFileFilter (const String& fileWildcardPatterns,
const String& directoryWildcardPatterns,
const String& description_)
: FileFilter (description_.isEmpty() ? fileWildcardPatterns
: (description_ + T(" (") + fileWildcardPatterns + T(")")))
: (description_ + " (" + fileWildcardPatterns + ")"))
{
parse (fileWildcardPatterns, fileWildcards);
parse (directoryWildcardPatterns, directoryWildcards);
@@ -58,7 +58,7 @@ bool WildcardFileFilter::isDirectorySuitable (const File& file) const
//==============================================================================
void WildcardFileFilter::parse (const String& pattern, StringArray& result) throw()
{
result.addTokens (pattern.toLowerCase(), T(";,"), T("\"'"));
result.addTokens (pattern.toLowerCase(), ";,", "\"'");
result.trim();
result.removeEmptyStrings();
@@ -66,8 +66,8 @@ void WildcardFileFilter::parse (const String& pattern, StringArray& result) thro
// special case for *.*, because people use it to mean "any file", but it
// would actually ignore files with no extension.
for (int i = result.size(); --i >= 0;)
if (result[i] == T("*.*"))
result.set (i, T("*"));
if (result[i] == "*.*")
result.set (i, "*");
}
bool WildcardFileFilter::match (const File& file, const StringArray& wildcards) throw()


+ 1
- 1
src/gui/components/juce_Component.cpp View File

@@ -1784,7 +1784,7 @@ static const var::identifier getColourPropertyId (const int colourId)
{
String s;
s.preallocateStorage (18);
s << T("jcclr_") << String::toHexString (colourId);
s << "jcclr_" << String::toHexString (colourId);
return s;
}


+ 1
- 1
src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp View File

@@ -331,7 +331,7 @@ bool KeyMappingEditorComponent::mightContainSubItems()
const String KeyMappingEditorComponent::getUniqueName() const
{
return T("keys");
return "keys";
}
void KeyMappingEditorComponent::setColours (const Colour& mainBackground,


+ 56
- 53
src/gui/components/keyboard/juce_KeyPress.cpp View File

@@ -96,36 +96,39 @@ bool KeyPress::isCurrentlyDown() const throw()
}
//==============================================================================
struct KeyNameAndCode
namespace KeyPressHelpers
{
const char* name;
int code;
};
struct KeyNameAndCode
{
const char* name;
int code;
};
static const KeyNameAndCode keyNameTranslations[] =
{
{ "spacebar", KeyPress::spaceKey },
{ "return", KeyPress::returnKey },
{ "escape", KeyPress::escapeKey },
{ "backspace", KeyPress::backspaceKey },
{ "cursor left", KeyPress::leftKey },
{ "cursor right", KeyPress::rightKey },
{ "cursor up", KeyPress::upKey },
{ "cursor down", KeyPress::downKey },
{ "page up", KeyPress::pageUpKey },
{ "page down", KeyPress::pageDownKey },
{ "home", KeyPress::homeKey },
{ "end", KeyPress::endKey },
{ "delete", KeyPress::deleteKey },
{ "insert", KeyPress::insertKey },
{ "tab", KeyPress::tabKey },
{ "play", KeyPress::playKey },
{ "stop", KeyPress::stopKey },
{ "fast forward", KeyPress::fastForwardKey },
{ "rewind", KeyPress::rewindKey }
};
static const tchar* const numberPadPrefix = T("numpad ");
static const KeyNameAndCode translations[] =
{
{ "spacebar", KeyPress::spaceKey },
{ "return", KeyPress::returnKey },
{ "escape", KeyPress::escapeKey },
{ "backspace", KeyPress::backspaceKey },
{ "cursor left", KeyPress::leftKey },
{ "cursor right", KeyPress::rightKey },
{ "cursor up", KeyPress::upKey },
{ "cursor down", KeyPress::downKey },
{ "page up", KeyPress::pageUpKey },
{ "page down", KeyPress::pageDownKey },
{ "home", KeyPress::homeKey },
{ "end", KeyPress::endKey },
{ "delete", KeyPress::deleteKey },
{ "insert", KeyPress::insertKey },
{ "tab", KeyPress::tabKey },
{ "play", KeyPress::playKey },
{ "stop", KeyPress::stopKey },
{ "fast forward", KeyPress::fastForwardKey },
{ "rewind", KeyPress::rewindKey }
};
static const String numberPadPrefix() { return "numpad "; }
}
//==============================================================================
const KeyPress KeyPress::createFromDescription (const String& desc) throw()
@@ -151,11 +154,11 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw()
int key = 0;
for (int i = 0; i < numElementsInArray (keyNameTranslations); ++i)
for (int i = 0; i < numElementsInArray (KeyPressHelpers::translations); ++i)
{
if (desc.containsWholeWordIgnoreCase (String (keyNameTranslations[i].name)))
if (desc.containsWholeWordIgnoreCase (String (KeyPressHelpers::translations[i].name)))
{
key = keyNameTranslations[i].code;
key = KeyPressHelpers::translations[i].code;
break;
}
}
@@ -163,23 +166,23 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw()
if (key == 0)
{
// see if it's a numpad key..
if (desc.containsIgnoreCase (numberPadPrefix))
if (desc.containsIgnoreCase (KeyPressHelpers::numberPadPrefix()))
{
const tchar lastChar = desc.trimEnd().getLastCharacter();
if (lastChar >= T('0') && lastChar <= T('9'))
key = numberPad0 + lastChar - T('0');
else if (lastChar == T('+'))
if (lastChar >= '0' && lastChar <= '9')
key = numberPad0 + lastChar - '0';
else if (lastChar == '+')
key = numberPadAdd;
else if (lastChar == T('-'))
else if (lastChar == '-')
key = numberPadSubtract;
else if (lastChar == T('*'))
else if (lastChar == '*')
key = numberPadMultiply;
else if (lastChar == T('/'))
else if (lastChar == '/')
key = numberPadDivide;
else if (lastChar == T('.'))
else if (lastChar == '.')
key = numberPadDecimalPoint;
else if (lastChar == T('='))
else if (lastChar == '=')
key = numberPadEquals;
else if (desc.endsWith (T("separator")))
key = numberPadSeparator;
@@ -191,7 +194,7 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw()
{
// see if it's a function key..
for (int i = 1; i <= 12; ++i)
if (desc.containsWholeWordIgnoreCase (T("f") + String (i)))
if (desc.containsWholeWordIgnoreCase ("f" + String (i)))
key = F1Key + i - 1;
if (key == 0)
@@ -221,7 +224,7 @@ const String KeyPress::getTextDescription() const throw()
{
// some keyboard layouts use a shift-key to get the slash, but in those cases, we
// want to store it as being a slash, not shift+whatever.
if (textCharacter == T('/'))
if (textCharacter == '/')
return "/";
if (mods.isCtrlDown())
@@ -243,30 +246,30 @@ const String KeyPress::getTextDescription() const throw()
desc << "alt + ";
#endif
for (int i = 0; i < numElementsInArray (keyNameTranslations); ++i)
if (keyCode == keyNameTranslations[i].code)
return desc + keyNameTranslations[i].name;
for (int i = 0; i < numElementsInArray (KeyPressHelpers::translations); ++i)
if (keyCode == KeyPressHelpers::translations[i].code)
return desc + KeyPressHelpers::translations[i].name;
if (keyCode >= F1Key && keyCode <= F16Key)
desc << 'F' << (1 + keyCode - F1Key);
else if (keyCode >= numberPad0 && keyCode <= numberPad9)
desc << numberPadPrefix << (keyCode - numberPad0);
desc << KeyPressHelpers::numberPadPrefix() << (keyCode - numberPad0);
else if (keyCode >= 33 && keyCode < 176)
desc += CharacterFunctions::toUpperCase ((tchar) keyCode);
else if (keyCode == numberPadAdd)
desc << numberPadPrefix << '+';
desc << KeyPressHelpers::numberPadPrefix() << '+';
else if (keyCode == numberPadSubtract)
desc << numberPadPrefix << '-';
desc << KeyPressHelpers::numberPadPrefix() << '-';
else if (keyCode == numberPadMultiply)
desc << numberPadPrefix << '*';
desc << KeyPressHelpers::numberPadPrefix() << '*';
else if (keyCode == numberPadDivide)
desc << numberPadPrefix << '/';
desc << KeyPressHelpers::numberPadPrefix() << '/';
else if (keyCode == numberPadSeparator)
desc << numberPadPrefix << "separator";
desc << KeyPressHelpers::numberPadPrefix() << "separator";
else if (keyCode == numberPadDecimalPoint)
desc << numberPadPrefix << '.';
desc << KeyPressHelpers::numberPadPrefix() << '.';
else if (keyCode == numberPadDelete)
desc << numberPadPrefix << "delete";
desc << KeyPressHelpers::numberPadPrefix() << "delete";
else
desc << '#' << String::toHexString (keyCode);
}


+ 14
- 14
src/gui/components/keyboard/juce_KeyPressMappingSet.cpp View File

@@ -233,9 +233,9 @@ void KeyPressMappingSet::invokeCommand (const CommandID commandID,
//==============================================================================
bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion)
{
if (xmlVersion.hasTagName (T("KEYMAPPINGS")))
if (xmlVersion.hasTagName ("KEYMAPPINGS"))
{
if (xmlVersion.getBoolAttribute (T("basedOnDefaults"), true))
if (xmlVersion.getBoolAttribute ("basedOnDefaults", true))
{
// if the XML was created as a set of differences from the default mappings,
// (i.e. by calling createXml (true)), then we need to first restore the defaults.
@@ -250,17 +250,17 @@ bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion)
forEachXmlChildElement (xmlVersion, map)
{
const CommandID commandId = map->getStringAttribute (T("commandId")).getHexValue32();
const CommandID commandId = map->getStringAttribute ("commandId").getHexValue32();
if (commandId != 0)
{
const KeyPress key (KeyPress::createFromDescription (map->getStringAttribute (T("key"))));
const KeyPress key (KeyPress::createFromDescription (map->getStringAttribute ("key")));
if (map->hasTagName (T("MAPPING")))
if (map->hasTagName ("MAPPING"))
{
addKeyPress (commandId, key);
}
else if (map->hasTagName (T("UNMAPPING")))
else if (map->hasTagName ("UNMAPPING"))
{
if (containsMapping (commandId, key))
removeKeyPress (key);
@@ -284,9 +284,9 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault
defaultSet->resetToDefaultMappings();
}
XmlElement* const doc = new XmlElement (T("KEYMAPPINGS"));
XmlElement* const doc = new XmlElement ("KEYMAPPINGS");
doc->setAttribute (T("basedOnDefaults"), saveDifferencesFromDefaultSet);
doc->setAttribute ("basedOnDefaults", saveDifferencesFromDefaultSet);
int i;
for (i = 0; i < mappings.size(); ++i)
@@ -300,9 +300,9 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault
{
XmlElement* const map = doc->createNewChildElement ("MAPPING");
map->setAttribute (T("commandId"), String::toHexString ((int) cm->commandID));
map->setAttribute (T("description"), commandManager->getDescriptionOfCommand (cm->commandID));
map->setAttribute (T("key"), cm->keypresses.getReference (j).getTextDescription());
map->setAttribute ("commandId", String::toHexString ((int) cm->commandID));
map->setAttribute ("description", commandManager->getDescriptionOfCommand (cm->commandID));
map->setAttribute ("key", cm->keypresses.getReference (j).getTextDescription());
}
}
}
@@ -319,9 +319,9 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault
{
XmlElement* const map = doc->createNewChildElement ("UNMAPPING");
map->setAttribute (T("commandId"), String::toHexString ((int) cm->commandID));
map->setAttribute (T("description"), commandManager->getDescriptionOfCommand (cm->commandID));
map->setAttribute (T("key"), cm->keypresses.getReference (j).getTextDescription());
map->setAttribute ("commandId", String::toHexString ((int) cm->commandID));
map->setAttribute ("description", commandManager->getDescriptionOfCommand (cm->commandID));
map->setAttribute ("key", cm->keypresses.getReference (j).getTextDescription());
}
}
}


+ 3
- 10
src/gui/components/lookandfeel/juce_LookAndFeel.cpp View File

@@ -87,15 +87,6 @@ static const Colour createBaseColour (const Colour& buttonColour,
return baseColour;
}
//==============================================================================
static String defaultSansName, defaultSerifName, defaultFixedName;
void clearUpDefaultFontNames() throw()
{
defaultSansName = String::empty;
defaultSerifName = String::empty;
defaultFixedName = String::empty;
}
//==============================================================================
LookAndFeel::LookAndFeel()
@@ -234,6 +225,8 @@ LookAndFeel::LookAndFeel()
for (int i = 0; i < numElementsInArray (standardColours); i += 2)
setColour (standardColours [i], Colour (standardColours [i + 1]));
static String defaultSansName, defaultSerifName, defaultFixedName;
if (defaultSansName.isEmpty())
Font::getPlatformDefaultFontNames (defaultSansName, defaultSerifName, defaultFixedName);
@@ -2381,7 +2374,7 @@ Button* LookAndFeel::createTabBarExtrasButton()
overImage.insertDrawable (ellipse);
overImage.insertDrawable (dp);
DrawableButton* db = new DrawableButton (T("tabs"), DrawableButton::ImageFitted);
DrawableButton* db = new DrawableButton ("tabs", DrawableButton::ImageFitted);
db->setImages (&normalImage, &overImage, 0);
return db;
}


+ 1
- 1
src/gui/components/menus/juce_PopupMenu.cpp View File

@@ -264,7 +264,7 @@ class PopupMenu::Window : public Component,
public:
//==============================================================================
Window()
: Component (T("menu")),
: Component ("menu"),
owner (0),
currentChild (0),
activeSubMenu (0),


+ 5
- 5
src/gui/components/properties/juce_PropertyPanel.cpp View File

@@ -385,7 +385,7 @@ void PropertyPanel::setSectionEnabled (const int sectionIndex, const bool should
//==============================================================================
XmlElement* PropertyPanel::getOpennessState() const
{
XmlElement* const xml = new XmlElement (T("PROPERTYPANELSTATE"));
XmlElement* const xml = new XmlElement ("PROPERTYPANELSTATE");
xml->setAttribute ("scrollPos", viewport->getViewPositionY());
@@ -406,14 +406,14 @@ XmlElement* PropertyPanel::getOpennessState() const
void PropertyPanel::restoreOpennessState (const XmlElement& xml)
{
if (xml.hasTagName (T("PROPERTYPANELSTATE")))
if (xml.hasTagName ("PROPERTYPANELSTATE"))
{
const StringArray sections (getSectionNames());
forEachXmlChildElementWithTagName (xml, e, T("SECTION"))
forEachXmlChildElementWithTagName (xml, e, "SECTION")
{
setSectionOpen (sections.indexOf (e->getStringAttribute (T("name"))),
e->getBoolAttribute (T("open")));
setSectionOpen (sections.indexOf (e->getStringAttribute ("name")),
e->getBoolAttribute ("open"));
}
viewport->setViewPosition (viewport->getViewPositionX(),


+ 4
- 4
src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp View File

@@ -401,7 +401,7 @@ public:
if (error.isNotEmpty())
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
T("Error when trying to open audio device!"),
"Error when trying to open audio device!",
error);
}
}
@@ -559,7 +559,7 @@ public:
for (int i = 0; i < numRates; ++i)
{
const int rate = roundToInt (currentDevice->getSampleRate (i));
sampleRateDropDown->addItem (String (rate) + T(" Hz"), rate);
sampleRateDropDown->addItem (String (rate) + " Hz", rate);
}
sampleRateDropDown->setSelectedId (roundToInt (currentDevice->getCurrentSampleRate()), true);
@@ -591,9 +591,9 @@ public:
{
const int bs = currentDevice->getBufferSizeSamples (i);
bufferSizeDropDown->addItem (String (bs)
+ T(" samples (")
+ " samples ("
+ String (bs * 1000.0 / currentRate, 1)
+ T(" ms)"),
+ " ms)",
bs);
}


+ 1
- 1
src/gui/components/special/juce_ColourSelector.cpp View File

@@ -508,7 +508,7 @@ void ColourSelector::paint (Graphics& g)
for (int i = 4; --i >= 0;)
{
if (sliders[i]->isVisible())
g.drawText (sliders[i]->getName() + T(":"),
g.drawText (sliders[i]->getName() + ":",
0, sliders[i]->getY(),
sliders[i]->getX() - 8, sliders[i]->getHeight(),
Justification::centredRight, false);


+ 3
- 10
src/gui/components/special/juce_DropShadower.cpp View File

@@ -231,10 +231,7 @@ void DropShadower::updateShadows()
{
// keep a cached version of the image to save doing the gaussian too often
String imageId;
imageId << shadowEdge << T(',')
<< xOffset << T(',')
<< yOffset << T(',')
<< alpha;
imageId << shadowEdge << ',' << xOffset << ',' << yOffset << ',' << alpha;
const int hash = imageId.hashCode();
@@ -329,12 +326,8 @@ void DropShadower::updateShadows()
bringShadowWindowsToFront();
}
void DropShadower::setShadowImage (Image* const src,
const int num,
const int w,
const int h,
const int sx,
const int sy)
void DropShadower::setShadowImage (Image* const src, const int num, const int w, const int h,
const int sx, const int sy)
{
shadowImageSections[num] = new Image (Image::ARGB, w, h, true);


+ 3
- 3
src/gui/components/windows/juce_AlertWindow.cpp View File

@@ -62,7 +62,7 @@ public:
void returnPressed()
{
// pass these up the component hierarchy to be trigger the buttons
getParentComponent()->keyPressed (KeyPress (KeyPress::returnKey, 0, T('\n')));
getParentComponent()->keyPressed (KeyPress (KeyPress::returnKey, 0, '\n'));
}
void escapePressed()
@@ -92,7 +92,7 @@ AlertWindow::AlertWindow (const String& title,
associatedComponent (associatedComponent_)
{
if (message.isEmpty())
text = T(" "); // to force an update if the message is empty
text = " "; // to force an update if the message is empty
setMessage (message);
@@ -140,7 +140,7 @@ void AlertWindow::setMessage (const String& message)
font.setHeight (15.0f);
Font titleFont (font.getHeight() * 1.1f, Font::bold);
textLayout.setText (getName() + T("\n\n"), titleFont);
textLayout.setText (getName() + "\n\n", titleFont);
textLayout.appendText (text, font);


+ 1
- 1
src/gui/components/windows/juce_DocumentWindow.cpp View File

@@ -353,7 +353,7 @@ void DocumentWindow::lookAndFeelChanged()
if (getCloseButton() != 0)
{
#if JUCE_MAC
getCloseButton()->addShortcut (KeyPress (T('w'), ModifierKeys::commandModifier, 0));
getCloseButton()->addShortcut (KeyPress ('w', ModifierKeys::commandModifier, 0));
#else
getCloseButton()->addShortcut (KeyPress (KeyPress::F4Key, ModifierKeys::altModifier, 0));
#endif


+ 1
- 1
src/gui/components/windows/juce_SplashScreen.h View File

@@ -47,7 +47,7 @@
{
SplashScreen* splash = new SplashScreen();
splash->show (T("welcome to my app"),
splash->show ("welcome to my app",
ImageCache::getFromFile (File ("/foobar/splash.jpg")),
4000, false);


+ 2
- 2
src/gui/components/windows/juce_ThreadWithProgressWindow.h View File

@@ -44,7 +44,7 @@
class MyTask : public ThreadWithProgressWindow
{
public:
MyTask() : ThreadWithProgressWindow (T("busy..."), true, true)
MyTask() : ThreadWithProgressWindow ("busy...", true, true)
{
}
@@ -112,7 +112,7 @@ public:
bool hasProgressBar,
bool hasCancelButton,
int timeOutMsWhenCancelling = 10000,
const String& cancelButtonText = JUCE_T("Cancel"));
const String& cancelButtonText = "Cancel");
/** Destructor. */
~ThreadWithProgressWindow();


+ 1
- 1
src/gui/graphics/drawables/juce_Drawable.cpp View File

@@ -105,7 +105,7 @@ Drawable* Drawable::createFromImageData (const void* data, const size_t numBytes
XmlDocument doc (asString);
ScopedPointer <XmlElement> outer (doc.getDocumentElement (true));
if (outer != 0 && outer->hasTagName (T("svg")))
if (outer != 0 && outer->hasTagName ("svg"))
{
ScopedPointer <XmlElement> svg (doc.getDocumentElement());


+ 1
- 1
src/gui/graphics/drawables/juce_DrawableComposite.cpp View File

@@ -185,7 +185,7 @@ Drawable* DrawableComposite::createCopy() const
//==============================================================================
ValueTree DrawableComposite::createValueTree() const throw()
{
ValueTree v (T("Group"));
ValueTree v ("Group");
if (getName().isNotEmpty())
v.setProperty ("id", getName(), 0);


+ 1
- 1
src/gui/graphics/drawables/juce_DrawableImage.cpp View File

@@ -146,7 +146,7 @@ Drawable* DrawableImage::createCopy() const
//==============================================================================
ValueTree DrawableImage::createValueTree() const throw()
{
ValueTree v (T("Image"));
ValueTree v ("Image");
if (getName().isNotEmpty())
v.setProperty ("id", getName(), 0);


+ 9
- 9
src/gui/graphics/drawables/juce_DrawablePath.cpp View File

@@ -168,12 +168,12 @@ static ValueTree createTreeForFillType (const String& tagName, const FillType& f
if (fillType.isColour())
{
v.setProperty ("type", T("solid"), 0);
v.setProperty ("type", "solid", 0);
v.setProperty ("colour", String::toHexString ((int) fillType.colour.getARGB()), 0);
}
else if (fillType.isGradient())
{
v.setProperty ("type", T("gradient"), 0);
v.setProperty ("type", "gradient", 0);
v.setProperty ("x1", fillType.gradient->x1, 0);
v.setProperty ("y1", fillType.gradient->y1, 0);
v.setProperty ("x2", fillType.gradient->x2, 0);
@@ -197,19 +197,19 @@ static ValueTree createTreeForFillType (const String& tagName, const FillType& f
ValueTree DrawablePath::createValueTree() const throw()
{
ValueTree v (T("Path"));
ValueTree v ("Path");
v.addChild (createTreeForFillType (T("fill"), mainFill), -1, 0);
v.addChild (createTreeForFillType (T("stroke"), strokeFill), -1, 0);
v.addChild (createTreeForFillType ("fill", mainFill), -1, 0);
v.addChild (createTreeForFillType ("stroke", strokeFill), -1, 0);
if (getName().isNotEmpty())
v.setProperty ("id", getName(), 0);
v.setProperty ("strokeWidth", (double) strokeType.getStrokeThickness(), 0);
v.setProperty ("jointStyle", strokeType.getJointStyle() == PathStrokeType::mitered
? T("miter") : (strokeType.getJointStyle() == PathStrokeType::curved ? T("curved") : T("bevel")), 0);
? "miter" : (strokeType.getJointStyle() == PathStrokeType::curved ? "curved" : "bevel"), 0);
v.setProperty ("capStyle", strokeType.getEndStyle() == PathStrokeType::butt
? T("butt") : (strokeType.getEndStyle() == PathStrokeType::square ? T("square") : T("round")), 0);
? "butt" : (strokeType.getEndStyle() == PathStrokeType::square ? "square" : "round"), 0);
v.setProperty ("path", path.toString(), 0);
return v;
@@ -223,8 +223,8 @@ DrawablePath* DrawablePath::createFromValueTree (const ValueTree& tree) throw()
DrawablePath* p = new DrawablePath();
p->setName (tree ["id"]);
p->mainFill = readFillTypeFromTree (tree.getChildWithName (T("fill")));
p->strokeFill = readFillTypeFromTree (tree.getChildWithName (T("stroke")));
p->mainFill = readFillTypeFromTree (tree.getChildWithName ("fill"));
p->strokeFill = readFillTypeFromTree (tree.getChildWithName ("stroke"));
const String jointStyle (tree ["jointStyle"].toString());
const String endStyle (tree ["capStyle"].toString());


+ 1
- 1
src/gui/graphics/drawables/juce_DrawableText.cpp View File

@@ -92,7 +92,7 @@ Drawable* DrawableText::createCopy() const
//==============================================================================
ValueTree DrawableText::createValueTree() const throw()
{
ValueTree v (T("Text"));
ValueTree v ("Text");
if (getName().isNotEmpty())
v.setProperty ("id", getName(), 0);


+ 143
- 143
src/gui/graphics/drawables/juce_SVGParser.cpp View File

@@ -52,26 +52,26 @@ public:
//==============================================================================
Drawable* parseSVGElement (const XmlElement& xml)
{
if (! xml.hasTagName (T("svg")))
if (! xml.hasTagName ("svg"))
return 0;
DrawableComposite* const drawable = new DrawableComposite();
drawable->setName (xml.getStringAttribute (T("id")));
drawable->setName (xml.getStringAttribute ("id"));
SVGState newState (*this);
if (xml.hasAttribute (T("transform")))
if (xml.hasAttribute ("transform"))
newState.addTransform (xml);
newState.elementX = getCoordLength (xml.getStringAttribute (T("x"), String (newState.elementX)), viewBoxW);
newState.elementY = getCoordLength (xml.getStringAttribute (T("y"), String (newState.elementY)), viewBoxH);
newState.width = getCoordLength (xml.getStringAttribute (T("width"), String (newState.width)), viewBoxW);
newState.height = getCoordLength (xml.getStringAttribute (T("height"), String (newState.height)), viewBoxH);
newState.elementX = getCoordLength (xml.getStringAttribute ("x", String (newState.elementX)), viewBoxW);
newState.elementY = getCoordLength (xml.getStringAttribute ("y", String (newState.elementY)), viewBoxH);
newState.width = getCoordLength (xml.getStringAttribute ("width", String (newState.width)), viewBoxW);
newState.height = getCoordLength (xml.getStringAttribute ("height", String (newState.height)), viewBoxH);
if (xml.hasAttribute (T("viewBox")))
if (xml.hasAttribute ("viewBox"))
{
const String viewParams (xml.getStringAttribute (T("viewBox")));
const String viewParams (xml.getStringAttribute ("viewBox"));
int i = 0;
float vx, vy, vw, vh;
@@ -85,7 +85,7 @@ public:
int placementFlags = 0;
const String aspect (xml.getStringAttribute (T("preserveAspectRatio")));
const String aspect (xml.getStringAttribute ("preserveAspectRatio"));
if (aspect.containsIgnoreCase (T("none")))
{
@@ -147,29 +147,29 @@ private:
{
Drawable* d = 0;
if (e->hasTagName (T("g")))
if (e->hasTagName ("g"))
d = parseGroupElement (*e);
else if (e->hasTagName (T("svg")))
else if (e->hasTagName ("svg"))
d = parseSVGElement (*e);
else if (e->hasTagName (T("path")))
else if (e->hasTagName ("path"))
d = parsePath (*e);
else if (e->hasTagName (T("rect")))
else if (e->hasTagName ("rect"))
d = parseRect (*e);
else if (e->hasTagName (T("circle")))
else if (e->hasTagName ("circle"))
d = parseCircle (*e);
else if (e->hasTagName (T("ellipse")))
else if (e->hasTagName ("ellipse"))
d = parseEllipse (*e);
else if (e->hasTagName (T("line")))
else if (e->hasTagName ("line"))
d = parseLine (*e);
else if (e->hasTagName (T("polyline")))
else if (e->hasTagName ("polyline"))
d = parsePolygon (*e, true);
else if (e->hasTagName (T("polygon")))
else if (e->hasTagName ("polygon"))
d = parsePolygon (*e, false);
else if (e->hasTagName (T("text")))
else if (e->hasTagName ("text"))
d = parseText (*e);
else if (e->hasTagName (T("switch")))
else if (e->hasTagName ("switch"))
d = parseSwitch (*e);
else if (e->hasTagName (T("style")))
else if (e->hasTagName ("style"))
parseCSSStyle (*e);
parentDrawable->insertDrawable (d);
@@ -178,7 +178,7 @@ private:
DrawableComposite* parseSwitch (const XmlElement& xml)
{
const XmlElement* const group = xml.getChildByName (T("g"));
const XmlElement* const group = xml.getChildByName ("g");
if (group != 0)
return parseGroupElement (*group);
@@ -190,9 +190,9 @@ private:
{
DrawableComposite* const drawable = new DrawableComposite();
drawable->setName (xml.getStringAttribute (T("id")));
drawable->setName (xml.getStringAttribute ("id"));
if (xml.hasAttribute (T("transform")))
if (xml.hasAttribute ("transform"))
{
SVGState newState (*this);
newState.addTransform (xml);
@@ -210,10 +210,10 @@ private:
//==============================================================================
Drawable* parsePath (const XmlElement& xml) const
{
const String d (xml.getStringAttribute (T("d")).trimStart());
const String d (xml.getStringAttribute ("d").trimStart());
Path path;
if (getStyleAttribute (&xml, T("fill-rule")).trim().equalsIgnoreCase (T("evenodd")))
if (getStyleAttribute (&xml, "fill-rule").trim().equalsIgnoreCase (T("evenodd")))
path.setUsingNonZeroWinding (false);
int index = 0;
@@ -223,7 +223,7 @@ private:
bool isRelative = true;
bool carryOn = true;
const String validCommandChars (T("MmLlHhVvCcSsQqTtAaZz"));
const String validCommandChars ("MmLlHhVvCcSsQqTtAaZz");
for (;;)
{
@@ -237,10 +237,10 @@ private:
switch (lastCommandChar)
{
case T('M'):
case T('m'):
case T('L'):
case T('l'):
case 'M':
case 'm':
case 'L':
case 'l':
if (parseCoords (d, x, y, index, false))
{
if (isRelative)
@@ -249,7 +249,7 @@ private:
y += lastY;
}
if (lastCommandChar == T('M') || lastCommandChar == T('m'))
if (lastCommandChar == 'M' || lastCommandChar == 'm')
path.startNewSubPath (x, y);
else
path.lineTo (x, y);
@@ -266,8 +266,8 @@ private:
break;
case T('H'):
case T('h'):
case 'H':
case 'h':
if (parseCoord (d, x, index, false, true))
{
if (isRelative)
@@ -284,8 +284,8 @@ private:
}
break;
case T('V'):
case T('v'):
case 'V':
case 'v':
if (parseCoord (d, y, index, false, false))
{
if (isRelative)
@@ -302,8 +302,8 @@ private:
}
break;
case T('C'):
case T('c'):
case 'C':
case 'c':
if (parseCoords (d, x, y, index, false)
&& parseCoords (d, x2, y2, index, false)
&& parseCoords (d, x3, y3, index, false))
@@ -331,8 +331,8 @@ private:
}
break;
case T('S'):
case T('s'):
case 'S':
case 's':
if (parseCoords (d, x, y, index, false)
&& parseCoords (d, x3, y3, index, false))
{
@@ -359,8 +359,8 @@ private:
}
break;
case T('Q'):
case T('q'):
case 'Q':
case 'q':
if (parseCoords (d, x, y, index, false)
&& parseCoords (d, x2, y2, index, false))
{
@@ -385,8 +385,8 @@ private:
}
break;
case T('T'):
case T('t'):
case 'T':
case 't':
if (parseCoords (d, x, y, index, false))
{
if (isRelative)
@@ -410,8 +410,8 @@ private:
}
break;
case T('A'):
case T('a'):
case 'A':
case 'a':
if (parseCoords (d, x, y, index, false))
{
String num;
@@ -470,8 +470,8 @@ private:
break;
case T('Z'):
case T('z'):
case 'Z':
case 'z':
path.closeSubPath();
while (CharacterFunctions::isWhitespace (d [index]))
++index;
@@ -494,31 +494,31 @@ private:
{
Path rect;
const bool hasRX = xml.hasAttribute (T("rx"));
const bool hasRY = xml.hasAttribute (T("ry"));
const bool hasRX = xml.hasAttribute ("rx");
const bool hasRY = xml.hasAttribute ("ry");
if (hasRX || hasRY)
{
float rx = getCoordLength (xml.getStringAttribute (T("rx")), viewBoxW);
float ry = getCoordLength (xml.getStringAttribute (T("ry")), viewBoxH);
float rx = getCoordLength (xml.getStringAttribute ("rx"), viewBoxW);
float ry = getCoordLength (xml.getStringAttribute ("ry"), viewBoxH);
if (! hasRX)
rx = ry;
else if (! hasRY)
ry = rx;
rect.addRoundedRectangle (getCoordLength (xml.getStringAttribute (T("x")), viewBoxW),
getCoordLength (xml.getStringAttribute (T("y")), viewBoxH),
getCoordLength (xml.getStringAttribute (T("width")), viewBoxW),
getCoordLength (xml.getStringAttribute (T("height")), viewBoxH),
rect.addRoundedRectangle (getCoordLength (xml.getStringAttribute ("x"), viewBoxW),
getCoordLength (xml.getStringAttribute ("y"), viewBoxH),
getCoordLength (xml.getStringAttribute ("width"), viewBoxW),
getCoordLength (xml.getStringAttribute ("height"), viewBoxH),
rx, ry);
}
else
{
rect.addRectangle (getCoordLength (xml.getStringAttribute (T("x")), viewBoxW),
getCoordLength (xml.getStringAttribute (T("y")), viewBoxH),
getCoordLength (xml.getStringAttribute (T("width")), viewBoxW),
getCoordLength (xml.getStringAttribute (T("height")), viewBoxH));
rect.addRectangle (getCoordLength (xml.getStringAttribute ("x"), viewBoxW),
getCoordLength (xml.getStringAttribute ("y"), viewBoxH),
getCoordLength (xml.getStringAttribute ("width"), viewBoxW),
getCoordLength (xml.getStringAttribute ("height"), viewBoxH));
}
return parseShape (xml, rect);
@@ -528,9 +528,9 @@ private:
{
Path circle;
const float cx = getCoordLength (xml.getStringAttribute (T("cx")), viewBoxW);
const float cy = getCoordLength (xml.getStringAttribute (T("cy")), viewBoxH);
const float radius = getCoordLength (xml.getStringAttribute (T("r")), viewBoxW);
const float cx = getCoordLength (xml.getStringAttribute ("cx"), viewBoxW);
const float cy = getCoordLength (xml.getStringAttribute ("cy"), viewBoxH);
const float radius = getCoordLength (xml.getStringAttribute ("r"), viewBoxW);
circle.addEllipse (cx - radius, cy - radius, radius * 2.0f, radius * 2.0f);
@@ -541,10 +541,10 @@ private:
{
Path ellipse;
const float cx = getCoordLength (xml.getStringAttribute (T("cx")), viewBoxW);
const float cy = getCoordLength (xml.getStringAttribute (T("cy")), viewBoxH);
const float radiusX = getCoordLength (xml.getStringAttribute (T("rx")), viewBoxW);
const float radiusY = getCoordLength (xml.getStringAttribute (T("ry")), viewBoxH);
const float cx = getCoordLength (xml.getStringAttribute ("cx"), viewBoxW);
const float cy = getCoordLength (xml.getStringAttribute ("cy"), viewBoxH);
const float radiusX = getCoordLength (xml.getStringAttribute ("rx"), viewBoxW);
const float radiusY = getCoordLength (xml.getStringAttribute ("ry"), viewBoxH);
ellipse.addEllipse (cx - radiusX, cy - radiusY, radiusX * 2.0f, radiusY * 2.0f);
@@ -555,10 +555,10 @@ private:
{
Path line;
const float x1 = getCoordLength (xml.getStringAttribute (T("x1")), viewBoxW);
const float y1 = getCoordLength (xml.getStringAttribute (T("y1")), viewBoxH);
const float x2 = getCoordLength (xml.getStringAttribute (T("x2")), viewBoxW);
const float y2 = getCoordLength (xml.getStringAttribute (T("y2")), viewBoxH);
const float x1 = getCoordLength (xml.getStringAttribute ("x1"), viewBoxW);
const float y1 = getCoordLength (xml.getStringAttribute ("y1"), viewBoxH);
const float x2 = getCoordLength (xml.getStringAttribute ("x2"), viewBoxW);
const float y2 = getCoordLength (xml.getStringAttribute ("y2"), viewBoxH);
line.startNewSubPath (x1, y1);
line.lineTo (x2, y2);
@@ -568,7 +568,7 @@ private:
Drawable* parsePolygon (const XmlElement& xml, const bool isPolyline) const
{
const String points (xml.getStringAttribute (T("points")));
const String points (xml.getStringAttribute ("points"));
Path path;
int index = 0;
@@ -600,7 +600,7 @@ private:
Drawable* parseShape (const XmlElement& xml, Path& path,
const bool shouldParseTransform = true) const
{
if (shouldParseTransform && xml.hasAttribute (T("transform")))
if (shouldParseTransform && xml.hasAttribute ("transform"))
{
SVGState newState (*this);
newState.addTransform (xml);
@@ -609,7 +609,7 @@ private:
}
DrawablePath* dp = new DrawablePath();
dp->setName (xml.getStringAttribute (T("id")));
dp->setName (xml.getStringAttribute ("id"));
dp->setFill (FillType (Colours::transparentBlack));
path.applyTransform (transform);
@@ -628,19 +628,19 @@ private:
}
dp->setFill (getPathFillType (path,
getStyleAttribute (&xml, T("fill")),
getStyleAttribute (&xml, T("fill-opacity")),
getStyleAttribute (&xml, T("opacity")),
getStyleAttribute (&xml, "fill"),
getStyleAttribute (&xml, "fill-opacity"),
getStyleAttribute (&xml, "opacity"),
containsClosedSubPath ? Colours::black
: Colours::transparentBlack));
const String strokeType (getStyleAttribute (&xml, T("stroke")));
const String strokeType (getStyleAttribute (&xml, "stroke"));
if (strokeType.isNotEmpty() && ! strokeType.equalsIgnoreCase (T("none")))
if (strokeType.isNotEmpty() && ! strokeType.equalsIgnoreCase ("none"))
{
dp->setStrokeFill (getPathFillType (path, strokeType,
getStyleAttribute (&xml, T("stroke-opacity")),
getStyleAttribute (&xml, T("opacity")),
getStyleAttribute (&xml, "stroke-opacity"),
getStyleAttribute (&xml, "opacity"),
Colours::transparentBlack));
dp->setStrokeType (getStrokeFor (&xml));
@@ -651,9 +651,9 @@ private:
const XmlElement* findLinkedElement (const XmlElement* e) const
{
const String id (e->getStringAttribute (T("xlink:href")));
const String id (e->getStringAttribute ("xlink:href"));
if (! id.startsWithChar (T('#')))
if (! id.startsWithChar ('#'))
return 0;
return findElementForId (topLevelXml, id.substring (1));
@@ -664,17 +664,17 @@ private:
if (fillXml == 0)
return;
forEachXmlChildElementWithTagName (*fillXml, e, T("stop"))
forEachXmlChildElementWithTagName (*fillXml, e, "stop")
{
int index = 0;
Colour col (parseColour (getStyleAttribute (e, T("stop-color")), index, Colours::black));
Colour col (parseColour (getStyleAttribute (e, "stop-color"), index, Colours::black));
const String opacity (getStyleAttribute (e, T("stop-opacity"), T("1")));
const String opacity (getStyleAttribute (e, "stop-opacity", "1"));
col = col.withMultipliedAlpha (jlimit (0.0f, 1.0f, opacity.getFloatValue()));
double offset = e->getDoubleAttribute (T("offset"));
double offset = e->getDoubleAttribute ("offset");
if (e->getStringAttribute (T("offset")).containsChar (T('%')))
if (e->getStringAttribute ("offset").containsChar ('%'))
offset *= 0.01;
cg.addColour (jlimit (0.0, 1.0, offset), col);
@@ -703,8 +703,8 @@ private:
const XmlElement* const fillXml = findElementForId (topLevelXml, id);
if (fillXml != 0
&& (fillXml->hasTagName (T("linearGradient"))
|| fillXml->hasTagName (T("radialGradient"))))
&& (fillXml->hasTagName ("linearGradient")
|| fillXml->hasTagName ("radialGradient")))
{
const XmlElement* inheritedFrom = findLinkedElement (fillXml);
@@ -729,14 +729,14 @@ private:
jassert (gradient.getNumColours() > 0);
gradient.isRadial = fillXml->hasTagName (T("radialGradient"));
gradient.isRadial = fillXml->hasTagName ("radialGradient");
float width = viewBoxW;
float height = viewBoxH;
float dx = 0.0f;
float dy = 0.0f;
const bool userSpace = fillXml->getStringAttribute (T("gradientUnits")).equalsIgnoreCase (T("userSpaceOnUse"));
const bool userSpace = fillXml->getStringAttribute ("gradientUnits").equalsIgnoreCase (T("userSpaceOnUse"));
if (! userSpace)
{
@@ -749,10 +749,10 @@ private:
if (gradient.isRadial)
{
gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute (T("cx"), T("50%")), width);
gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute (T("cy"), T("50%")), height);
gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("cx", "50%"), width);
gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("cy", "50%"), height);
const float radius = getCoordLength (fillXml->getStringAttribute (T("r"), T("50%")), width);
const float radius = getCoordLength (fillXml->getStringAttribute ("r", "50%"), width);
gradient.x2 = gradient.x1 + radius;
gradient.y2 = gradient.y1;
@@ -761,18 +761,18 @@ private:
}
else
{
gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute (T("x1"), T("0%")), width);
gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute (T("y1"), T("0%")), height);
gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("x1", "0%"), width);
gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("y1", "0%"), height);
gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute (T("x2"), T("100%")), width);
gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute (T("y2"), T("0%")), height);
gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute ("x2", "100%"), width);
gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute ("y2", "0%"), height);
if (gradient.x1 == gradient.x2 && gradient.y1 == gradient.y2)
return Colour (gradient.getColour (gradient.getNumColours() - 1));
}
FillType type (gradient);
type.transform = parseTransform (fillXml->getStringAttribute (T("gradientTransform")))
type.transform = parseTransform (fillXml->getStringAttribute ("gradientTransform"))
.followedBy (transform);
return type;
}
@@ -788,9 +788,9 @@ private:
const PathStrokeType getStrokeFor (const XmlElement* const xml) const
{
const String width (getStyleAttribute (xml, T("stroke-width")));
const String cap (getStyleAttribute (xml, T("stroke-linecap")));
const String join (getStyleAttribute (xml, T("stroke-linejoin")));
const String width (getStyleAttribute (xml, "stroke-width"));
const String cap (getStyleAttribute (xml, "stroke-linecap"));
const String join (getStyleAttribute (xml, "stroke-linejoin"));
//const String mitreLimit (getStyleAttribute (xml, T("stroke-miterlimit")));
//const String dashArray (getStyleAttribute (xml, T("stroke-dasharray")));
@@ -823,10 +823,10 @@ private:
{
Array <float> xCoords, yCoords, dxCoords, dyCoords;
getCoordList (xCoords, getInheritedAttribute (&xml, T("x")), true, true);
getCoordList (yCoords, getInheritedAttribute (&xml, T("y")), true, false);
getCoordList (dxCoords, getInheritedAttribute (&xml, T("dx")), true, true);
getCoordList (dyCoords, getInheritedAttribute (&xml, T("dy")), true, false);
getCoordList (xCoords, getInheritedAttribute (&xml, "x"), true, true);
getCoordList (yCoords, getInheritedAttribute (&xml, "y"), true, false);
getCoordList (dxCoords, getInheritedAttribute (&xml, "dx"), true, true);
getCoordList (dyCoords, getInheritedAttribute (&xml, "dy"), true, false);
//xxx not done text yet!
@@ -842,7 +842,7 @@ private:
Drawable* s = parseShape (*e, path);
delete s;
}
else if (e->hasTagName (T("tspan")))
else if (e->hasTagName ("tspan"))
{
Drawable* s = parseText (*e);
delete s;
@@ -855,7 +855,7 @@ private:
//==============================================================================
void addTransform (const XmlElement& xml)
{
transform = parseTransform (xml.getStringAttribute (T("transform")))
transform = parseTransform (xml.getStringAttribute ("transform"))
.followedBy (transform);
}
@@ -894,15 +894,15 @@ private:
const tchar n1 = s [len - 2];
const tchar n2 = s [len - 1];
if (n1 == T('i') && n2 == T('n'))
if (n1 == 'i' && n2 == 'n')
n *= dpi;
else if (n1 == T('m') && n2 == T('m'))
else if (n1 == 'm' && n2 == 'm')
n *= dpi / 25.4f;
else if (n1 == T('c') && n2 == T('m'))
else if (n1 == 'c' && n2 == 'm')
n *= dpi / 2.54f;
else if (n1 == T('p') && n2 == T('c'))
else if (n1 == 'p' && n2 == 'c')
n *= 15.0f;
else if (n2 == T('%'))
else if (n2 == '%')
n *= 0.01f * sizeForProportions;
}
@@ -922,7 +922,7 @@ private:
//==============================================================================
void parseCSSStyle (const XmlElement& xml)
{
cssStyleText = xml.getAllSubText() + T("\n") + cssStyleText;
cssStyleText = xml.getAllSubText() + "\n" + cssStyleText;
}
const String getStyleAttribute (const XmlElement* xml, const String& attributeName,
@@ -931,7 +931,7 @@ private:
if (xml->hasAttribute (attributeName))
return xml->getStringAttribute (attributeName, defaultValue);
const String styleAtt (xml->getStringAttribute (T("style")));
const String styleAtt (xml->getStringAttribute ("style"));
if (styleAtt.isNotEmpty())
{
@@ -940,22 +940,22 @@ private:
if (value.isNotEmpty())
return value;
}
else if (xml->hasAttribute (T("class")))
else if (xml->hasAttribute ("class"))
{
const String className (T(".") + xml->getStringAttribute (T("class")));
const String className ("." + xml->getStringAttribute ("class"));
int index = cssStyleText.indexOfIgnoreCase (className + T(" "));
int index = cssStyleText.indexOfIgnoreCase (className + " ");
if (index < 0)
index = cssStyleText.indexOfIgnoreCase (className + T("{"));
index = cssStyleText.indexOfIgnoreCase (className + "{");
if (index >= 0)
{
const int openBracket = cssStyleText.indexOfChar (index, T('{'));
const int openBracket = cssStyleText.indexOfChar (index, '{');
if (openBracket > index)
{
const int closeBracket = cssStyleText.indexOfChar (openBracket, T('}'));
const int closeBracket = cssStyleText.indexOfChar (openBracket, '}');
if (closeBracket > openBracket)
{
@@ -992,7 +992,7 @@ private:
//==============================================================================
static bool isIdentifierChar (const tchar c)
{
return CharacterFunctions::isLetter (c) || c == T('-');
return CharacterFunctions::isLetter (c) || c == '-';
}
static const String getAttributeFromStyleList (const String& list, const String& attributeName, const String& defaultValue)
@@ -1009,12 +1009,12 @@ private:
if ((i == 0 || (i > 0 && ! isIdentifierChar (list [i - 1])))
&& ! isIdentifierChar (list [i + attributeName.length()]))
{
i = list.indexOfChar (i, T(':'));
i = list.indexOfChar (i, ':');
if (i < 0)
break;
int end = list.indexOfChar (i, T(';'));
int end = list.indexOfChar (i, ';');
if (end < 0)
end = 0x7ffff;
@@ -1033,21 +1033,21 @@ private:
{
const tchar* const s = (const tchar*) source;
while (CharacterFunctions::isWhitespace (s[index]) || s[index] == T(','))
while (CharacterFunctions::isWhitespace (s[index]) || s[index] == ',')
++index;
int start = index;
if (CharacterFunctions::isDigit (s[index]) || s[index] == T('.') || s[index] == T('-'))
if (CharacterFunctions::isDigit (s[index]) || s[index] == '.' || s[index] == '-')
++index;
while (CharacterFunctions::isDigit (s[index]) || s[index] == T('.'))
while (CharacterFunctions::isDigit (s[index]) || s[index] == '.')
++index;
if ((s[index] == T('e') || s[index] == T('E'))
if ((s[index] == 'e' || s[index] == 'E')
&& (CharacterFunctions::isDigit (s[index + 1])
|| s[index + 1] == T('-')
|| s[index + 1] == T('+')))
|| s[index + 1] == '-'
|| s[index + 1] == '+'))
{
index += 2;
@@ -1066,7 +1066,7 @@ private:
value = String (s + start, index - start);
while (CharacterFunctions::isWhitespace (s[index]) || s[index] == T(','))
while (CharacterFunctions::isWhitespace (s[index]) || s[index] == ',')
++index;
return true;
@@ -1075,7 +1075,7 @@ private:
//==============================================================================
static const Colour parseColour (const String& s, int& index, const Colour& defaultColour)
{
if (s [index] == T('#'))
if (s [index] == '#')
{
uint32 hex [6];
zeromem (hex, sizeof (hex));
@@ -1100,23 +1100,23 @@ private:
(uint8) ((hex [2] << 4) + hex [3]),
(uint8) ((hex [4] << 4) + hex [5]));
}
else if (s [index] == T('r')
&& s [index + 1] == T('g')
&& s [index + 2] == T('b'))
else if (s [index] == 'r'
&& s [index + 1] == 'g'
&& s [index + 2] == 'b')
{
const int openBracket = s.indexOfChar (index, T('('));
const int closeBracket = s.indexOfChar (openBracket, T(')'));
const int openBracket = s.indexOfChar (index, '(');
const int closeBracket = s.indexOfChar (openBracket, ')');
if (openBracket >= 3 && closeBracket > openBracket)
{
index = closeBracket;
StringArray tokens;
tokens.addTokens (s.substring (openBracket + 1, closeBracket), T(","), T(""));
tokens.addTokens (s.substring (openBracket + 1, closeBracket), ",", "");
tokens.trim();
tokens.removeEmptyStrings();
if (tokens[0].containsChar (T('%')))
if (tokens[0].containsChar ('%'))
return Colour ((uint8) roundToInt (2.55 * tokens[0].getDoubleValue()),
(uint8) roundToInt (2.55 * tokens[1].getDoubleValue()),
(uint8) roundToInt (2.55 * tokens[2].getDoubleValue()));
@@ -1139,7 +1139,7 @@ private:
StringArray tokens;
tokens.addTokens (t.fromFirstOccurrenceOf (T("("), false, false)
.upToFirstOccurrenceOf (T(")"), false, false),
T(", "), String::empty);
", ", String::empty);
tokens.removeEmptyStrings (true);
@@ -1279,7 +1279,7 @@ private:
{
forEachXmlChildElement (*parent, e)
{
if (e->compareAttribute (T("id"), id))
if (e->compareAttribute ("id", id))
return e;
const XmlElement* const found = findElementForId (e, id);


+ 22
- 20
src/gui/graphics/fonts/juce_Font.cpp View File

@@ -36,15 +36,15 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
static const float minFontHeight = 0.1f;
static const float maxFontHeight = 10000.0f;
static const float defaultFontHeight = 14.0f;
static const tchar* const juce_defaultFontNameSans = T("<Sans-Serif>");
static const tchar* const juce_defaultFontNameSerif = T("<Serif>");
static const tchar* const juce_defaultFontNameMono = T("<Monospaced>");
namespace FontValues
{
static float limitFontHeight (const float height) throw()
{
return jlimit (0.1f, 10000.0f, height);
}
void clearUpDefaultFontNames() throw(); // in juce_LookAndFeel.cpp
static const float defaultFontHeight = 14.0f;
}
//==============================================================================
Font::SharedFontInternal::SharedFontInternal (const String& typefaceName_, const float height_, const float horizontalScale_,
@@ -74,13 +74,13 @@ Font::SharedFontInternal::SharedFontInternal (const SharedFontInternal& other) t
//==============================================================================
Font::Font() throw()
: font (new SharedFontInternal (juce_defaultFontNameSans, defaultFontHeight,
: font (new SharedFontInternal (getDefaultSansSerifFontName(), FontValues::defaultFontHeight,
1.0f, 0, 0, Font::plain, 0))
{
}
Font::Font (const float fontHeight, const int styleFlags_) throw()
: font (new SharedFontInternal (juce_defaultFontNameSans, jlimit (minFontHeight, maxFontHeight, fontHeight),
: font (new SharedFontInternal (getDefaultSansSerifFontName(), FontValues::limitFontHeight (fontHeight),
1.0f, 0, 0, styleFlags_, 0))
{
}
@@ -88,7 +88,7 @@ Font::Font (const float fontHeight, const int styleFlags_) throw()
Font::Font (const String& typefaceName_,
const float fontHeight,
const int styleFlags_) throw()
: font (new SharedFontInternal (typefaceName_, jlimit (minFontHeight, maxFontHeight, fontHeight),
: font (new SharedFontInternal (typefaceName_, FontValues::limitFontHeight (fontHeight),
1.0f, 0, 0, styleFlags_, 0))
{
}
@@ -109,7 +109,7 @@ Font::~Font() throw()
}
Font::Font (const Typeface::Ptr& typeface) throw()
: font (new SharedFontInternal (typeface->getName(), defaultFontHeight,
: font (new SharedFontInternal (typeface->getName(), FontValues::defaultFontHeight,
1.0f, 0, 0, Font::plain, typeface))
{
}
@@ -138,17 +138,20 @@ void Font::dupeInternalIfShared() throw()
//==============================================================================
const String Font::getDefaultSansSerifFontName() throw()
{
return juce_defaultFontNameSans;
static const String name ("<Sans-Serif>");
return name;
}
const String Font::getDefaultSerifFontName() throw()
{
return juce_defaultFontNameSerif;
static const String name ("<Serif>");
return name;
}
const String Font::getDefaultMonospacedFontName() throw()
{
return juce_defaultFontNameMono;
static const String name ("<Monospaced>");
return name;
}
void Font::setTypefaceName (const String& faceName) throw()
@@ -178,7 +181,7 @@ void Font::setFallbackFontName (const String& name) throw()
//==============================================================================
void Font::setHeight (float newHeight) throw()
{
newHeight = jlimit (minFontHeight, maxFontHeight, newHeight);
newHeight = FontValues::limitFontHeight (newHeight);
if (font->height != newHeight)
{
@@ -189,7 +192,7 @@ void Font::setHeight (float newHeight) throw()
void Font::setHeightWithoutChangingWidth (float newHeight) throw()
{
newHeight = jlimit (minFontHeight, maxFontHeight, newHeight);
newHeight = FontValues::limitFontHeight (newHeight);
if (font->height != newHeight)
{
@@ -215,7 +218,7 @@ void Font::setSizeAndStyle (float newHeight,
const float newHorizontalScale,
const float newKerningAmount) throw()
{
newHeight = jlimit (minFontHeight, maxFontHeight, newHeight);
newHeight = FontValues::limitFontHeight (newHeight);
if (font->height != newHeight
|| font->horizontalScale != newHorizontalScale
@@ -332,7 +335,7 @@ void Font::findFonts (Array<Font>& destArray) throw()
const StringArray names (findAllTypefaceNames());
for (int i = 0; i < names.size(); ++i)
destArray.add (Font (names[i], defaultFontHeight, Font::plain));
destArray.add (Font (names[i], FontValues::defaultFontHeight, Font::plain));
}
@@ -349,7 +352,6 @@ public:
~TypefaceCache()
{
clearUpDefaultFontNames();
clearSingletonInstance();
}


+ 2
- 2
src/gui/graphics/fonts/juce_Font.h View File

@@ -169,7 +169,7 @@ public:
static const String getDefaultMonospacedFontName() throw();
/** Returns the typeface names of the default fonts on the current platform. */
static void getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw();
static void getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed);
//==============================================================================
/** Returns the total height of this font.
@@ -331,7 +331,7 @@ public:
You can use this instead of findFonts() if you only need their names, and not
font objects.
*/
static const StringArray findAllTypefaceNames() throw();
static const StringArray findAllTypefaceNames();
//==============================================================================
/** Returns the name of the typeface to be used for rendering glyphs that aren't found


+ 10
- 10
src/gui/graphics/fonts/juce_GlyphArrangement.cpp View File

@@ -235,7 +235,7 @@ int GlyphArrangement::insertEllipsis (const Font& font, const float maxXPos,
{
Array<int> dotGlyphs;
Array<float> dotXs;
font.getGlyphPositions (T(".."), dotGlyphs, dotXs);
font.getGlyphPositions ("..", dotGlyphs, dotXs);
const float dx = dotXs[1];
float xOffset = 0.0f, yOffset = 0.0f;
@@ -283,8 +283,8 @@ void GlyphArrangement::addJustifiedText (const Font& font,
{
int i = lineStartIndex;
if (glyphs.getUnchecked(i)->getCharacter() != T('\n')
&& glyphs.getUnchecked(i)->getCharacter() != T('\r'))
if (glyphs.getUnchecked(i)->getCharacter() != '\n'
&& glyphs.getUnchecked(i)->getCharacter() != '\r')
++i;
const float lineMaxX = glyphs.getUnchecked (lineStartIndex)->getLeft() + maxLineWidth;
@@ -295,12 +295,12 @@ void GlyphArrangement::addJustifiedText (const Font& font,
const PositionedGlyph* pg = glyphs.getUnchecked (i);
const juce_wchar c = pg->getCharacter();
if (c == T('\r') || c == T('\n'))
if (c == '\r' || c == '\n')
{
++i;
if (c == T('\r') && i < glyphs.size()
&& glyphs.getUnchecked(i)->getCharacter() == T('\n'))
if (c == '\r' && i < glyphs.size()
&& glyphs.getUnchecked(i)->getCharacter() == '\n')
++i;
break;
@@ -481,7 +481,7 @@ void GlyphArrangement::addFittedText (const Font& f,
if ((glyphs.getUnchecked (i)->getRight() - lineStartX) * minimumHorizontalScale < width)
{
if (glyphs.getUnchecked (i)->isWhitespace()
|| glyphs.getUnchecked (i)->getCharacter() == T('-'))
|| glyphs.getUnchecked (i)->getCharacter() == '-')
{
++i;
break;
@@ -495,7 +495,7 @@ void GlyphArrangement::addFittedText (const Font& f,
for (int back = 1; back < jmin (5, i - startIndex - 1); ++back)
{
if (glyphs.getUnchecked (i - back)->isWhitespace()
|| glyphs.getUnchecked (i - back)->getCharacter() == T('-'))
|| glyphs.getUnchecked (i - back)->getCharacter() == '-')
{
i -= back - 1;
break;
@@ -718,8 +718,8 @@ void GlyphArrangement::justifyGlyphs (const int startIndex,
void GlyphArrangement::spreadOutLine (const int start, const int num, const float targetWidth)
{
if (start + num < glyphs.size()
&& glyphs.getUnchecked (start + num - 1)->getCharacter() != T('\r')
&& glyphs.getUnchecked (start + num - 1)->getCharacter() != T('\n'))
&& glyphs.getUnchecked (start + num - 1)->getCharacter() != '\r'
&& glyphs.getUnchecked (start + num - 1)->getCharacter() != '\n')
{
int numSpaces = 0;
int spacesAtEnd = 0;


+ 2
- 2
src/gui/graphics/fonts/juce_TextLayout.cpp View File

@@ -153,7 +153,7 @@ void TextLayout::appendText (const String& text,
break;
int charType;
if (c == T('\r') || c == T('\n'))
if (c == '\r' || c == '\n')
{
charType = 0;
}
@@ -176,7 +176,7 @@ void TextLayout::appendText (const String& text,
currentString = String::charToString (c);
if (c == T('\r') && *t == T('\n'))
if (c == '\r' && *t == '\n')
currentString += *t++;
}
else


+ 15
- 15
src/gui/graphics/geometry/juce_Path.cpp View File

@@ -1407,14 +1407,14 @@ const String Path::toString() const
{
String n (data.elements [i++], 3);
if (n.endsWithChar (T('0')))
if (n.endsWithChar ('0'))
{
do
{
n = n.dropLastCharacters (1);
} while (n.endsWithChar (T('0')));
} while (n.endsWithChar ('0'));
if (n.endsWithChar (T('.')))
if (n.endsWithChar ('.'))
n = n.dropLastCharacters (1);
}
@@ -1436,8 +1436,8 @@ void Path::restoreFromString (const String& stringVersion)
clear();
setUsingNonZeroWinding (true);
const tchar* t = stringVersion;
tchar marker = T('m');
const juce_wchar* t = stringVersion;
juce_wchar marker = 'm';
int numValues = 2;
float values [6];
@@ -1447,27 +1447,27 @@ void Path::restoreFromString (const String& stringVersion)
const tchar firstChar = token[0];
int startNum = 0;
if (firstChar == T('m') || firstChar == T('l'))
if (firstChar == 'm' || firstChar == 'l')
{
marker = firstChar;
numValues = 2;
}
else if (firstChar == T('q'))
else if (firstChar == 'q')
{
marker = firstChar;
numValues = 4;
}
else if (firstChar == T('c'))
else if (firstChar == 'c')
{
marker = firstChar;
numValues = 6;
}
else if (firstChar == T('z'))
else if (firstChar == 'z')
{
marker = firstChar;
numValues = 0;
}
else if (firstChar == T('a'))
else if (firstChar == 'a')
{
setUsingNonZeroWinding (false);
continue;
@@ -1483,26 +1483,26 @@ void Path::restoreFromString (const String& stringVersion)
switch (marker)
{
case T('m'):
case 'm':
startNewSubPath (values[0], values[1]);
break;
case T('l'):
case 'l':
lineTo (values[0], values[1]);
break;
case T('q'):
case 'q':
quadraticTo (values[0], values[1],
values[2], values[3]);
break;
case T('c'):
case 'c':
cubicTo (values[0], values[1],
values[2], values[3],
values[4], values[5]);
break;
case T('z'):
case 'z':
closeSubPath();
break;


+ 17
- 17
src/gui/graphics/geometry/juce_PositionedRectangle.cpp View File

@@ -108,11 +108,11 @@ const String PositionedRectangle::toString() const throw()
s.preallocateStorage (12);
addPosDescription (s, xMode, x);
s << T(' ');
s << ' ';
addPosDescription (s, yMode, y);
s << T(' ');
s << ' ';
addSizeDescription (s, wMode, w);
s << T(' ');
s << ' ';
addSizeDescription (s, hMode, h);
return s;
@@ -251,53 +251,53 @@ void PositionedRectangle::addPosDescription (String& s, const uint8 mode, const
{
if ((mode & proportionOfParentSize) != 0)
{
s << (roundToInt (value * 100000.0) / 1000.0) << T('%');
s << (roundToInt (value * 100000.0) / 1000.0) << '%';
}
else
{
s << (roundToInt (value * 100.0) / 100.0);
if ((mode & absoluteFromParentBottomRight) != 0)
s << T('R');
s << 'R';
else if ((mode & absoluteFromParentCentre) != 0)
s << T('C');
s << 'C';
}
if ((mode & anchorAtRightOrBottom) != 0)
s << T('r');
s << 'r';
else if ((mode & anchorAtCentre) != 0)
s << T('c');
s << 'c';
}
void PositionedRectangle::addSizeDescription (String& s, const uint8 mode, const double value) const throw()
{
if (mode == proportionalSize)
s << (roundToInt (value * 100000.0) / 1000.0) << T('%');
s << (roundToInt (value * 100000.0) / 1000.0) << '%';
else if (mode == parentSizeMinusAbsolute)
s << (roundToInt (value * 100.0) / 100.0) << T('M');
s << (roundToInt (value * 100.0) / 100.0) << 'M';
else
s << (roundToInt (value * 100.0) / 100.0);
}
void PositionedRectangle::decodePosString (const String& s, uint8& mode, double& value) throw()
{
if (s.containsChar (T('r')))
if (s.containsChar ('r'))
mode = anchorAtRightOrBottom;
else if (s.containsChar (T('c')))
else if (s.containsChar ('c'))
mode = anchorAtCentre;
else
mode = anchorAtLeftOrTop;
if (s.containsChar (T('%')))
if (s.containsChar ('%'))
{
mode |= proportionOfParentSize;
value = s.removeCharacters (T("%rcRC")).getDoubleValue() / 100.0;
}
else
{
if (s.containsChar (T('R')))
if (s.containsChar ('R'))
mode |= absoluteFromParentBottomRight;
else if (s.containsChar (T('C')))
else if (s.containsChar ('C'))
mode |= absoluteFromParentCentre;
else
mode |= absoluteFromParentTopLeft;
@@ -308,12 +308,12 @@ void PositionedRectangle::decodePosString (const String& s, uint8& mode, double&
void PositionedRectangle::decodeSizeString (const String& s, uint8& mode, double& value) throw()
{
if (s.containsChar (T('%')))
if (s.containsChar ('%'))
{
mode = proportionalSize;
value = s.upToFirstOccurrenceOf (T("%"), false, false).getDoubleValue() / 100.0;
}
else if (s.containsChar (T('M')))
else if (s.containsChar ('M'))
{
mode = parentSizeMinusAbsolute;
value = s.getDoubleValue();


+ 1
- 1
src/gui/graphics/geometry/juce_Rectangle.h View File

@@ -519,7 +519,7 @@ public:
static const Rectangle fromString (const String& stringVersion)
{
StringArray toks;
toks.addTokens (stringVersion.trim(), JUCE_T(",; \t\r\n"), String::empty);
toks.addTokens (stringVersion.trim(), ",; \t\r\n", String::empty);
return Rectangle (toks[0].trim().getIntValue(),
toks[1].trim().getIntValue(),


+ 2
- 3
src/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp View File

@@ -361,7 +361,7 @@ bool juce_writeJPEGImageToStream (const Image& image,
jpegCompStruct.dct_method = JDCT_FLOAT;
jpegCompStruct.optimize_coding = 1;
// jpegCompStruct.smoothing_factor = 10;
//jpegCompStruct.smoothing_factor = 10;
if (quality < 0.0f)
quality = 0.85f;
@@ -373,8 +373,7 @@ bool juce_writeJPEGImageToStream (const Image& image,
const int strideBytes = jpegCompStruct.image_width * jpegCompStruct.input_components;
JSAMPARRAY buffer = (*jpegCompStruct.mem->alloc_sarray) ((j_common_ptr) &jpegCompStruct,
JPOOL_IMAGE,
strideBytes, 1);
JPOOL_IMAGE, strideBytes, 1);
const Image::BitmapData srcData (image, 0, 0, jpegCompStruct.image_width, jpegCompStruct.image_height);


+ 3
- 3
src/gui/graphics/imaging/juce_ImageFileFormat.cpp View File

@@ -42,7 +42,7 @@ PNGImageFormat::~PNGImageFormat() {}
const String PNGImageFormat::getFormatName()
{
return T("PNG");
return "PNG";
}
bool PNGImageFormat::canUnderstand (InputStream& in)
@@ -85,7 +85,7 @@ void JPEGImageFormat::setQuality (const float newQuality)
const String JPEGImageFormat::getFormatName()
{
return T("JPEG");
return "JPEG";
}
bool JPEGImageFormat::canUnderstand (InputStream& in)
@@ -125,7 +125,7 @@ public:
const String getFormatName()
{
return T("GIF");
return "GIF";
}
bool canUnderstand (InputStream& in)


+ 1
- 1
src/io/files/juce_DirectoryIterator.cpp View File

@@ -60,7 +60,7 @@ DirectoryIterator::DirectoryIterator (const File& directory,
bool isDirectory, isHidden;
void* const handle = juce_findFileStart (path,
isRecursive ? T("*") : wc,
isRecursive ? "*" : wc,
filename, &isDirectory, &isHidden, 0, 0, 0, 0);
if (handle != 0)


+ 1
- 1
src/io/files/juce_DirectoryIterator.h View File

@@ -70,7 +70,7 @@ public:
*/
DirectoryIterator (const File& directory,
bool isRecursive,
const String& wildCard = JUCE_T("*"),
const String& wildCard = "*",
int whatToLookFor = File::findFiles);
/** Destructor. */


+ 30
- 30
src/io/files/juce_File.cpp View File

@@ -107,7 +107,7 @@ static const String parseAbsolutePath (String path)
#if JUCE_WINDOWS
// Windows..
path = path.replaceCharacter (T('/'), T('\\'));
path = path.replaceCharacter ('/', '\\');
if (path.startsWithChar (File::separator))
{
@@ -125,7 +125,7 @@ static const String parseAbsolutePath (String path)
path = File::getCurrentWorkingDirectory().getFullPathName().substring (0, 2) + path;
}
}
else if (path.indexOfChar (T(':')) < 0)
else if (path.indexOfChar (':') < 0)
{
if (path.isEmpty())
return String::empty;
@@ -143,9 +143,9 @@ static const String parseAbsolutePath (String path)
}
#else
// Mac or Linux..
path = path.replaceCharacter (T('\\'), T('/'));
path = path.replaceCharacter ('\\', '/');
if (path.startsWithChar (T('~')))
if (path.startsWithChar ('~'))
{
const char* homeDir = 0;
@@ -422,7 +422,7 @@ int64 File::hashCode64() const
const String File::getFileNameWithoutExtension() const
{
const int lastSlash = fullPath.lastIndexOfChar (separator) + 1;
const int lastDot = fullPath.lastIndexOfChar (T('.'));
const int lastDot = fullPath.lastIndexOfChar ('.');
if (lastDot > lastSlash)
return fullPath.substring (lastSlash, lastDot);
@@ -458,11 +458,11 @@ bool File::isAChildOf (const File& potentialParent) const
//==============================================================================
bool File::isAbsolutePath (const String& path)
{
return path.startsWithChar (T('/')) || path.startsWithChar (T('\\'))
return path.startsWithChar ('/') || path.startsWithChar ('\\')
#if JUCE_WINDOWS
|| (path.isNotEmpty() && ((const String&) path)[1] == T(':'));
|| (path.isNotEmpty() && path[1] == ':');
#else
|| path.startsWithChar (T('~'));
|| path.startsWithChar ('~');
#endif
}
@@ -478,16 +478,16 @@ const File File::getChildFile (String relativePath) const
// it's relative, so remove any ../ or ./ bits at the start.
String path (fullPath);
if (relativePath[0] == T('.'))
if (relativePath[0] == '.')
{
#if JUCE_WINDOWS
relativePath = relativePath.replaceCharacter (T('/'), T('\\')).trimStart();
relativePath = relativePath.replaceCharacter ('/', '\\').trimStart();
#else
relativePath = relativePath.replaceCharacter (T('\\'), T('/')).trimStart();
relativePath = relativePath.replaceCharacter ('\\', '/').trimStart();
#endif
while (relativePath[0] == T('.'))
while (relativePath[0] == '.')
{
if (relativePath[1] == T('.'))
if (relativePath[1] == '.')
{
if (relativePath [2] == 0 || relativePath[2] == separator)
{
@@ -772,7 +772,7 @@ bool File::containsSubDirectories() const
String filename;
bool itemIsDirectory, itemIsHidden;
void* const handle = juce_findFileStart (juce_addTrailingSeparator (fullPath),
T("*"), filename,
"*", filename,
&itemIsDirectory, &itemIsHidden, 0, 0, 0, 0);
if (handle != 0)
@@ -807,12 +807,12 @@ const File File::getNonexistentChildFile (const String& prefix_,
String prefix (prefix_);
// remove any bracketed numbers that may already be on the end..
if (prefix.trim().endsWithChar (T(')')))
if (prefix.trim().endsWithChar (')'))
{
putNumbersInBrackets = true;
const int openBracks = prefix.lastIndexOfChar (T('('));
const int closeBracks = prefix.lastIndexOfChar (T(')'));
const int openBracks = prefix.lastIndexOfChar ('(');
const int closeBracks = prefix.lastIndexOfChar (')');
if (openBracks > 0
&& closeBracks > openBracks
@@ -830,7 +830,7 @@ const File File::getNonexistentChildFile (const String& prefix_,
do
{
if (putNumbersInBrackets)
f = getChildFile (prefix + T('(') + String (num++) + T(')') + suffix);
f = getChildFile (prefix + '(' + String (num++) + ')' + suffix);
else
f = getChildFile (prefix + String (num++) + suffix);
@@ -862,7 +862,7 @@ const String File::getFileExtension() const
if (! isDirectory())
{
const int indexOfDot = fullPath.lastIndexOfChar (T('.'));
const int indexOfDot = fullPath.lastIndexOfChar ('.');
if (indexOfDot > fullPath.lastIndexOfChar (separator))
ext = fullPath.substring (indexOfDot);
@@ -874,9 +874,9 @@ const String File::getFileExtension() const
bool File::hasFileExtension (const String& possibleSuffix) const
{
if (possibleSuffix.isEmpty())
return fullPath.lastIndexOfChar (T('.')) <= fullPath.lastIndexOfChar (separator);
return fullPath.lastIndexOfChar ('.') <= fullPath.lastIndexOfChar (separator);
const int semicolon = possibleSuffix.indexOfChar (0, T(';'));
const int semicolon = possibleSuffix.indexOfChar (0, ';');
if (semicolon >= 0)
{
@@ -887,13 +887,13 @@ bool File::hasFileExtension (const String& possibleSuffix) const
{
if (fullPath.endsWithIgnoreCase (possibleSuffix))
{
if (possibleSuffix.startsWithChar (T('.')))
if (possibleSuffix.startsWithChar ('.'))
return true;
const int dotPos = fullPath.length() - possibleSuffix.length() - 1;
if (dotPos >= 0)
return fullPath [dotPos] == T('.');
return fullPath [dotPos] == '.';
}
}
@@ -907,11 +907,11 @@ const File File::withFileExtension (const String& newExtension) const
String filePart (getFileName());
int i = filePart.lastIndexOfChar (T('.'));
int i = filePart.lastIndexOfChar ('.');
if (i >= 0)
filePart = filePart.substring (0, i);
if (newExtension.isNotEmpty() && ! newExtension.startsWithChar (T('.')))
if (newExtension.isNotEmpty() && ! newExtension.startsWithChar ('.'))
filePart << '.';
return getSiblingFile (filePart + newExtension);
@@ -1002,7 +1002,7 @@ const String File::createLegalPathName (const String& original)
String s (original);
String start;
if (s[1] == T(':'))
if (s[1] == ':')
{
start = s.substring (0, 2);
s = s.substring (2);
@@ -1021,7 +1021,7 @@ const String File::createLegalFileName (const String& original)
if (len > maxLength)
{
const int lastDot = s.lastIndexOfChar (T('.'));
const int lastDot = s.lastIndexOfChar ('.');
if (lastDot > jmax (0, len - 12))
{
@@ -1083,9 +1083,9 @@ const String File::getRelativePathFrom (const File& dir) const
while (dirPath.isNotEmpty())
{
#if JUCE_WINDOWS
thisPath = T("..\\") + thisPath;
thisPath = "..\\" + thisPath;
#else
thisPath = T("../") + thisPath;
thisPath = "../" + thisPath;
#endif
const int sep = dirPath.indexOfChar (separator);
@@ -1126,7 +1126,7 @@ int File::getVolumeSerialNumber() const
const File File::createTempFile (const String& fileNameEnding)
{
const File tempFile (getSpecialLocation (tempDirectory)
.getChildFile (T("temp_") + String (Random::getSystemRandom().nextInt()))
.getChildFile ("temp_" + String (Random::getSystemRandom().nextInt()))
.withFileExtension (fileNameEnding));
if (tempFile.exists())


+ 2
- 2
src/io/files/juce_File.h View File

@@ -532,7 +532,7 @@ public:
int findChildFiles (Array<File>& results,
int whatToLookFor,
bool searchRecursively,
const String& wildCardPattern = JUCE_T("*")) const;
const String& wildCardPattern = "*") const;
/** Searches inside a directory and counts how many files match a wildcard pattern.
@@ -551,7 +551,7 @@ public:
@see findChildFiles, DirectoryIterator
*/
int getNumberOfChildFiles (int whatToLookFor,
const String& wildCardPattern = JUCE_T("*")) const;
const String& wildCardPattern = "*") const;
/** Returns true if this file is a directory that contains one or more subdirectories.
@see isDirectory, findChildFiles


+ 3
- 3
src/io/files/juce_FileSearchPath.cpp View File

@@ -59,7 +59,7 @@ FileSearchPath& FileSearchPath::operator= (const String& path)
void FileSearchPath::init (const String& path)
{
directories.clear();
directories.addTokens (path, T(";"), T("\""));
directories.addTokens (path, ";", "\"");
directories.trim();
directories.removeEmptyStrings();
@@ -81,10 +81,10 @@ const String FileSearchPath::toString() const
{
StringArray directories2 (directories);
for (int i = directories2.size(); --i >= 0;)
if (directories2[i].containsChar (T(';')))
if (directories2[i].containsChar (';'))
directories2.set (i, directories2[i].quoted());
return directories2.joinIntoString (T(";"));
return directories2.joinIntoString (";");
}
void FileSearchPath::add (const File& dir, const int insertIndex)


+ 1
- 1
src/io/files/juce_FileSearchPath.h View File

@@ -133,7 +133,7 @@ public:
int findChildFiles (Array<File>& results,
int whatToLookFor,
bool searchRecursively,
const String& wildCardPattern = JUCE_T("*")) const;
const String& wildCardPattern = "*") const;
//==============================================================================
/** Finds out whether a file is inside one of the path's directories.


+ 3
- 3
src/io/files/juce_TemporaryFile.cpp View File

@@ -36,7 +36,7 @@ BEGIN_JUCE_NAMESPACE
TemporaryFile::TemporaryFile (const String& suffix, const int optionFlags)
{
createTempFile (File::getSpecialLocation (File::tempDirectory),
T("temp_") + String (Random::getSystemRandom().nextInt()),
"temp_" + String (Random::getSystemRandom().nextInt()),
suffix,
optionFlags);
}
@@ -48,7 +48,7 @@ TemporaryFile::TemporaryFile (const File& targetFile_, const int optionFlags)
jassert (targetFile != File::nonexistent);
createTempFile (targetFile.getParentDirectory(),
targetFile.getFileNameWithoutExtension() + T("_temp") + String (Random::getSystemRandom().nextInt()),
targetFile.getFileNameWithoutExtension() + "_temp" + String (Random::getSystemRandom().nextInt()),
targetFile.getFileExtension(),
optionFlags);
}
@@ -57,7 +57,7 @@ void TemporaryFile::createTempFile (const File& parentDirectory, String name,
const String& suffix, const int optionFlags)
{
if ((optionFlags & useHiddenFile) != 0)
name = T(".") + name;
name = "." + name;
temporaryFile = parentDirectory.getNonexistentChildFile (name, suffix, (optionFlags & putNumbersInBrackets) != 0);
}


+ 1
- 1
src/io/files/juce_ZipFile.cpp View File

@@ -386,7 +386,7 @@ void ZipFile::uncompressTo (const File& targetDirectory,
const File targetFile (targetDirectory.getChildFile (zei.filename));
if (zei.filename.endsWithChar (T('/')))
if (zei.filename.endsWithChar ('/'))
{
targetFile.createDirectory(); // (entry is a directory, not a file)
}


+ 2
- 2
src/io/network/juce_Socket.cpp View File

@@ -488,7 +488,7 @@ StreamingSocket* StreamingSocket::waitForNextConnection() const
bool StreamingSocket::isLocal() const throw()
{
return hostName == T("127.0.0.1");
return hostName == "127.0.0.1";
}
@@ -625,7 +625,7 @@ int DatagramSocket::write (const void* sourceBuffer, const int numBytesToWrite)
bool DatagramSocket::isLocal() const throw()
{
return hostName == T("127.0.0.1");
return hostName == "127.0.0.1";
}


+ 26
- 32
src/io/network/juce_URL.cpp View File

@@ -41,14 +41,14 @@ URL::URL()
URL::URL (const String& url_)
: url (url_)
{
int i = url.indexOfChar (T('?'));
int i = url.indexOfChar ('?');
if (i >= 0)
{
do
{
const int nextAmp = url.indexOfChar (i + 1, T('&'));
const int equalsPos = url.indexOfChar (i + 1, T('='));
const int nextAmp = url.indexOfChar (i + 1, '&');
const int equalsPos = url.indexOfChar (i + 1, '=');
if (equalsPos > i + 1)
{
@@ -103,10 +103,10 @@ static const String getMangledParameters (const StringPairArray& parameters)
for (int i = 0; i < parameters.size(); ++i)
{
if (i > 0)
p += T("&");
p += '&';
p << URL::addEscapeChars (parameters.getAllKeys() [i], true)
<< T("=")
<< '='
<< URL::addEscapeChars (parameters.getAllValues() [i], true);
}
@@ -116,7 +116,7 @@ static const String getMangledParameters (const StringPairArray& parameters)
const String URL::toString (const bool includeGetParameters) const
{
if (includeGetParameters && parameters.size() > 0)
return url + T("?") + getMangledParameters (parameters);
return url + "?" + getMangledParameters (parameters);
else
return url;
}
@@ -135,17 +135,17 @@ static int findStartOfDomain (const String& url)
|| CharacterFunctions::indexOfChar (T("+-."), url[i], false) >= 0)
++i;
return url[i] == T(':') ? i + 1 : 0;
return url[i] == ':' ? i + 1 : 0;
}
const String URL::getDomain() const
{
int start = findStartOfDomain (url);
while (url[start] == T('/'))
while (url[start] == '/')
++start;
const int end1 = url.indexOfChar (start, T('/'));
const int end2 = url.indexOfChar (start, T(':'));
const int end1 = url.indexOfChar (start, '/');
const int end2 = url.indexOfChar (start, ':');
const int end = (end1 < 0 || end2 < 0) ? jmax (end1, end2)
: jmin (end1, end2);
@@ -156,10 +156,10 @@ const String URL::getDomain() const
const String URL::getSubPath() const
{
int start = findStartOfDomain (url);
while (url[start] == T('/'))
while (url[start] == '/')
++start;
const int startOfPath = url.indexOfChar (start, T('/')) + 1;
const int startOfPath = url.indexOfChar (start, '/') + 1;
return startOfPath <= 0 ? String::empty
: url.substring (startOfPath);
@@ -173,20 +173,20 @@ const String URL::getScheme() const
const URL URL::withNewSubPath (const String& newPath) const
{
int start = findStartOfDomain (url);
while (url[start] == T('/'))
while (url[start] == '/')
++start;
const int startOfPath = url.indexOfChar (start, T('/')) + 1;
const int startOfPath = url.indexOfChar (start, '/') + 1;
URL u (*this);
if (startOfPath > 0)
u.url = url.substring (0, startOfPath);
if (! u.url.endsWithChar (T('/')))
if (! u.url.endsWithChar ('/'))
u.url << '/';
if (newPath.startsWithChar (T('/')))
if (newPath.startsWithChar ('/'))
u.url << newPath.substring (1);
else
u.url << newPath;
@@ -202,19 +202,19 @@ bool URL::isProbablyAWebsiteURL (const String& possibleURL)
return true;
if (possibleURL.startsWithIgnoreCase (T("file:"))
|| possibleURL.containsChar (T('@'))
|| possibleURL.endsWithChar (T('.'))
|| (! possibleURL.containsChar (T('.'))))
|| possibleURL.containsChar ('@')
|| possibleURL.endsWithChar ('.')
|| (! possibleURL.containsChar ('.')))
return false;
if (possibleURL.startsWithIgnoreCase (T("www."))
&& possibleURL.substring (5).containsChar (T('.')))
&& possibleURL.substring (5).containsChar ('.'))
return true;
const char* commonTLDs[] = { "com", "net", "org", "uk", "de", "fr", "jp" };
for (int i = 0; i < numElementsInArray (commonTLDs); ++i)
if ((possibleURL + T("/")).containsIgnoreCase (T(".") + String (commonTLDs[i]) + T("/")))
if ((possibleURL + "/").containsIgnoreCase ("." + String (commonTLDs[i]) + "/"))
return true;
return false;
@@ -222,11 +222,11 @@ bool URL::isProbablyAWebsiteURL (const String& possibleURL)
bool URL::isProbablyAnEmailAddress (const String& possibleEmailAddress)
{
const int atSign = possibleEmailAddress.indexOfChar (T('@'));
const int atSign = possibleEmailAddress.indexOfChar ('@');
return atSign > 0
&& possibleEmailAddress.lastIndexOfChar (T('.')) > (atSign + 1)
&& (! possibleEmailAddress.endsWithChar (T('.')));
&& possibleEmailAddress.lastIndexOfChar ('.') > (atSign + 1)
&& (! possibleEmailAddress.endsWithChar ('.'));
}
//==============================================================================
@@ -269,7 +269,7 @@ public:
headers += extraHeaders;
if (! headers.endsWithChar (T('\n')))
if (! headers.endsWithChar ('\n'))
headers << "\r\n";
handle = juce_openInternetFile (server, headers, postData, isPost,
@@ -583,13 +583,7 @@ const String URL::addEscapeChars (const String& s, const bool isParameter)
else
{
const int v = (int) (uint8) c;
if (v < 0x10)
result << T("%0");
else
result << T('%');
result << String::toHexString (v);
result << (v < 0x10 ? "%0" : "%") << String::toHexString (v);
}
}


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save