Browse Source

Minor string changes.

tags/2021-05-28
Julian Storer 15 years ago
parent
commit
66643e85ac
74 changed files with 895 additions and 889 deletions
  1. +1
    -0
      extras/Jucer (experimental)/JuceLibraryCode/AppConfig.h
  2. +1
    -1
      extras/Jucer (experimental)/Jucer.jucer
  3. +1
    -1
      extras/amalgamator/Amalgamator.jucer
  4. +1
    -0
      extras/amalgamator/JuceLibraryCode/AppConfig.h
  5. +1
    -0
      extras/audio plugin host/JuceLibraryCode/AppConfig.h
  6. +1
    -1
      extras/audio plugin host/Plugin Host.jucer
  7. +1
    -1
      extras/audio plugins/demo/JuceDemoPlugin.jucer
  8. +1
    -0
      extras/audio plugins/demo/JuceLibraryCode/AppConfig.h
  9. +1
    -1
      extras/audio plugins/wrapper/RTAS/juce_RTAS_WinUtilities.cpp
  10. +22
    -22
      extras/audio plugins/wrapper/juce_PluginHostType.h
  11. +1
    -1
      extras/binarybuilder/BinaryBuilder.jucer
  12. +1
    -0
      extras/binarybuilder/JuceLibraryCode/AppConfig.h
  13. +4
    -4
      extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp
  14. +1
    -1
      extras/example projects/HelloWorld.jucer
  15. +1
    -0
      extras/example projects/JuceLibraryCode/AppConfig.h
  16. +1
    -1
      extras/juce demo/Juce Demo.jucer
  17. +1
    -0
      extras/juce demo/JuceLibraryCode/AppConfig.h
  18. +2
    -2
      extras/juce demo/Source/demos/AudioDemoLatencyPage.cpp
  19. +19
    -19
      extras/juce demo/Source/demos/TableDemo.cpp
  20. +6
    -6
      extras/juce demo/Source/demos/ThreadingDemo.cpp
  21. +9
    -9
      extras/juce demo/Source/demos/TreeViewDemo.cpp
  22. +134
    -134
      extras/juce demo/Source/demos/WidgetsDemo.cpp
  23. +307
    -311
      juce_amalgamated.cpp
  24. +39
    -36
      juce_amalgamated.h
  25. +1
    -1
      src/audio/audio_file_formats/juce_AudioCDReader.cpp
  26. +3
    -3
      src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm
  27. +6
    -6
      src/audio/plugins/juce_KnownPluginList.cpp
  28. +4
    -4
      src/containers/juce_Variant.cpp
  29. +2
    -2
      src/core/juce_Time.cpp
  30. +2
    -2
      src/cryptography/juce_RSAKey.cpp
  31. +2
    -2
      src/gui/components/code_editor/juce_CodeEditorComponent.cpp
  32. +1
    -1
      src/gui/components/controls/juce_Slider.cpp
  33. +3
    -3
      src/gui/components/controls/juce_TextEditor.cpp
  34. +1
    -1
      src/gui/components/controls/juce_Toolbar.cpp
  35. +1
    -1
      src/gui/components/juce_Component.cpp
  36. +13
    -13
      src/gui/components/keyboard/juce_KeyPress.cpp
  37. +1
    -1
      src/gui/components/menus/juce_PopupMenu.cpp
  38. +1
    -1
      src/gui/components/windows/juce_ResizableWindow.cpp
  39. +7
    -7
      src/gui/graphics/drawables/juce_DrawablePath.cpp
  40. +29
    -29
      src/gui/graphics/drawables/juce_SVGParser.cpp
  41. +2
    -2
      src/gui/graphics/fonts/juce_GlyphArrangement.cpp
  42. +3
    -3
      src/gui/graphics/fonts/juce_TextLayout.cpp
  43. +3
    -3
      src/gui/graphics/geometry/juce_PositionedRectangle.cpp
  44. +1
    -1
      src/io/files/juce_DirectoryIterator.cpp
  45. +7
    -7
      src/io/files/juce_File.cpp
  46. +7
    -7
      src/io/network/juce_URL.cpp
  47. +1
    -1
      src/native/common/juce_posix_SharedCode.h
  48. +3
    -3
      src/native/linux/juce_linux_Audio.cpp
  49. +2
    -2
      src/native/linux/juce_linux_Files.cpp
  50. +3
    -3
      src/native/linux/juce_linux_Fonts.cpp
  51. +6
    -6
      src/native/linux/juce_linux_JackAudio.cpp
  52. +7
    -9
      src/native/linux/juce_linux_Network.cpp
  53. +4
    -4
      src/native/linux/juce_linux_SystemStats.cpp
  54. +1
    -1
      src/native/linux/juce_linux_Windowing.cpp
  55. +1
    -1
      src/native/mac/juce_mac_FileChooser.mm
  56. +1
    -1
      src/native/mac/juce_mac_Files.mm
  57. +6
    -6
      src/native/mac/juce_mac_Fonts.mm
  58. +1
    -1
      src/native/mac/juce_mac_MainMenu.mm
  59. +5
    -5
      src/native/mac/juce_mac_Network.mm
  60. +2
    -2
      src/native/mac/juce_mac_WebBrowserComponent.mm
  61. +3
    -3
      src/native/windows/juce_win32_ASIO.cpp
  62. +2
    -2
      src/native/windows/juce_win32_CameraDevice.cpp
  63. +1
    -1
      src/native/windows/juce_win32_Fonts.cpp
  64. +1
    -1
      src/native/windows/juce_win32_Midi.cpp
  65. +2
    -2
      src/native/windows/juce_win32_Network.cpp
  66. +3
    -3
      src/native/windows/juce_win32_PlatformUtils.cpp
  67. +23
    -0
      src/text/juce_CharacterFunctions.cpp
  68. +1
    -0
      src/text/juce_CharacterFunctions.h
  69. +7
    -7
      src/text/juce_LocalisedStrings.cpp
  70. +100
    -125
      src/text/juce_String.cpp
  71. +40
    -37
      src/text/juce_String.h
  72. +1
    -1
      src/text/juce_StringArray.cpp
  73. +10
    -10
      src/text/juce_XmlDocument.cpp
  74. +1
    -1
      src/text/juce_XmlElement.cpp

+ 1
- 0
extras/Jucer (experimental)/JuceLibraryCode/AppConfig.h View File

@@ -28,6 +28,7 @@
//#define JUCE_USE_XINERAMA
//#define JUCE_USE_XSHM
//#define JUCE_USE_XRENDER
//#define JUCE_USE_XCURSOR
#define JUCE_PLUGINHOST_VST 0
#define JUCE_PLUGINHOST_AU 0
//#define JUCE_ONLY_BUILD_CORE_LIBRARY


+ 1
- 1
extras/Jucer (experimental)/Jucer.jucer View File

@@ -183,5 +183,5 @@
JUCE_USE_XINERAMA="default" JUCE_USE_XSHM="default" JUCE_ONLY_BUILD_CORE_LIBRARY="default"
JUCE_WEB_BROWSER="default" JUCE_SUPPORT_CARBON="default" JUCE_CHECK_MEMORY_LEAKS="default"
JUCE_CATCH_UNHANDLED_EXCEPTIONS="default" JUCE_STRINGS_ARE_UNICODE="default"
JUCE_USE_XRENDER="default"/>
JUCE_USE_XRENDER="default" JUCE_USE_XCURSOR="default"/>
</JUCERPROJECT>

+ 1
- 1
extras/amalgamator/Amalgamator.jucer View File

@@ -37,5 +37,5 @@
JUCE_PLUGINHOST_AU="default" JUCE_ONLY_BUILD_CORE_LIBRARY="enabled"
JUCE_WEB_BROWSER="default" JUCE_SUPPORT_CARBON="default" JUCE_CHECK_MEMORY_LEAKS="default"
JUCE_CATCH_UNHANDLED_EXCEPTIONS="default" JUCE_STRINGS_ARE_UNICODE="default"
JUCE_USE_XRENDER="default"/>
JUCE_USE_XRENDER="default" JUCE_USE_XCURSOR="default"/>
</JUCERPROJECT>

+ 1
- 0
extras/amalgamator/JuceLibraryCode/AppConfig.h View File

@@ -28,6 +28,7 @@
//#define JUCE_USE_XINERAMA
//#define JUCE_USE_XSHM
//#define JUCE_USE_XRENDER
//#define JUCE_USE_XCURSOR
//#define JUCE_PLUGINHOST_VST
//#define JUCE_PLUGINHOST_AU
#define JUCE_ONLY_BUILD_CORE_LIBRARY 1


+ 1
- 0
extras/audio plugin host/JuceLibraryCode/AppConfig.h View File

@@ -28,6 +28,7 @@
//#define JUCE_USE_XINERAMA
//#define JUCE_USE_XSHM
//#define JUCE_USE_XRENDER
//#define JUCE_USE_XCURSOR
#define JUCE_PLUGINHOST_VST 1
#define JUCE_PLUGINHOST_AU 1
//#define JUCE_ONLY_BUILD_CORE_LIBRARY


+ 1
- 1
extras/audio plugin host/Plugin Host.jucer View File

@@ -57,5 +57,5 @@
JUCE_PLUGINHOST_AU="enabled" JUCE_ONLY_BUILD_CORE_LIBRARY="default"
JUCE_WEB_BROWSER="default" JUCE_SUPPORT_CARBON="default" JUCE_CHECK_MEMORY_LEAKS="default"
JUCE_CATCH_UNHANDLED_EXCEPTIONS="default" JUCE_STRINGS_ARE_UNICODE="default"
JUCE_USE_XRENDER="default"/>
JUCE_USE_XRENDER="default" JUCE_USE_XCURSOR="default"/>
</JUCERPROJECT>

+ 1
- 1
extras/audio plugins/demo/JuceDemoPlugin.jucer View File

@@ -43,5 +43,5 @@
JUCE_USE_XINERAMA="default" JUCE_USE_XSHM="default" JUCE_USE_XRENDER="default"
JUCE_PLUGINHOST_VST="default" JUCE_PLUGINHOST_AU="default" JUCE_ONLY_BUILD_CORE_LIBRARY="default"
JUCE_WEB_BROWSER="default" JUCE_SUPPORT_CARBON="default" JUCE_CHECK_MEMORY_LEAKS="default"
JUCE_CATCH_UNHANDLED_EXCEPTIONS="default"/>
JUCE_CATCH_UNHANDLED_EXCEPTIONS="default" JUCE_USE_XCURSOR="default"/>
</JUCERPROJECT>

+ 1
- 0
extras/audio plugins/demo/JuceLibraryCode/AppConfig.h View File

@@ -28,6 +28,7 @@
//#define JUCE_USE_XINERAMA
//#define JUCE_USE_XSHM
//#define JUCE_USE_XRENDER
//#define JUCE_USE_XCURSOR
//#define JUCE_PLUGINHOST_VST
//#define JUCE_PLUGINHOST_AU
//#define JUCE_ONLY_BUILD_CORE_LIBRARY


+ 1
- 1
extras/audio plugins/wrapper/RTAS/juce_RTAS_WinUtilities.cpp View File

@@ -100,7 +100,7 @@ static HWND findMDIParentOf (HWND w)
zeromem (windowType, sizeof (windowType));
GetClassName (parent, windowType, 31);
if (String (windowType).equalsIgnoreCase (T("MDIClient")))
if (String (windowType).equalsIgnoreCase ("MDIClient"))
{
w = parent;
break;


+ 22
- 22
extras/audio plugins/wrapper/juce_PluginHostType.h View File

@@ -93,30 +93,30 @@ private:
const String hostFilename (File (hostPath).getFileName());
#if JUCE_MAC
if (hostPath.containsIgnoreCase (T("Live 6."))) return AbletonLive6;
if (hostPath.containsIgnoreCase (T("Live 7."))) return AbletonLive7;
if (hostPath.containsIgnoreCase (T("Live 8."))) return AbletonLive8;
if (hostFilename.containsIgnoreCase (T("Live"))) return AbletonLiveGeneric;
if (hostFilename.containsIgnoreCase (T("Pro Tools"))) return DigidesignProTools;
if (hostFilename.containsIgnoreCase (T("Cubase 4"))) return SteinbergCubase4;
if (hostFilename.containsIgnoreCase (T("Cubase 5"))) return SteinbergCubase5;
if (hostFilename.contains (T("Logic"))) return AppleLogic;
if (hostPath.containsIgnoreCase ("Live 6.")) return AbletonLive6;
if (hostPath.containsIgnoreCase ("Live 7.")) return AbletonLive7;
if (hostPath.containsIgnoreCase ("Live 8.")) return AbletonLive8;
if (hostFilename.containsIgnoreCase ("Live")) return AbletonLiveGeneric;
if (hostFilename.containsIgnoreCase ("Pro Tools")) return DigidesignProTools;
if (hostFilename.containsIgnoreCase ("Cubase 4")) return SteinbergCubase4;
if (hostFilename.containsIgnoreCase ("Cubase 5")) return SteinbergCubase5;
if (hostFilename.contains ("Logic")) return AppleLogic;
#elif JUCE_WINDOWS
if (hostFilename.containsIgnoreCase (T("Live 6."))) return AbletonLive6;
if (hostFilename.containsIgnoreCase (T("Live 7."))) return AbletonLive7;
if (hostFilename.containsIgnoreCase (T("Live 8."))) return AbletonLive8;
if (hostFilename.containsIgnoreCase (T("Live "))) return AbletonLiveGeneric;
if (hostFilename.containsIgnoreCase (T("ProTools"))) return DigidesignProTools;
if (hostPath.containsIgnoreCase (T("SONAR 8"))) return CakewalkSonar8;
if (hostFilename.containsIgnoreCase (T("SONAR"))) return CakewalkSonarGeneric;
if (hostPath.containsIgnoreCase (T("Tracktion 3"))) return MackieTracktion3;
if (hostFilename.containsIgnoreCase (T("Tracktion"))) return MackieTracktionGeneric;
if (hostFilename.containsIgnoreCase (T("Cubase4"))) return SteinbergCubase4;
if (hostFilename.containsIgnoreCase (T("Cubase5"))) return SteinbergCubase5;
if (hostFilename.containsIgnoreCase (T("Cubase"))) return SteinbergCubaseGeneric;
if (hostFilename.containsIgnoreCase (T("Wavelab"))) return SteinbergWavelabGeneric;
if (hostFilename.containsIgnoreCase (T("reaper"))) return Reaper;
if (hostFilename.containsIgnoreCase ("Live 6.")) return AbletonLive6;
if (hostFilename.containsIgnoreCase ("Live 7.")) return AbletonLive7;
if (hostFilename.containsIgnoreCase ("Live 8.")) return AbletonLive8;
if (hostFilename.containsIgnoreCase ("Live ")) return AbletonLiveGeneric;
if (hostFilename.containsIgnoreCase ("ProTools")) return DigidesignProTools;
if (hostPath.containsIgnoreCase ("SONAR 8")) return CakewalkSonar8;
if (hostFilename.containsIgnoreCase ("SONAR")) return CakewalkSonarGeneric;
if (hostPath.containsIgnoreCase ("Tracktion 3")) return MackieTracktion3;
if (hostFilename.containsIgnoreCase ("Tracktion")) return MackieTracktionGeneric;
if (hostFilename.containsIgnoreCase ("Cubase4")) return SteinbergCubase4;
if (hostFilename.containsIgnoreCase ("Cubase5")) return SteinbergCubase5;
if (hostFilename.containsIgnoreCase ("Cubase")) return SteinbergCubaseGeneric;
if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;
if (hostFilename.containsIgnoreCase ("reaper")) return Reaper;
#elif JUCE_LINUX
jassertfalse // not yet done!


+ 1
- 1
extras/binarybuilder/BinaryBuilder.jucer View File

@@ -38,5 +38,5 @@
JUCE_PLUGINHOST_AU="default" JUCE_ONLY_BUILD_CORE_LIBRARY="enabled"
JUCE_WEB_BROWSER="default" JUCE_SUPPORT_CARBON="default" JUCE_CHECK_MEMORY_LEAKS="default"
JUCE_CATCH_UNHANDLED_EXCEPTIONS="default" JUCE_STRINGS_ARE_UNICODE="default"
JUCE_USE_XRENDER="default"/>
JUCE_USE_XRENDER="default" JUCE_USE_XCURSOR="default"/>
</JUCERPROJECT>

+ 1
- 0
extras/binarybuilder/JuceLibraryCode/AppConfig.h View File

@@ -28,6 +28,7 @@
//#define JUCE_USE_XINERAMA
//#define JUCE_USE_XSHM
//#define JUCE_USE_XRENDER
//#define JUCE_USE_XCURSOR
//#define JUCE_PLUGINHOST_VST
//#define JUCE_PLUGINHOST_AU
#define JUCE_ONLY_BUILD_CORE_LIBRARY 1


+ 4
- 4
extras/browser plugins/wrapper/juce_NPAPI_GlueCode.cpp View File

@@ -213,8 +213,8 @@ char* NP_GetMIMEDescription()
static String mimeDesc;
mimeDesc = String (T(JuceBrowserPlugin_MimeType))
+ T(":") + String (T(JuceBrowserPlugin_FileSuffix))
+ T(":") + String (T(JuceBrowserPlugin_Name));
+ ":" + String (T(JuceBrowserPlugin_FileSuffix))
+ ":" + String (T(JuceBrowserPlugin_Name));
return (char*) (const char*) mimeDesc.toUTF8();
}
@@ -934,10 +934,10 @@ private:
{
const String version (browser.uagent (npp));
if (! version.containsIgnoreCase (T(" AppleWebKit/")))
if (! version.containsIgnoreCase (" AppleWebKit/"))
return true;
int versionNum = version.fromFirstOccurrenceOf (T(" AppleWebKit/"), false, true).getIntValue();
int versionNum = version.fromFirstOccurrenceOf (" AppleWebKit/", false, true).getIntValue();
return versionNum == 0 || versionNum >= 420;
}


+ 1
- 1
extras/example projects/HelloWorld.jucer View File

@@ -45,5 +45,5 @@
JUCE_PLUGINHOST_AU="default" JUCE_ONLY_BUILD_CORE_LIBRARY="default"
JUCE_WEB_BROWSER="default" JUCE_SUPPORT_CARBON="default" JUCE_CHECK_MEMORY_LEAKS="default"
JUCE_CATCH_UNHANDLED_EXCEPTIONS="default" JUCE_STRINGS_ARE_UNICODE="default"
JUCE_USE_XRENDER="default"/>
JUCE_USE_XRENDER="default" JUCE_USE_XCURSOR="default"/>
</JUCERPROJECT>

+ 1
- 0
extras/example projects/JuceLibraryCode/AppConfig.h View File

@@ -28,6 +28,7 @@
//#define JUCE_USE_XINERAMA
//#define JUCE_USE_XSHM
//#define JUCE_USE_XRENDER
//#define JUCE_USE_XCURSOR
//#define JUCE_PLUGINHOST_VST
//#define JUCE_PLUGINHOST_AU
//#define JUCE_ONLY_BUILD_CORE_LIBRARY


+ 1
- 1
extras/juce demo/Juce Demo.jucer View File

@@ -108,5 +108,5 @@
JUCE_PLUGINHOST_AU="disabled" JUCE_ONLY_BUILD_CORE_LIBRARY="default"
JUCE_WEB_BROWSER="enabled" JUCE_SUPPORT_CARBON="default" JUCE_CHECK_MEMORY_LEAKS="default"
JUCE_CATCH_UNHANDLED_EXCEPTIONS="default" JUCE_STRINGS_ARE_UNICODE="default"
JUCE_USE_XRENDER="default"/>
JUCE_USE_XRENDER="default" JUCE_USE_XCURSOR="default"/>
</JUCERPROJECT>

+ 1
- 0
extras/juce demo/JuceLibraryCode/AppConfig.h View File

@@ -28,6 +28,7 @@
//#define JUCE_USE_XINERAMA
//#define JUCE_USE_XSHM
//#define JUCE_USE_XRENDER
//#define JUCE_USE_XCURSOR
#define JUCE_PLUGINHOST_VST 0
#define JUCE_PLUGINHOST_AU 0
//#define JUCE_ONLY_BUILD_CORE_LIBRARY


+ 2
- 2
extras/juce demo/Source/demos/AudioDemoLatencyPage.cpp View File

@@ -288,7 +288,7 @@ AudioDemoLatencyPage::AudioDemoLatencyPage (AudioDeviceManager& deviceManager_)
addAndMakeVisible (liveAudioDisplayComp = new LiveAudioInputDisplayComp());
addAndMakeVisible (startTestButton = new TextButton (String::empty));
startTestButton->setButtonText (T("Test Latency"));
startTestButton->setButtonText ("Test Latency");
startTestButton->addButtonListener (this);
addAndMakeVisible (testResultsBox = new TextEditor (String::empty));
@@ -301,7 +301,7 @@ AudioDemoLatencyPage::AudioDemoLatencyPage (AudioDeviceManager& deviceManager_)
testResultsBox->setColour (TextEditor::backgroundColourId, Colour (0x32ffffff));
testResultsBox->setColour (TextEditor::outlineColourId, Colour (0x1c000000));
testResultsBox->setColour (TextEditor::shadowColourId, Colour (0x16000000));
testResultsBox->setText (T("Running this test measures the round-trip latency between the audio output and input devices you\'ve got selected.\n\nIt\'ll play a sound, then try to measure the time at which the sound arrives back at the audio input. Obviously for this to work you need to have your microphone somewhere near your speakers..."));
testResultsBox->setText ("Running this test measures the round-trip latency between the audio output and input devices you\'ve got selected.\n\nIt\'ll play a sound, then try to measure the time at which the sound arrives back at the audio input. Obviously for this to work you need to have your microphone somewhere near your speakers...");
//[UserPreSize]


+ 19
- 19
extras/juce demo/Source/demos/TableDemo.cpp View File

@@ -43,7 +43,7 @@ public:
loadData();
// Create our table component and add it to this component..
addAndMakeVisible (table = new TableListBox (T("demo table"), this));
addAndMakeVisible (table = new TableListBox ("demo table", this));
// give it a border
table->setColour (ListBox::outlineColourId, Colours::grey);
@@ -52,9 +52,9 @@ public:
// Add some columns to the table header, based on the column list in our database..
forEachXmlChildElement (*columnList, columnXml)
{
table->getHeader()->addColumn (columnXml->getStringAttribute T("name"),
columnXml->getIntAttribute T("columnId"),
columnXml->getIntAttribute T("width"),
table->getHeader()->addColumn (columnXml->getStringAttribute ("name"),
columnXml->getIntAttribute ("columnId"),
columnXml->getIntAttribute ("width"),
50, 400,
TableHeaderComponent::defaultFlags);
}
@@ -182,12 +182,12 @@ public:
// changes the combo box
int getRating (const int rowNumber, const int columnId) const
{
return dataList->getChildElement (rowNumber)->getIntAttribute (T("Rating"));
return dataList->getChildElement (rowNumber)->getIntAttribute ("Rating");
}
void setRating (const int rowNumber, const int columnId, const int newRating)
{
dataList->getChildElement (rowNumber)->setAttribute (T("Rating"), newRating);
dataList->getChildElement (rowNumber)->setAttribute ("Rating", newRating);
}
//==============================================================================
@@ -221,13 +221,13 @@ private:
{
// just put a combo box inside this component
addAndMakeVisible (comboBox = new ComboBox (String::empty));
comboBox->addItem (T("fab"), 1);
comboBox->addItem (T("groovy"), 2);
comboBox->addItem (T("hep"), 3);
comboBox->addItem (T("neat"), 4);
comboBox->addItem (T("wild"), 5);
comboBox->addItem (T("swingin"), 6);
comboBox->addItem (T("mad for it"), 7);
comboBox->addItem ("fab", 1);
comboBox->addItem ("groovy", 2);
comboBox->addItem ("hep", 3);
comboBox->addItem ("neat", 4);
comboBox->addItem ("wild", 5);
comboBox->addItem ("swingin", 6);
comboBox->addItem ("mad for it", 7);
// when the combo is changed, we'll get a callback.
comboBox->addListener (this);
@@ -280,8 +280,8 @@ private:
.compareLexicographically (second->getStringAttribute (attributeToSort));
if (result == 0)
result = first->getStringAttribute (T("ID"))
.compareLexicographically (second->getStringAttribute (T("ID")));
result = first->getStringAttribute ("ID")
.compareLexicographically (second->getStringAttribute ("ID"));
return direction * result;
}
@@ -298,8 +298,8 @@ private:
XmlDocument dataDoc (String ((const char*) BinaryData::demo_table_data_xml));
demoData = dataDoc.getDocumentElement();
dataList = demoData->getChildByName (T("DATA"));
columnList = demoData->getChildByName (T("COLUMNS"));
dataList = demoData->getChildByName ("DATA");
columnList = demoData->getChildByName ("COLUMNS");
numRows = dataList->getNumChildElements();
}
@@ -309,8 +309,8 @@ private:
{
forEachXmlChildElement (*columnList, columnXml)
{
if (columnXml->getIntAttribute T("columnId") == columnId)
return columnXml->getStringAttribute T("name");
if (columnXml->getIntAttribute ("columnId") == columnId)
return columnXml->getStringAttribute ("name");
}
return String::empty;


+ 6
- 6
extras/juce demo/Source/demos/ThreadingDemo.cpp View File

@@ -122,7 +122,7 @@ class DemoThread : public BouncingBallComp,
public:
DemoThread()
: Thread (T("Juce Demo Thread"))
: Thread ("Juce Demo Thread")
{
interval = Random::getSystemRandom().nextInt (50) + 6;
@@ -171,7 +171,7 @@ class DemoThreadPoolJob : public BouncingBallComp,
{
public:
DemoThreadPoolJob()
: ThreadPoolJob (T("Demo Threadpool Job"))
: ThreadPoolJob ("Demo Threadpool Job")
{
}
@@ -224,7 +224,7 @@ public:
{
isUsingPool = false;
setName (T("Multithreading"));
setName ("Multithreading");
setOpaque (true);
}
@@ -246,7 +246,7 @@ public:
pool.removeAllJobs (true, 4000);
deleteAllChildren();
addAndMakeVisible (controlButton = new TextButton (T("Thread type")));
addAndMakeVisible (controlButton = new TextButton ("Thread type"));
controlButton->changeWidthToFitText (20);
controlButton->setTopLeftPosition (20, 20);
controlButton->setTriggeredOnMouseDown (true);
@@ -332,8 +332,8 @@ public:
void buttonClicked (Button* button)
{
PopupMenu m;
m.addItem (1, T("Use one thread per ball"), true, ! isUsingPool);
m.addItem (2, T("Use a thread pool"), true, isUsingPool);
m.addItem (1, "Use one thread per ball", true, ! isUsingPool);
m.addItem (2, "Use a thread pool", true, isUsingPool);
const int res = m.showAt (button);


+ 9
- 9
extras/juce demo/Source/demos/TreeViewDemo.cpp View File

@@ -43,7 +43,7 @@ public:
int getItemWidth() const
{
return xml->getIntAttribute (T("width"), -1);
return xml->getIntAttribute ("width", -1);
}
const String getUniqueName() const
@@ -69,7 +69,7 @@ public:
g.fillAll (Colours::blue.withAlpha (0.3f));
// use a "colour" attribute in the xml tag for this node to set the text colour..
g.setColour (Colour (xml->getStringAttribute (T("colour"), T("ff000000")).getHexValue32()));
g.setColour (Colour (xml->getStringAttribute ("colour", "ff000000").getHexValue32()));
g.setFont (height * 0.7f);
@@ -111,7 +111,7 @@ public:
const String getDragSourceDescription()
{
return T("TreeView Items");
return "TreeView Items";
}
};
@@ -140,7 +140,7 @@ public:
directoryList (0),
thread ("Demo file tree thread")
{
setName (T("Tree Views"));
setName ("Tree Views");
const String treeXmlString (BinaryData::treedemo_xml);
XmlDocument parser (treeXmlString);
@@ -158,7 +158,7 @@ public:
directoryList->setDirectory (folder, true, true);
thread.startThread (3);
addAndMakeVisible (typeButton = new TextButton (T("Type of treeview...")));
addAndMakeVisible (typeButton = new TextButton ("Type of treeview..."));
typeButton->addButtonListener (this);
typeButton->setAlwaysOnTop (true);
typeButton->setTriggeredOnMouseDown (true);
@@ -224,13 +224,13 @@ public:
void buttonClicked (Button*)
{
PopupMenu m;
m.addItem (1, T("Custom treeview showing an XML tree"));
m.addItem (2, T("FileTreeComponent showing the file system"));
m.addItem (1, "Custom treeview showing an XML tree");
m.addItem (2, "FileTreeComponent showing the file system");
m.addSeparator();
m.addItem (3, T("Show root item"), true,
m.addItem (3, "Show root item", true,
treeView != 0 ? treeView->isRootItemVisible()
: fileTreeComp->isRootItemVisible());
m.addItem (4, T("Show open/close buttons"), true,
m.addItem (4, "Show open/close buttons", true,
treeView != 0 ? treeView->areOpenCloseButtonsVisible()
: fileTreeComp->areOpenCloseButtonsVisible());


+ 134
- 134
extras/juce demo/Source/demos/WidgetsDemo.cpp View File

@@ -151,7 +151,7 @@ public:
else
g.fillAll (Colours::blue.withAlpha (0.2f));
String desc (T("drag this box onto the desktop to show how the same component can move from being lightweight to being a separate window"));
String desc ("drag this box onto the desktop to show how the same component can move from being lightweight to being a separate window");
g.setFont (15.0f);
g.setColour (Colours::black);
@@ -199,7 +199,7 @@ public:
g.setFont (14.0f, Font::italic);
g.setColour (Colours::black);
g.drawFittedText (T("this is a customised menu item (also demonstrating the Timer class)..."),
g.drawFittedText ("this is a customised menu item (also demonstrating the Timer class)...",
4, 0, getWidth() - 8, getHeight(),
Justification::centred, 3);
}
@@ -242,7 +242,7 @@ class ColourChangeButton : public TextButton,
{
public:
ColourChangeButton()
: TextButton (T("click to change colour..."))
: TextButton ("click to change colour...")
{
setSize (10, 24);
changeWidthToFitText();
@@ -257,12 +257,12 @@ public:
// create two colour selector components for our background and
// text colour..
ColourSelector colourSelector1;
colourSelector1.setName (T("background"));
colourSelector1.setName ("background");
colourSelector1.setCurrentColour (findColour (TextButton::buttonColourId));
colourSelector1.addChangeListener (this);
ColourSelector colourSelector2;
colourSelector2.setName (T("text"));
colourSelector2.setName ("text");
colourSelector2.setCurrentColour (findColour (TextButton::textColourOffId));
colourSelector2.addChangeListener (this);
@@ -271,10 +271,10 @@ public:
PopupMenu m, sub1, sub2;
sub1.addCustomItem (1234, &colourSelector1, 300, 300, false);
m.addSubMenu (T("background colour"), sub1);
m.addSubMenu ("background colour", sub1);
sub2.addCustomItem (1234, &colourSelector2, 300, 300, false);
m.addSubMenu (T("text colour"), sub2);
m.addSubMenu ("text colour", sub2);
// and show the menu (modally)..
m.showAt (this);
@@ -284,7 +284,7 @@ public:
{
ColourSelector* cs = (ColourSelector*) source;
if (cs->getName() == T("text"))
if (cs->getName() == "text")
setColour (TextButton::textColourOffId, cs->getCurrentColour());
else
setColour (TextButton::buttonColourId, cs->getCurrentColour());
@@ -319,9 +319,9 @@ static Component* createSlidersPage()
for (i = 0; i < numSliders; ++i)
{
if (i == 2)
page->addAndMakeVisible (sliders[i] = new SnappingSlider (T("slider")));
page->addAndMakeVisible (sliders[i] = new SnappingSlider ("slider"));
else
page->addAndMakeVisible (sliders[i] = new Slider (T("slider")));
page->addAndMakeVisible (sliders[i] = new Slider ("slider"));
sliders[i]->setRange (0.0, 100.0, 0.1);
sliders[i]->setPopupMenuEnabled (true);
@@ -332,14 +332,14 @@ static Component* createSlidersPage()
sliders[0]->setTextBoxStyle (Slider::TextBoxBelow, false, 100, 20);
sliders[0]->setBounds (10, 25, 70, 200);
sliders[0]->setDoubleClickReturnValue (true, 50.0); // double-clicking this slider will set it to 50.0
sliders[0]->setTextValueSuffix (T(" units"));
sliders[0]->setTextValueSuffix (" units");
sliders[1]->setSliderStyle (Slider::LinearVertical);
sliders[1]->setVelocityBasedMode (true);
sliders[1]->setSkewFactor (0.5);
sliders[1]->setTextBoxStyle (Slider::TextBoxAbove, true, 100, 20);
sliders[1]->setBounds (85, 25, 70, 200);
sliders[1]->setTextValueSuffix (T(" rels"));
sliders[1]->setTextValueSuffix (" rels");
sliders[2]->setSliderStyle (Slider::LinearHorizontal);
sliders[2]->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
@@ -349,7 +349,7 @@ static Component* createSlidersPage()
sliders[3]->setTextBoxStyle (Slider::NoTextBox, false, 0, 0);
sliders[3]->setBounds (180, 65, 150, 20);
sliders[3]->setPopupDisplayEnabled (true, page);
sliders[3]->setTextValueSuffix (T(" nuns required to change a lightbulb"));
sliders[3]->setTextValueSuffix (" nuns required to change a lightbulb");
sliders[4]->setSliderStyle (Slider::IncDecButtons);
sliders[4]->setTextBoxStyle (Slider::TextBoxLeft, false, 50, 20);
@@ -360,11 +360,11 @@ static Component* createSlidersPage()
sliders[5]->setRotaryParameters (float_Pi * 1.2f, float_Pi * 2.8f, false);
sliders[5]->setTextBoxStyle (Slider::TextBoxRight, false, 70, 20);
sliders[5]->setBounds (190, 145, 120, 40);
sliders[5]->setTextValueSuffix (T(" mm"));
sliders[5]->setTextValueSuffix (" mm");
sliders[6]->setSliderStyle (Slider::LinearBar);
sliders[6]->setBounds (180, 195, 100, 30);
sliders[6]->setTextValueSuffix (T(" gallons"));
sliders[6]->setTextValueSuffix (" gallons");
sliders[7]->setSliderStyle (Slider::TwoValueHorizontal);
sliders[7]->setBounds (360, 20, 160, 40);
@@ -408,7 +408,7 @@ static Component* createSlidersPage()
}
// Create a description label...
Label* label = new Label (T("hint"), T("Try right-clicking on a slider for an options menu. \n\nAlso, holding down CTRL while dragging will turn on a slider's velocity-sensitive mode"));
Label* label = new Label ("hint", "Try right-clicking on a slider for an options menu. \n\nAlso, holding down CTRL while dragging will turn on a slider's velocity-sensitive mode");
label->setBounds (20, 245, 350, 150);
page->addAndMakeVisible (label);
@@ -420,18 +420,18 @@ static Component* createRadioButtonPage()
{
DemoPageComp* page = new DemoPageComp();
GroupComponent* group = new GroupComponent (T("group"), T("radio buttons"));
GroupComponent* group = new GroupComponent ("group", "radio buttons");
group->setBounds (20, 20, 220, 140);
page->addAndMakeVisible (group);
int i;
for (i = 0; i < 4; ++i)
{
ToggleButton* tb = new ToggleButton (T("radio button #") + String (i + 1));
ToggleButton* tb = new ToggleButton ("radio button #" + String (i + 1));
page->addAndMakeVisible (tb);
tb->setRadioGroupId (1234);
tb->setBounds (45, 46 + i * 22, 180, 22);
tb->setTooltip (T("a set of mutually-exclusive radio buttons"));
tb->setTooltip ("a set of mutually-exclusive radio buttons");
if (i == 0)
tb->setToggleState (true, false);
@@ -453,7 +453,7 @@ static Component* createRadioButtonPage()
over.setStrokeFill (Colours::black);
over.setStrokeThickness (4.0f);
DrawableButton* db = new DrawableButton (String (i + 5) + T(" points"), DrawableButton::ImageAboveTextLabel);
DrawableButton* db = new DrawableButton (String (i + 5) + " points", DrawableButton::ImageAboveTextLabel);
db->setImages (&normal, &over, 0);
page->addAndMakeVisible (db);
@@ -469,7 +469,7 @@ static Component* createRadioButtonPage()
for (i = 0; i < 4; ++i)
{
TextButton* tb = new TextButton (T("button ") + String (i + 1));
TextButton* tb = new TextButton ("button " + String (i + 1));
page->addAndMakeVisible (tb);
tb->setClickingTogglesState (true);
@@ -517,12 +517,12 @@ public:
//==============================================================================
// create an image-above-text button from these drawables..
DrawableButton* db = new DrawableButton (T("Button 1"), DrawableButton::ImageAboveTextLabel);
DrawableButton* db = new DrawableButton ("Button 1", DrawableButton::ImageAboveTextLabel);
db->setImages (&normal, &over, &down);
addAndMakeVisible (db);
db->setBounds (10, 30, 80, 80);
db->setTooltip (T("this is a DrawableButton with a label"));
db->setTooltip ("this is a DrawableButton with a label");
//==============================================================================
// create an image-only button from these drawables..
@@ -532,7 +532,7 @@ public:
addAndMakeVisible (db);
db->setBounds (90, 30, 80, 80);
db->setTooltip (T("this is an image-only DrawableButton"));
db->setTooltip ("this is an image-only DrawableButton");
db->addButtonListener (buttonListener);
//==============================================================================
@@ -542,7 +542,7 @@ public:
addAndMakeVisible (db);
db->setBounds (200, 30, 110, 25);
db->setTooltip (T("this is a DrawableButton on a standard button background"));
db->setTooltip ("this is a DrawableButton on a standard button background");
//==============================================================================
db = new DrawableButton (T("Button 4"), DrawableButton::ImageOnButtonBackground);
@@ -552,19 +552,19 @@ public:
addAndMakeVisible (db);
db->setBounds (200, 70, 50, 50);
db->setTooltip (T("this is a DrawableButton on a standard button background"));
db->setTooltip ("this is a DrawableButton on a standard button background");
db->addButtonListener (buttonListener);
//==============================================================================
HyperlinkButton* hyperlink
= new HyperlinkButton (T("this is a HyperlinkButton"),
URL (T("http://www.rawmaterialsoftware.com/juce")));
= new HyperlinkButton ("this is a HyperlinkButton",
URL ("http://www.rawmaterialsoftware.com/juce"));
hyperlink->setBounds (10, 130, 200, 24);
addAndMakeVisible (hyperlink);
//==============================================================================
ImageButton* imageButton = new ImageButton (T("imagebutton"));
ImageButton* imageButton = new ImageButton ("imagebutton");
addAndMakeVisible (imageButton);
Image* juceImage = ImageCache::getFromMemory (BinaryData::juce_png, BinaryData::juce_pngSize);
@@ -578,7 +578,7 @@ public:
0.5f);
imageButton->setTopLeftPosition (10, 160);
imageButton->setTooltip (T("image button - showing alpha-channel hit-testing and colour overlay when clicked"));
imageButton->setTooltip ("image button - showing alpha-channel hit-testing and colour overlay when clicked");
//==============================================================================
ColourChangeButton* colourChangeButton = new ColourChangeButton();
@@ -586,7 +586,7 @@ public:
colourChangeButton->setTopLeftPosition (350, 30);
//==============================================================================
animateButton = new TextButton (T("click to animate..."));
animateButton = new TextButton ("click to animate...");
addAndMakeVisible (animateButton);
animateButton->changeWidthToFitText (24);
animateButton->setTopLeftPosition (350, 70);
@@ -630,15 +630,15 @@ static Component* createMiscPage()
TextEditor* textEditor1 = new TextEditor();
page->addAndMakeVisible (textEditor1);
textEditor1->setBounds (10, 25, 200, 24);
textEditor1->setText (T("single-line text box"));
textEditor1->setText ("single-line text box");
TextEditor* textEditor2 = new TextEditor (T("password"), (tchar) 0x2022);
TextEditor* textEditor2 = new TextEditor ("password", (tchar) 0x2022);
page->addAndMakeVisible (textEditor2);
textEditor2->setBounds (10, 55, 200, 24);
textEditor2->setText (T("password"));
textEditor2->setText ("password");
//==============================================================================
ComboBox* comboBox = new ComboBox (T("combo"));
ComboBox* comboBox = new ComboBox ("combo");
page->addAndMakeVisible (comboBox);
comboBox->setBounds (300, 25, 200, 24);
comboBox->setEditableText (true);
@@ -646,7 +646,7 @@ static Component* createMiscPage()
int i;
for (i = 1; i < 100; ++i)
comboBox->addItem (T("combo box item ") + String (i), i);
comboBox->addItem ("combo box item " + String (i), i);
comboBox->setSelectedId (1);
@@ -684,7 +684,7 @@ public:
info->setBounds (80, 80, 450, 100);
info->setInterceptsMouseClicks (false, false);
addAndMakeVisible (depthSlider = new Slider (T("toolbar depth:")));
addAndMakeVisible (depthSlider = new Slider ("toolbar depth:"));
depthSlider->setRange (10.0, 200.0, 1.0);
depthSlider->setValue (50, false);
depthSlider->setSliderStyle (Slider::LinearHorizontal);
@@ -693,12 +693,12 @@ public:
depthSlider->setBounds (80, 210, 300, 22);
(new Label (depthSlider->getName(), depthSlider->getName()))->attachToComponent (depthSlider, false);
addAndMakeVisible (orientationButton = new TextButton (T("vertical/horizontal")));
addAndMakeVisible (orientationButton = new TextButton ("vertical/horizontal"));
orientationButton->addButtonListener (this);
orientationButton->changeWidthToFitText (22);
orientationButton->setTopLeftPosition (depthSlider->getX(), depthSlider->getBottom() + 20);
addAndMakeVisible (customiseButton = new TextButton (T("customise...")));
addAndMakeVisible (customiseButton = new TextButton ("customise..."));
customiseButton->addButtonListener (this);
customiseButton->changeWidthToFitText (22);
customiseButton->setTopLeftPosition (orientationButton->getRight() + 20, orientationButton->getY());
@@ -814,28 +814,28 @@ private:
switch (itemId)
{
case doc_new:
return createButtonFromZipFileSVG (itemId, T("new"), T("document-new.svg"));
return createButtonFromZipFileSVG (itemId, "new", "document-new.svg");
case doc_open:
return createButtonFromZipFileSVG (itemId, T("open"), T("document-open.svg"));
return createButtonFromZipFileSVG (itemId, "open", "document-open.svg");
case doc_save:
return createButtonFromZipFileSVG (itemId, T("save"), T("document-save.svg"));
return createButtonFromZipFileSVG (itemId, "save", "document-save.svg");
case doc_saveAs:
return createButtonFromZipFileSVG (itemId, T("save as"), T("document-save-as.svg"));
return createButtonFromZipFileSVG (itemId, "save as", "document-save-as.svg");
case edit_copy:
return createButtonFromZipFileSVG (itemId, T("copy"), T("edit-copy.svg"));
return createButtonFromZipFileSVG (itemId, "copy", "edit-copy.svg");
case edit_cut:
return createButtonFromZipFileSVG (itemId, T("cut"), T("edit-cut.svg"));
return createButtonFromZipFileSVG (itemId, "cut", "edit-cut.svg");
case edit_paste:
return createButtonFromZipFileSVG (itemId, T("paste"), T("edit-paste.svg"));
return createButtonFromZipFileSVG (itemId, "paste", "edit-paste.svg");
case juceLogoButton:
return new ToolbarButton (itemId, T("juce!"), Drawable::createFromImageData (BinaryData::juce_png, BinaryData::juce_pngSize), 0);
return new ToolbarButton (itemId, "juce!", Drawable::createFromImageData (BinaryData::juce_png, BinaryData::juce_pngSize), 0);
case customComboBox:
return new CustomToolbarComboBox (itemId);
@@ -887,12 +887,12 @@ private:
{
public:
CustomToolbarComboBox (const int toolbarItemId)
: ToolbarItemComponent (toolbarItemId, T("Custom Toolbar Item"), false)
: ToolbarItemComponent (toolbarItemId, "Custom Toolbar Item", false)
{
addAndMakeVisible (comboBox = new ComboBox (T("demo toolbar combo box")));
addAndMakeVisible (comboBox = new ComboBox ("demo toolbar combo box"));
for (int i = 1; i < 20; ++i)
comboBox->addItem (T("Toolbar ComboBox item ") + String (i), i);
comboBox->addItem ("Toolbar ComboBox item " + String (i), i);
comboBox->setSelectedId (1);
comboBox->setEditableText (true);
@@ -944,11 +944,11 @@ public:
DemoTabbedComponent (ApplicationCommandManager* commandManager)
: TabbedComponent (TabbedButtonBar::TabsAtTop)
{
addTab (T("sliders"), getRandomBrightColour(), createSlidersPage(), true);
addTab (T("toolbars"), getRandomBrightColour(), new ToolbarDemoComp (commandManager), true);
addTab (T("buttons"), getRandomBrightColour(), new ButtonsPage (this), true);
addTab (T("radio buttons"), getRandomBrightColour(), createRadioButtonPage(), true);
addTab (T("misc widgets"), getRandomBrightColour(), createMiscPage(), true);
addTab ("sliders", getRandomBrightColour(), createSlidersPage(), true);
addTab ("toolbars", getRandomBrightColour(), new ToolbarDemoComp (commandManager), true);
addTab ("buttons", getRandomBrightColour(), new ButtonsPage (this), true);
addTab ("radio buttons", getRandomBrightColour(), createRadioButtonPage(), true);
addTab ("misc widgets", getRandomBrightColour(), createMiscPage(), true);
}
~DemoTabbedComponent()
@@ -969,7 +969,7 @@ public:
addChildComponent (bmc);
}
bmc->showAt (button, T("This is a demo of the BubbleMessageComponent, which lets you pop up a message pointing at a component or somewhere on the screen.\n\nThe message bubbles will disappear after a timeout period, or when the mouse is clicked."),
bmc->showAt (button, "This is a demo of the BubbleMessageComponent, which lets you pop up a message pointing at a component or somewhere on the screen.\n\nThe message bubbles will disappear after a timeout period, or when the mouse is clicked.",
2000, true, true);
}
@@ -985,11 +985,11 @@ class DemoBackgroundThread : public ThreadWithProgressWindow
{
public:
DemoBackgroundThread()
: ThreadWithProgressWindow (T("busy doing some important things..."),
: ThreadWithProgressWindow ("busy doing some important things...",
true,
true)
{
setStatusMessage (T("Getting ready..."));
setStatusMessage ("Getting ready...");
}
~DemoBackgroundThread()
@@ -999,7 +999,7 @@ public:
void run()
{
setProgress (-1.0); // setting a value beyond the range 0 -> 1 will show a spinning bar..
setStatusMessage (T("Preparing to do some stuff..."));
setStatusMessage ("Preparing to do some stuff...");
wait (2000);
const int thingsToDo = 10;
@@ -1014,13 +1014,13 @@ public:
// this will update the progress bar on the dialog box
setProgress (i / (double) thingsToDo);
setStatusMessage (String (thingsToDo - i) + T(" things left to do..."));
setStatusMessage (String (thingsToDo - i) + " things left to do...");
wait (500);
}
setProgress (-1.0); // setting a value beyond the range 0 -> 1 will show a spinning bar..
setStatusMessage (T("Finishing off the last few bits and pieces!"));
setStatusMessage ("Finishing off the last few bits and pieces!");
wait (2000);
}
};
@@ -1031,7 +1031,7 @@ class ColourSelectorDialogWindow : public DialogWindow
{
public:
ColourSelectorDialogWindow()
: DialogWindow (T("Colour selector demo"),
: DialogWindow ("Colour selector demo",
Colours::lightgrey,
true)
{
@@ -1068,7 +1068,7 @@ public:
"If you've got an Apple Remote, press some buttons now...",
AlertWindow::NoIcon)
{
addButton (T("done"), 0);
addButton ("done", 0);
// (To open the device in non-exclusive mode, pass 'false' in here)..
if (! start (true))
@@ -1147,13 +1147,13 @@ public:
//==============================================================================
WidgetsDemo (ApplicationCommandManager* commandManager)
{
setName (T("Widgets"));
setName ("Widgets");
addAndMakeVisible (tabs = new DemoTabbedComponent (commandManager));
//==============================================================================
menuButton = new TextButton (T("click for a popup menu.."),
T("click for a demo of the different types of item you can put into a popup menu..."));
menuButton = new TextButton ("click for a popup menu..",
"click for a demo of the different types of item you can put into a popup menu...");
addAndMakeVisible (menuButton);
menuButton->setBounds (10, 10, 200, 24);
@@ -1162,7 +1162,7 @@ public:
// hold down the button and drag straight onto the menu
//==============================================================================
enableButton = new ToggleButton (T("enable/disable components"));
enableButton = new ToggleButton ("enable/disable components");
addAndMakeVisible (enableButton);
enableButton->setBounds (230, 10, 180, 24);
enableButton->setTooltip (T("toggle button"));
@@ -1193,71 +1193,71 @@ public:
else if (button == menuButton)
{
PopupMenu m;
m.addItem (1, T("Normal item"));
m.addItem (2, T("Disabled item"), false);
m.addItem (3, T("Ticked item"), true, true);
m.addColouredItem (4, T("Coloured item"), Colours::green);
m.addItem (1, "Normal item");
m.addItem (2, "Disabled item", false);
m.addItem (3, "Ticked item", true, true);
m.addColouredItem (4, "Coloured item", Colours::green);
m.addSeparator();
m.addCustomItem (5, new CustomMenuComponent());
m.addSeparator();
PopupMenu tabsMenu;
tabsMenu.addItem (1001, T("Show tabs at the top"), true, tabs->getOrientation() == TabbedButtonBar::TabsAtTop);
tabsMenu.addItem (1002, T("Show tabs at the bottom"), true, tabs->getOrientation() == TabbedButtonBar::TabsAtBottom);
tabsMenu.addItem (1003, T("Show tabs at the left"), true, tabs->getOrientation() == TabbedButtonBar::TabsAtLeft);
tabsMenu.addItem (1004, T("Show tabs at the right"), true, tabs->getOrientation() == TabbedButtonBar::TabsAtRight);
m.addSubMenu (T("Tab position"), tabsMenu);
tabsMenu.addItem (1001, "Show tabs at the top", true, tabs->getOrientation() == TabbedButtonBar::TabsAtTop);
tabsMenu.addItem (1002, "Show tabs at the bottom", true, tabs->getOrientation() == TabbedButtonBar::TabsAtBottom);
tabsMenu.addItem (1003, "Show tabs at the left", true, tabs->getOrientation() == TabbedButtonBar::TabsAtLeft);
tabsMenu.addItem (1004, "Show tabs at the right", true, tabs->getOrientation() == TabbedButtonBar::TabsAtRight);
m.addSubMenu ("Tab position", tabsMenu);
m.addSeparator();
PopupMenu dialogMenu;
dialogMenu.addItem (100, T("Show a plain alert-window..."));
dialogMenu.addItem (101, T("Show an alert-window with a 'warning' icon..."));
dialogMenu.addItem (102, T("Show an alert-window with an 'info' icon..."));
dialogMenu.addItem (103, T("Show an alert-window with a 'question' icon..."));
dialogMenu.addItem (100, "Show a plain alert-window...");
dialogMenu.addItem (101, "Show an alert-window with a 'warning' icon...");
dialogMenu.addItem (102, "Show an alert-window with an 'info' icon...");
dialogMenu.addItem (103, "Show an alert-window with a 'question' icon...");
dialogMenu.addSeparator();
dialogMenu.addItem (110, T("Show an ok/cancel alert-window..."));
dialogMenu.addItem (110, "Show an ok/cancel alert-window...");
dialogMenu.addSeparator();
dialogMenu.addItem (111, T("Show an alert-window with some extra components..."));
dialogMenu.addItem (111, "Show an alert-window with some extra components...");
dialogMenu.addSeparator();
dialogMenu.addItem (112, T("Show a ThreadWithProgressWindow demo..."));
dialogMenu.addItem (112, "Show a ThreadWithProgressWindow demo...");
m.addSubMenu (T("AlertWindow demonstrations"), dialogMenu);
m.addSubMenu ("AlertWindow demonstrations", dialogMenu);
m.addSeparator();
m.addItem (120, T("Show a colour selector demo..."));
m.addItem (120, "Show a colour selector demo...");
m.addSeparator();
#if JUCE_MAC
m.addItem (140, T("Run the Apple Remote Control test..."));
m.addItem (140, "Run the Apple Remote Control test...");
m.addSeparator();
#endif
PopupMenu nativeFileChoosers;
nativeFileChoosers.addItem (121, T("'Load' file browser..."));
nativeFileChoosers.addItem (124, T("'Load' file browser with an image file preview..."));
nativeFileChoosers.addItem (122, T("'Save' file browser..."));
nativeFileChoosers.addItem (123, T("'Choose directory' file browser..."));
nativeFileChoosers.addItem (121, "'Load' file browser...");
nativeFileChoosers.addItem (124, "'Load' file browser with an image file preview...");
nativeFileChoosers.addItem (122, "'Save' file browser...");
nativeFileChoosers.addItem (123, "'Choose directory' file browser...");
PopupMenu juceFileChoosers;
juceFileChoosers.addItem (131, T("'Load' file browser..."));
juceFileChoosers.addItem (134, T("'Load' file browser with an image file preview..."));
juceFileChoosers.addItem (132, T("'Save' file browser..."));
juceFileChoosers.addItem (133, T("'Choose directory' file browser..."));
juceFileChoosers.addItem (131, "'Load' file browser...");
juceFileChoosers.addItem (134, "'Load' file browser with an image file preview...");
juceFileChoosers.addItem (132, "'Save' file browser...");
juceFileChoosers.addItem (133, "'Choose directory' file browser...");
PopupMenu fileChoosers;
fileChoosers.addSubMenu (T("Operating system dialogs"), nativeFileChoosers);
fileChoosers.addSubMenu (T("Juce dialogs"), juceFileChoosers);
fileChoosers.addSubMenu ("Operating system dialogs", nativeFileChoosers);
fileChoosers.addSubMenu ("Juce dialogs", juceFileChoosers);
m.addSubMenu (T("File chooser dialogs"), fileChoosers);
m.addSubMenu ("File chooser dialogs", fileChoosers);
int result = m.showAt (menuButton);
@@ -1277,46 +1277,46 @@ public:
icon = AlertWindow::QuestionIcon;
AlertWindow::showMessageBox (icon,
T("This is an AlertWindow"),
T("And this is the AlertWindow's message. Blah blah blah blah blah blah blah blah blah blah blah blah blah."),
T("ok"));
"This is an AlertWindow",
"And this is the AlertWindow's message. Blah blah blah blah blah blah blah blah blah blah blah blah blah.",
"ok");
}
else if (result == 110)
{
bool userPickedOk
= AlertWindow::showOkCancelBox (AlertWindow::QuestionIcon,
T("This is an ok/cancel AlertWindow"),
T("And this is the AlertWindow's message. Blah blah blah blah blah blah blah blah blah blah blah blah blah."));
"This is an ok/cancel AlertWindow",
"And this is the AlertWindow's message. Blah blah blah blah blah blah blah blah blah blah blah blah blah.");
(void) userPickedOk; // (just avoids a compiler warning about unused variables)
}
else if (result == 111)
{
AlertWindow w (T("AlertWindow demo.."),
T("This AlertWindow has a couple of extra components added to show how to add drop-down lists and text entry boxes."),
AlertWindow w ("AlertWindow demo..",
"This AlertWindow has a couple of extra components added to show how to add drop-down lists and text entry boxes.",
AlertWindow::QuestionIcon);
w.addTextEditor (T("text"), T("enter some text here"), T("text field:"));
w.addTextEditor ("text", "enter some text here", "text field:");
StringArray options;
options.add (T("option 1"));
options.add (T("option 2"));
options.add (T("option 3"));
options.add (T("option 4"));
w.addComboBox (T("option"), options, T("some options"));
options.add ("option 1");
options.add ("option 2");
options.add ("option 3");
options.add ("option 4");
w.addComboBox ("option", options, "some options");
w.addButton (T("ok"), 1, KeyPress (KeyPress::returnKey, 0, 0));
w.addButton (T("cancel"), 0, KeyPress (KeyPress::escapeKey, 0, 0));
w.addButton ("ok", 1, KeyPress (KeyPress::returnKey, 0, 0));
w.addButton ("cancel", 0, KeyPress (KeyPress::escapeKey, 0, 0));
if (w.runModalLoop() != 0) // is they picked 'ok'
{
// this is the item they chose in the drop-down list..
const int optionIndexChosen = w.getComboBoxComponent (T("option"))->getSelectedItemIndex();
const int optionIndexChosen = w.getComboBoxComponent ("option")->getSelectedItemIndex();
(void) optionIndexChosen; // (just avoids a compiler warning about unused variables)
// this is the text they entered..
String text = w.getTextEditorContents (T("text"));
String text = w.getTextEditorContents ("text");
}
}
@@ -1328,15 +1328,15 @@ public:
{
// thread finished normally..
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
T("Progress window"),
T("Thread finished ok!"));
"Progress window",
"Thread finished ok!");
}
else
{
// user pressed the cancel button..
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
T("Progress window"),
T("You pressed cancel!"));
"Progress window",
"You pressed cancel!");
}
}
@@ -1363,9 +1363,9 @@ public:
if (result == 121)
{
FileChooser fc (T("Choose a file to open..."),
FileChooser fc ("Choose a file to open...",
File::getCurrentWorkingDirectory(),
T("*"),
"*",
useNativeVersion);
if (fc.browseForFileToOpen())
@@ -1373,8 +1373,8 @@ public:
File chosenFile = fc.getResult();
AlertWindow::showMessageBox (AlertWindow::InfoIcon,
T("File Chooser..."),
T("You picked: ") + chosenFile.getFullPathName());
"File Chooser...",
"You picked: " + chosenFile.getFullPathName());
}
}
else if (result == 124)
@@ -1382,9 +1382,9 @@ public:
ImagePreviewComponent imagePreview;
imagePreview.setSize (200, 200);
FileChooser fc (T("Choose an image to open..."),
FileChooser fc ("Choose an image to open...",
File::getCurrentWorkingDirectory(),
T("*.jpg;*.jpeg;*.png;*.gif"),
"*.jpg;*.jpeg;*.png;*.gif",
useNativeVersion);
if (fc.browseForFileToOpen (&imagePreview))
@@ -1392,15 +1392,15 @@ public:
File chosenFile = fc.getResult();
AlertWindow::showMessageBox (AlertWindow::InfoIcon,
T("File Chooser..."),
T("You picked: ") + chosenFile.getFullPathName());
"File Chooser...",
"You picked: " + chosenFile.getFullPathName());
}
}
else if (result == 122)
{
FileChooser fc (T("Choose a file to save..."),
FileChooser fc ("Choose a file to save...",
File::getCurrentWorkingDirectory(),
T("*"),
"*",
useNativeVersion);
if (fc.browseForFileToSave (true))
@@ -1408,15 +1408,15 @@ public:
File chosenFile = fc.getResult();
AlertWindow::showMessageBox (AlertWindow::InfoIcon,
T("File Chooser..."),
T("You picked: ") + chosenFile.getFullPathName());
"File Chooser...",
"You picked: " + chosenFile.getFullPathName());
}
}
else if (result == 123)
{
FileChooser fc (T("Choose a directory..."),
FileChooser fc ("Choose a directory...",
File::getCurrentWorkingDirectory(),
T("*"),
"*",
useNativeVersion);
if (fc.browseForDirectory())
@@ -1424,8 +1424,8 @@ public:
File chosenDirectory = fc.getResult();
AlertWindow::showMessageBox (AlertWindow::InfoIcon,
T("File Chooser..."),
T("You picked: ") + chosenDirectory.getFullPathName());
"File Chooser...",
"You picked: " + chosenDirectory.getFullPathName());
}
}
}


+ 307
- 311
juce_amalgamated.cpp
File diff suppressed because it is too large
View File


+ 39
- 36
juce_amalgamated.h View File

@@ -1021,6 +1021,7 @@ public:

static int compareIgnoreCase (const char* const s1, const char* const s2) throw();
static int compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2) throw();
static int compareIgnoreCase (const juce_wchar* s1, const char* s2) throw();

static int compareIgnoreCase (const char* const s1, const char* const s2, const int maxChars) throw();
static int compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw();
@@ -1136,6 +1137,8 @@ public:

bool equalsIgnoreCase (const juce_wchar* other) const throw();

bool equalsIgnoreCase (const char* other) const throw();

int compare (const String& other) const throw();

int compare (const char* other) const throw();
@@ -1146,39 +1149,39 @@ public:

int compareLexicographically (const String& other) const throw();

bool startsWith (const juce_wchar* text) const throw();
bool startsWith (const String& text) const throw();

bool startsWithChar (juce_wchar character) const throw();

bool startsWithIgnoreCase (const juce_wchar* text) const throw();
bool startsWithIgnoreCase (const String& text) const throw();

bool endsWith (const juce_wchar* text) const throw();
bool endsWith (const String& text) const throw();

bool endsWithChar (juce_wchar character) const throw();

bool endsWithIgnoreCase (const juce_wchar* text) const throw();
bool endsWithIgnoreCase (const String& text) const throw();

bool contains (const juce_wchar* text) const throw();
bool contains (const String& text) const throw();

bool containsChar (juce_wchar character) const throw();

bool containsIgnoreCase (const juce_wchar* text) const throw();
bool containsIgnoreCase (const String& text) const throw();

bool containsWholeWord (const juce_wchar* wordToLookFor) const throw();
bool containsWholeWord (const String& wordToLookFor) const throw();

bool containsWholeWordIgnoreCase (const juce_wchar* wordToLookFor) const throw();
bool containsWholeWordIgnoreCase (const String& wordToLookFor) const throw();

int indexOfWholeWord (const juce_wchar* wordToLookFor) const throw();
int indexOfWholeWord (const String& wordToLookFor) const throw();

int indexOfWholeWordIgnoreCase (const juce_wchar* wordToLookFor) const throw();
int indexOfWholeWordIgnoreCase (const String& wordToLookFor) const throw();

bool containsAnyOf (const juce_wchar* charactersItMightContain) const throw();
bool containsAnyOf (const String& charactersItMightContain) const throw();

bool containsOnly (const juce_wchar* charactersItMightContain) const throw();
bool containsOnly (const String& charactersItMightContain) const throw();

bool containsNonWhitespaceChars() const throw();

bool matchesWildcard (const juce_wchar* wildcard, bool ignoreCase) const throw();
bool matchesWildcard (const String& wildcard, bool ignoreCase) const throw();

// Substring location methods..

@@ -1186,27 +1189,27 @@ public:

int indexOfChar (int startIndex, juce_wchar characterToLookFor) const throw();

int indexOfAnyOf (const juce_wchar* charactersToLookFor,
int indexOfAnyOf (const String& charactersToLookFor,
int startIndex = 0,
bool ignoreCase = false) const throw();

int indexOf (const juce_wchar* text) const throw();
int indexOf (const String& text) const throw();

int indexOf (int startIndex,
const juce_wchar* textToLookFor) const throw();
const String& textToLookFor) const throw();

int indexOfIgnoreCase (const juce_wchar* textToLookFor) const throw();
int indexOfIgnoreCase (const String& textToLookFor) const throw();

int indexOfIgnoreCase (int startIndex,
const juce_wchar* textToLookFor) const throw();
const String& textToLookFor) const throw();

int lastIndexOfChar (juce_wchar character) const throw();

int lastIndexOf (const juce_wchar* textToLookFor) const throw();
int lastIndexOf (const String& textToLookFor) const throw();

int lastIndexOfIgnoreCase (const juce_wchar* textToLookFor) const throw();
int lastIndexOfIgnoreCase (const String& textToLookFor) const throw();

int lastIndexOfAnyOf (const juce_wchar* charactersToLookFor,
int lastIndexOfAnyOf (const String& charactersToLookFor,
bool ignoreCase = false) const throw();

// Substring extraction and manipulation methods..
@@ -1229,19 +1232,19 @@ public:

const String getLastCharacters (int numCharacters) const;

const String fromFirstOccurrenceOf (const juce_wchar* substringToStartFrom,
const String fromFirstOccurrenceOf (const String& substringToStartFrom,
bool includeSubStringInResult,
bool ignoreCase) const;

const String fromLastOccurrenceOf (const juce_wchar* substringToFind,
const String fromLastOccurrenceOf (const String& substringToFind,
bool includeSubStringInResult,
bool ignoreCase) const;

const String upToFirstOccurrenceOf (const juce_wchar* substringToEndWith,
const String upToFirstOccurrenceOf (const String& substringToEndWith,
bool includeSubStringInResult,
bool ignoreCase) const;

const String upToLastOccurrenceOf (const juce_wchar* substringToFind,
const String upToLastOccurrenceOf (const String& substringToFind,
bool includeSubStringInResult,
bool ignoreCase) const;

@@ -1249,9 +1252,9 @@ public:
const String trimStart() const;
const String trimEnd() const;

const String trimCharactersAtStart (const juce_wchar* charactersToTrim) const;
const String trimCharactersAtStart (const String& charactersToTrim) const;

const String trimCharactersAtEnd (const juce_wchar* charactersToTrim) const;
const String trimCharactersAtEnd (const String& charactersToTrim) const;

const String toUpperCase() const;

@@ -1259,25 +1262,25 @@ public:

const String replaceSection (int startIndex,
int numCharactersToReplace,
const juce_wchar* stringToInsert) const;
const String& stringToInsert) const;

const String replace (const juce_wchar* stringToReplace,
const juce_wchar* stringToInsertInstead,
const String replace (const String& stringToReplace,
const String& stringToInsertInstead,
bool ignoreCase = false) const;

const String replaceCharacter (juce_wchar characterToReplace,
juce_wchar characterToInsertInstead) const;

const String replaceCharacters (const String& charactersToReplace,
const juce_wchar* charactersToInsertInstead) const;
const String& charactersToInsertInstead) const;

const String retainCharacters (const juce_wchar* charactersToRetain) const;
const String retainCharacters (const String& charactersToRetain) const;

const String removeCharacters (const juce_wchar* charactersToRemove) const;
const String removeCharacters (const String& charactersToRemove) const;

const String initialSectionContainingOnly (const juce_wchar* permittedCharacters) const;
const String initialSectionContainingOnly (const String& permittedCharacters) const;

const String initialSectionNotContaining (const juce_wchar* charactersToStopAt) const;
const String initialSectionNotContaining (const String& charactersToStopAt) const;

bool isQuotedString() const;

@@ -1285,7 +1288,7 @@ public:

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

static const String repeatedString (const juce_wchar* stringToRepeat,
static const String repeatedString (const String& stringToRepeat,
int numberOfTimesToRepeat);

const String paddedLeft (juce_wchar padCharacter, int minimumLength) const;


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

@@ -94,7 +94,7 @@ AudioCDReader::~AudioCDReader()
static int getTrackNumber (const File& file)
{
return file.getFileName()
.initialSectionContainingOnly (T("0123456789"))
.initialSectionContainingOnly ("0123456789")
.getIntValue();
}


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

@@ -88,7 +88,7 @@ static OSType stringToOSType (const String& s1)
| ((OSType) (unsigned char) s[3]);
}
static const tchar* auIdentifierPrefix = T("AudioUnit:");
static const char* auIdentifierPrefix = "AudioUnit:";
static const String createAUPluginIdentifier (const ComponentDescription& desc)
{
@@ -133,8 +133,8 @@ static void getAUDetails (ComponentRecord* comp, String& name, String& manufactu
const String all ((const char*) nameString + 1, nameString[0]);
DBG ("name: "+ all);
manufacturer = all.upToFirstOccurrenceOf (T(":"), false, false).trim();
name = all.fromFirstOccurrenceOf (T(":"), false, false).trim();
manufacturer = all.upToFirstOccurrenceOf (":", false, false).trim();
name = all.fromFirstOccurrenceOf (":", false, false).trim();
}
if (infoString != 0 && infoString[0] != 0)


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

@@ -230,9 +230,9 @@ public:
diff = first->manufacturerName.compareLexicographically (second->manufacturerName);
else if (method == KnownPluginList::sortByFileSystemLocation)
diff = first->fileOrIdentifier.replaceCharacter ('\\', '/')
.upToLastOccurrenceOf (T("/"), false, false)
.upToLastOccurrenceOf ("/", false, false)
.compare (second->fileOrIdentifier.replaceCharacter ('\\', '/')
.upToLastOccurrenceOf (T("/"), false, false));
.upToLastOccurrenceOf ("/", false, false));
if (diff == 0)
diff = first->name.compareLexicographically (second->name);
@@ -299,8 +299,8 @@ private:
}
else
{
const String firstSubFolder (path.upToFirstOccurrenceOf (T("/"), false, false));
const String remainingPath (path.fromFirstOccurrenceOf (T("/"), false, false));
const String firstSubFolder (path.upToFirstOccurrenceOf ("/", false, false));
const String remainingPath (path.fromFirstOccurrenceOf ("/", false, false));
for (int i = subFolders.size(); --i >= 0;)
{
@@ -346,7 +346,7 @@ public:
{
String path (allPlugins.getUnchecked(i)
->fileOrIdentifier.replaceCharacter ('\\', '/')
.upToLastOccurrenceOf (T("/"), false, false));
.upToLastOccurrenceOf ("/", false, false));
if (path.substring (1, 2) == ":")
path = path.substring (2);
@@ -369,7 +369,7 @@ public:
#if JUCE_MAC
// avoid the special AU formatting nonsense on Mac..
m.addSubMenu (sub->folder.fromFirstOccurrenceOf (T(":"), false, false), subMenu);
m.addSubMenu (sub->folder.fromFirstOccurrenceOf (":", false, false), subMenu);
#else
m.addSubMenu (sub->folder, subMenu);
#endif


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

@@ -152,8 +152,8 @@ var::operator bool() const
case boolType: return value.boolValue;
case doubleType: return value.doubleValue != 0;
case stringType: return value.stringValue->getIntValue() != 0
|| value.stringValue->trim().equalsIgnoreCase (T("true"))
|| value.stringValue->trim().equalsIgnoreCase (T("yes"));
|| value.stringValue->trim().equalsIgnoreCase ("true")
|| value.stringValue->trim().equalsIgnoreCase ("yes");
case objectType: return value.objectValue != 0;
default: jassertfalse; break;
}
@@ -359,7 +359,7 @@ var::identifier::identifier (const String& name_)
{
/* An identifier string must be suitable for use as a script variable or XML
attribute, so it can only contain this limited set of characters.. */
jassert (name.containsOnly (T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")) && name.isNotEmpty());
jassert (name.containsOnly ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_") && name.isNotEmpty());
}
var::identifier::identifier (const char* const name_)
@@ -368,7 +368,7 @@ var::identifier::identifier (const char* const name_)
{
/* An identifier string must be suitable for use as a script variable or XML
attribute, so it can only contain this limited set of characters.. */
jassert (name.containsOnly (T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")) && name.isNotEmpty());
jassert (name.containsOnly ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_") && name.isNotEmpty());
}
var::identifier::~identifier()


+ 2
- 2
src/core/juce_Time.cpp View File

@@ -457,8 +457,8 @@ const String Time::getTimeZone() const throw()
zone[0] = zone[1];
if (zone[0].length() > 3
&& zone[0].containsIgnoreCase (T("daylight"))
&& zone[0].contains (T("GMT")))
&& zone[0].containsIgnoreCase ("daylight")
&& zone[0].contains ("GMT"))
zone[0] = "BST";
}


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

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


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

@@ -250,7 +250,7 @@ private:
break;
const int spacesNeeded = spacesPerTab - ((tabPos + x) % spacesPerTab);
t.text = t.text.replaceSection (tabPos, 1, String::repeatedString (T(" "), spacesNeeded));
t.text = t.text.replaceSection (tabPos, 1, String::repeatedString (" ", spacesNeeded));
}
x += t.text.length();
@@ -632,7 +632,7 @@ void CodeEditorComponent::insertTabAtCaret()
{
const int caretCol = indexToColumn (caretPos.getLineNumber(), caretPos.getIndexInLine());
const int spacesNeeded = spacesPerTab - (caretCol % spacesPerTab);
insertTextAtCaret (String::repeatedString (T(" "), spacesNeeded));
insertTextAtCaret (String::repeatedString (" ", spacesNeeded));
}
else
{


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

@@ -650,7 +650,7 @@ double Slider::getValueFromText (const String& text)
while (t.startsWithChar ('+'))
t = t.substring (1).trimStart();
return t.initialSectionContainingOnly (T("0123456789.,-"))
return t.initialSectionContainingOnly ("0123456789.,-")
.getDoubleValue();
}


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

@@ -1197,7 +1197,7 @@ void TextEditor::setText (const String& newText,
// if you're adding text with line-feeds to a single-line text editor, it
// ain't gonna look right!
jassert (multiline || ! newText.containsAnyOf (T("\r\n")));
jassert (multiline || ! newText.containsAnyOf ("\r\n"));
if (cursorWasAtEnd && ! isMultiLine())
moveCursorTo (getTotalNumChars(), false);
@@ -1592,9 +1592,9 @@ void TextEditor::insertTextAtCaret (const String& newText_)
}
if (! isMultiLine())
newText = newText.replaceCharacters (T("\r\n"), T(" "));
newText = newText.replaceCharacters ("\r\n", " ");
else
newText = newText.replace (T("\r\n"), T("\n"));
newText = newText.replace ("\r\n", "\n");
const int newCaretPos = selection.getStart() + newText.length();
const int insertIndex = selection.getStart();


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

@@ -431,7 +431,7 @@ const String Toolbar::toString() const
bool Toolbar::restoreFromString (ToolbarItemFactory& factoryToUse,
const String& savedVersion)
{
if (! savedVersion.startsWith (T("TB:")))
if (! savedVersion.startsWith ("TB:"))
return false;
StringArray tokens;


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

@@ -1826,7 +1826,7 @@ void Component::copyAllExplicitColoursTo (Component& target) const
{
const var::identifier name (properties.getName(i));
if (name.name.startsWith (T("jcclr_")))
if (name.name.startsWith ("jcclr_"))
if (target.properties.set (name, properties [name]))
changed = true;
}


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

@@ -135,21 +135,21 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw()
{
int modifiers = 0;
if (desc.containsWholeWordIgnoreCase (T("ctrl"))
|| desc.containsWholeWordIgnoreCase (T("control"))
|| desc.containsWholeWordIgnoreCase (T("ctl")))
if (desc.containsWholeWordIgnoreCase ("ctrl")
|| desc.containsWholeWordIgnoreCase ("control")
|| desc.containsWholeWordIgnoreCase ("ctl"))
modifiers |= ModifierKeys::ctrlModifier;
if (desc.containsWholeWordIgnoreCase (T("shift"))
|| desc.containsWholeWordIgnoreCase (T("shft")))
if (desc.containsWholeWordIgnoreCase ("shift")
|| desc.containsWholeWordIgnoreCase ("shft"))
modifiers |= ModifierKeys::shiftModifier;
if (desc.containsWholeWordIgnoreCase (T("alt"))
|| desc.containsWholeWordIgnoreCase (T("option")))
if (desc.containsWholeWordIgnoreCase ("alt")
|| desc.containsWholeWordIgnoreCase ("option"))
modifiers |= ModifierKeys::altModifier;
if (desc.containsWholeWordIgnoreCase (T("command"))
|| desc.containsWholeWordIgnoreCase (T("cmd")))
if (desc.containsWholeWordIgnoreCase ("command")
|| desc.containsWholeWordIgnoreCase ("cmd"))
modifiers |= ModifierKeys::commandModifier;
int key = 0;
@@ -184,9 +184,9 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw()
key = numberPadDecimalPoint;
else if (lastChar == '=')
key = numberPadEquals;
else if (desc.endsWith (T("separator")))
else if (desc.endsWith ("separator"))
key = numberPadSeparator;
else if (desc.endsWith (T("delete")))
else if (desc.endsWith ("delete"))
key = numberPadDelete;
}
@@ -200,9 +200,9 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw()
if (key == 0)
{
// give up and use the hex code..
const int hexCode = desc.fromFirstOccurrenceOf (T("#"), false, false)
const int hexCode = desc.fromFirstOccurrenceOf ("#", false, false)
.toLowerCase()
.retainCharacters (T("0123456789abcdef"))
.retainCharacters ("0123456789abcdef")
.getHexValue32();
if (hexCode > 0)


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

@@ -191,7 +191,7 @@ public:
{
String mainText (itemInfo.text);
String endText;
const int endIndex = mainText.indexOf (T("<end>"));
const int endIndex = mainText.indexOf ("<end>");
if (endIndex >= 0)
{


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

@@ -462,7 +462,7 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s)
tokens.removeEmptyStrings();
tokens.trim();
const bool fs = tokens[0].startsWithIgnoreCase (T("fs"));
const bool fs = tokens[0].startsWithIgnoreCase ("fs");
const int firstCoord = fs ? 1 : 0;
if (tokens.size() != firstCoord + 4)


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

@@ -133,7 +133,7 @@ static const FillType readFillTypeFromTree (const ValueTree& v)
{
const String type (v["type"].toString());
if (type.equalsIgnoreCase (T("solid")))
if (type.equalsIgnoreCase ("solid"))
{
const String colour (v ["colour"].toString());
return FillType (Colour (colour.isEmpty() ? (uint32) 0xff000000
@@ -231,12 +231,12 @@ DrawablePath* DrawablePath::createFromValueTree (const ValueTree& tree) throw()
p->strokeType
= PathStrokeType (tree ["strokeWidth"],
jointStyle.equalsIgnoreCase (T("curved")) ? PathStrokeType::curved
: (jointStyle.equalsIgnoreCase (T("bevel")) ? PathStrokeType::beveled
: PathStrokeType::mitered),
endStyle.equalsIgnoreCase (T("square")) ? PathStrokeType::square
: (endStyle.equalsIgnoreCase (T("round")) ? PathStrokeType::rounded
: PathStrokeType::butt));
jointStyle.equalsIgnoreCase ("curved") ? PathStrokeType::curved
: (jointStyle.equalsIgnoreCase ("bevel") ? PathStrokeType::beveled
: PathStrokeType::mitered),
endStyle.equalsIgnoreCase ("square") ? PathStrokeType::square
: (endStyle.equalsIgnoreCase ("round") ? PathStrokeType::rounded
: PathStrokeType::butt));
p->path.clear();
p->path.restoreFromString (tree ["path"]);


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

@@ -87,25 +87,25 @@ public:
const String aspect (xml.getStringAttribute ("preserveAspectRatio"));
if (aspect.containsIgnoreCase (T("none")))
if (aspect.containsIgnoreCase ("none"))
{
placementFlags = RectanglePlacement::stretchToFit;
}
else
{
if (aspect.containsIgnoreCase (T("slice")))
if (aspect.containsIgnoreCase ("slice"))
placementFlags |= RectanglePlacement::fillDestination;
if (aspect.containsIgnoreCase (T("xMin")))
if (aspect.containsIgnoreCase ("xMin"))
placementFlags |= RectanglePlacement::xLeft;
else if (aspect.containsIgnoreCase (T("xMax")))
else if (aspect.containsIgnoreCase ("xMax"))
placementFlags |= RectanglePlacement::xRight;
else
placementFlags |= RectanglePlacement::xMid;
if (aspect.containsIgnoreCase (T("yMin")))
if (aspect.containsIgnoreCase ("yMin"))
placementFlags |= RectanglePlacement::yTop;
else if (aspect.containsIgnoreCase (T("yMax")))
else if (aspect.containsIgnoreCase ("yMax"))
placementFlags |= RectanglePlacement::yBottom;
else
placementFlags |= RectanglePlacement::yMid;
@@ -213,7 +213,7 @@ private:
const String d (xml.getStringAttribute ("d").trimStart());
Path path;
if (getStyleAttribute (&xml, "fill-rule").trim().equalsIgnoreCase (T("evenodd")))
if (getStyleAttribute (&xml, "fill-rule").trim().equalsIgnoreCase ("evenodd"))
path.setUsingNonZeroWinding (false);
int index = 0;
@@ -225,7 +225,7 @@ private:
const String validCommandChars ("MmLlHhVvCcSsQqTtAaZz");
for (;;)
while (d[index] != 0)
{
float x, y, x2, y2, x3, y3;
@@ -695,10 +695,10 @@ private:
if (fillOpacity.isNotEmpty())
opacity *= (jlimit (0.0f, 1.0f, fillOpacity.getFloatValue()));
if (fill.startsWithIgnoreCase (T("url")))
if (fill.startsWithIgnoreCase ("url"))
{
const String id (fill.fromFirstOccurrenceOf (T("#"), false, false)
.upToLastOccurrenceOf (T(")"), false, false).trim());
const String id (fill.fromFirstOccurrenceOf ("#", false, false)
.upToLastOccurrenceOf (")", false, false).trim());
const XmlElement* const fillXml = findElementForId (topLevelXml, id);
@@ -736,7 +736,7 @@ private:
float dx = 0.0f;
float dy = 0.0f;
const bool userSpace = fillXml->getStringAttribute ("gradientUnits").equalsIgnoreCase (T("userSpaceOnUse"));
const bool userSpace = fillXml->getStringAttribute ("gradientUnits").equalsIgnoreCase ("userSpaceOnUse");
if (! userSpace)
{
@@ -778,7 +778,7 @@ private:
}
}
if (fill.equalsIgnoreCase (T("none")))
if (fill.equalsIgnoreCase ("none"))
return Colours::transparentBlack;
int i = 0;
@@ -792,21 +792,21 @@ private:
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")));
//const String dashOffset (getStyleAttribute (xml, T("stroke-dashoffset")));
//const String mitreLimit (getStyleAttribute (xml, "stroke-miterlimit"));
//const String dashArray (getStyleAttribute (xml, "stroke-dasharray"));
//const String dashOffset (getStyleAttribute (xml, "stroke-dashoffset"));
PathStrokeType::JointStyle joinStyle = PathStrokeType::mitered;
PathStrokeType::EndCapStyle capStyle = PathStrokeType::butt;
if (join.equalsIgnoreCase (T("round")))
if (join.equalsIgnoreCase ("round"))
joinStyle = PathStrokeType::curved;
else if (join.equalsIgnoreCase (T("bevel")))
else if (join.equalsIgnoreCase ("bevel"))
joinStyle = PathStrokeType::beveled;
if (cap.equalsIgnoreCase (T("round")))
if (cap.equalsIgnoreCase ("round"))
capStyle = PathStrokeType::rounded;
else if (cap.equalsIgnoreCase (T("square")))
else if (cap.equalsIgnoreCase ("square"))
capStyle = PathStrokeType::square;
float ox = 0.0f, oy = 0.0f;
@@ -1137,8 +1137,8 @@ private:
while (t.isNotEmpty())
{
StringArray tokens;
tokens.addTokens (t.fromFirstOccurrenceOf (T("("), false, false)
.upToFirstOccurrenceOf (T(")"), false, false),
tokens.addTokens (t.fromFirstOccurrenceOf ("(", false, false)
.upToFirstOccurrenceOf (")", false, false),
", ", String::empty);
tokens.removeEmptyStrings (true);
@@ -1150,24 +1150,24 @@ private:
AffineTransform trans;
if (t.startsWithIgnoreCase (T("matrix")))
if (t.startsWithIgnoreCase ("matrix"))
{
trans = AffineTransform (numbers[0], numbers[2], numbers[4],
numbers[1], numbers[3], numbers[5]);
}
else if (t.startsWithIgnoreCase (T("translate")))
else if (t.startsWithIgnoreCase ("translate"))
{
jassert (tokens.size() == 2);
trans = AffineTransform::translation (numbers[0], numbers[1]);
}
else if (t.startsWithIgnoreCase (T("scale")))
else if (t.startsWithIgnoreCase ("scale"))
{
if (tokens.size() == 1)
trans = AffineTransform::scale (numbers[0], numbers[0]);
else
trans = AffineTransform::scale (numbers[0], numbers[1]);
}
else if (t.startsWithIgnoreCase (T("rotate")))
else if (t.startsWithIgnoreCase ("rotate"))
{
if (tokens.size() != 3)
trans = AffineTransform::rotation (numbers[0] / (180.0f / float_Pi));
@@ -1175,19 +1175,19 @@ private:
trans = AffineTransform::rotation (numbers[0] / (180.0f / float_Pi),
numbers[1], numbers[2]);
}
else if (t.startsWithIgnoreCase (T("skewX")))
else if (t.startsWithIgnoreCase ("skewX"))
{
trans = AffineTransform (1.0f, tanf (numbers[0] * (float_Pi / 180.0f)), 0.0f,
0.0f, 1.0f, 0.0f);
}
else if (t.startsWithIgnoreCase (T("skewY")))
else if (t.startsWithIgnoreCase ("skewY"))
{
trans = AffineTransform (1.0f, 0.0f, 0.0f,
tanf (numbers[0] * (float_Pi / 180.0f)), 1.0f, 0.0f);
}
result = trans.followedBy (result);
t = t.fromFirstOccurrenceOf (T(")"), false, false).trimStart();
t = t.fromFirstOccurrenceOf (")", false, false).trimStart();
}
return result;


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

@@ -361,7 +361,7 @@ void GlyphArrangement::addFittedText (const Font& f,
// doesn't make much sense if this is outside a sensible range of 0.5 to 1.0
jassert (minimumHorizontalScale > 0 && minimumHorizontalScale <= 1.0f);
if (text.containsAnyOf (T("\r\n")))
if (text.containsAnyOf ("\r\n"))
{
GlyphArrangement ga;
ga.addJustifiedText (f, text, x, y, width, layout);
@@ -420,7 +420,7 @@ void GlyphArrangement::addFittedText (const Font& f,
const int originalStartIndex = startIndex;
int numLines = 1;
if (length <= 12 && ! txt.containsAnyOf (T(" -\t\r\n")))
if (length <= 12 && ! txt.containsAnyOf (" -\t\r\n"))
maximumLines = 1;
maximumLines = jmin (maximumLines, length);


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

@@ -43,7 +43,7 @@ public:
Token (const String& t,
const Font& f,
const bool isWhitespace_) throw()
const bool isWhitespace_)
: text (t),
font (f),
x(0),
@@ -52,7 +52,7 @@ public:
{
w = font.getStringWidth (t);
h = roundToInt (f.getHeight());
isNewLine = t.containsAnyOf (T("\r\n"));
isNewLine = t.containsChar ('\n') || t.containsChar ('\r');
}
Token (const Token& other) throw()
@@ -75,7 +75,7 @@ public:
void draw (Graphics& g,
const int xOffset,
const int yOffset) throw()
const int yOffset)
{
if (! isWhitespace)
{


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

@@ -291,7 +291,7 @@ void PositionedRectangle::decodePosString (const String& s, uint8& mode, double&
if (s.containsChar ('%'))
{
mode |= proportionOfParentSize;
value = s.removeCharacters (T("%rcRC")).getDoubleValue() / 100.0;
value = s.removeCharacters ("%rcRC").getDoubleValue() / 100.0;
}
else
{
@@ -302,7 +302,7 @@ void PositionedRectangle::decodePosString (const String& s, uint8& mode, double&
else
mode |= absoluteFromParentTopLeft;
value = s.removeCharacters (T("rcRC")).getDoubleValue();
value = s.removeCharacters ("rcRC").getDoubleValue();
}
}
@@ -311,7 +311,7 @@ void PositionedRectangle::decodeSizeString (const String& s, uint8& mode, double
if (s.containsChar ('%'))
{
mode = proportionalSize;
value = s.upToFirstOccurrenceOf (T("%"), false, false).getDoubleValue() / 100.0;
value = s.upToFirstOccurrenceOf ("%", false, false).getDoubleValue() / 100.0;
}
else if (s.containsChar ('M'))
{


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

@@ -67,7 +67,7 @@ DirectoryIterator::DirectoryIterator (const File& directory,
{
do
{
if (! filename.containsOnly (T(".")))
if (! filename.containsOnly ("."))
{
bool addToList = false;


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

@@ -158,7 +158,7 @@ static const String parseAbsolutePath (String path)
else
{
// expand a name of type "~dave/abc"
const String userName (path.substring (1).upToFirstOccurrenceOf (T("/"), false, false));
const String userName (path.substring (1).upToFirstOccurrenceOf ("/", false, false));
struct passwd* const pw = getpwnam (userName.toUTF8());
if (pw != 0)
@@ -182,7 +182,7 @@ static const String parseAbsolutePath (String path)
"File::getCurrentWorkingDirectory().getChildFile (myUnknownPath)" would return an absolute
path if that's what was supplied, or would evaluate a partial path relative to the CWD.
*/
jassert (path.startsWith (T("./")) || path.startsWith (T("../"))); // (assume that a path "./xyz" is deliberately intended to be relative to the CWD)
jassert (path.startsWith ("./") || path.startsWith ("../")); // (assume that a path "./xyz" is deliberately intended to be relative to the CWD)
return File::getCurrentWorkingDirectory().getChildFile (path).getFullPathName();
}
@@ -689,7 +689,7 @@ int File::findChildFiles (Array<File>& results,
do
{
if (fileTypeMatches (whatToLookFor, itemIsDirectory, itemIsHidden)
&& ! filename.containsOnly (T(".")))
&& ! filename.containsOnly ("."))
{
results.add (File (path + filename, 0));
++total;
@@ -744,7 +744,7 @@ int File::getNumberOfChildFiles (const int whatToLookFor,
do
{
if (fileTypeMatches (whatToLookFor, itemIsDirectory, itemIsHidden)
&& ! filename.containsOnly (T(".")))
&& ! filename.containsOnly ("."))
{
++count;
}
@@ -816,7 +816,7 @@ const File File::getNonexistentChildFile (const String& prefix_,
if (openBracks > 0
&& closeBracks > openBracks
&& prefix.substring (openBracks + 1, closeBracks).containsOnly (T("0123456789")))
&& prefix.substring (openBracks + 1, closeBracks).containsOnly ("0123456789"))
{
num = prefix.substring (openBracks + 1, closeBracks).getIntValue() + 1;
prefix = prefix.substring (0, openBracks);
@@ -1008,13 +1008,13 @@ const String File::createLegalPathName (const String& original)
s = s.substring (2);
}
return start + s.removeCharacters (T("\"#@,;:<>*^|?"))
return start + s.removeCharacters ("\"#@,;:<>*^|?")
.substring (0, 1024);
}
const String File::createLegalFileName (const String& original)
{
String s (original.removeCharacters (T("\"#@,;:<>*^|?\\/")));
String s (original.removeCharacters ("\"#@,;:<>*^|?\\/"));
const int maxLength = 128; // only the length of the filename, not the whole path
const int len = s.length();


+ 7
- 7
src/io/network/juce_URL.cpp View File

@@ -68,7 +68,7 @@ URL::URL (const String& url_)
}
while (i >= 0);
url = url.upToFirstOccurrenceOf (T("?"), false, false);
url = url.upToFirstOccurrenceOf ("?", false, false);
}
}
@@ -132,7 +132,7 @@ static int findStartOfDomain (const String& url)
int i = 0;
while (CharacterFunctions::isLetterOrDigit (url[i])
|| CharacterFunctions::indexOfChar (T("+-."), url[i], false) >= 0)
|| CharacterFunctions::indexOfChar (L"+-.", url[i], false) >= 0)
++i;
return url[i] == ':' ? i + 1 : 0;
@@ -197,17 +197,17 @@ const URL URL::withNewSubPath (const String& newPath) const
//==============================================================================
bool URL::isProbablyAWebsiteURL (const String& possibleURL)
{
if (possibleURL.startsWithIgnoreCase (T("http:"))
|| possibleURL.startsWithIgnoreCase (T("ftp:")))
if (possibleURL.startsWithIgnoreCase ("http:")
|| possibleURL.startsWithIgnoreCase ("ftp:"))
return true;
if (possibleURL.startsWithIgnoreCase (T("file:"))
if (possibleURL.startsWithIgnoreCase ("file:")
|| possibleURL.containsChar ('@')
|| possibleURL.endsWithChar ('.')
|| (! possibleURL.containsChar ('.')))
return false;
if (possibleURL.startsWithIgnoreCase (T("www."))
if (possibleURL.startsWithIgnoreCase ("www.")
&& possibleURL.substring (5).containsChar ('.'))
return true;
@@ -589,7 +589,7 @@ bool URL::launchInDefaultBrowser() const
{
String u (toString (true));
if (u.contains (T("@")) && ! u.contains (T(":")))
if (u.containsChar ('@') && ! u.containsChar (':'))
u = "mailto:" + u;
return juce_launchFile (u, String::empty);


+ 1
- 1
src/native/common/juce_posix_SharedCode.h View File

@@ -184,7 +184,7 @@ void JUCE_CALLTYPE Thread::sleep (int millisecs)
//==============================================================================
const juce_wchar File::separator = '/';
const juce_wchar* File::separatorString = T("/");
const juce_wchar* File::separatorString = L"/";
//==============================================================================
const File File::getCurrentWorkingDirectory()


+ 3
- 3
src/native/linux/juce_linux_Audio.cpp View File

@@ -73,13 +73,13 @@ static void getDeviceProperties (const String& deviceID,
snd_ctl_t* handle;
if (snd_ctl_open (&handle, deviceID.upToLastOccurrenceOf (T(","), false, false).toUTF8(), SND_CTL_NONBLOCK) >= 0)
if (snd_ctl_open (&handle, deviceID.upToLastOccurrenceOf (",", false, false).toUTF8(), SND_CTL_NONBLOCK) >= 0)
{
snd_pcm_info_t* info;
snd_pcm_info_alloca (&info);
snd_pcm_info_set_stream (info, SND_PCM_STREAM_PLAYBACK);
snd_pcm_info_set_device (info, deviceID.fromLastOccurrenceOf (T(","), false, false).getIntValue());
snd_pcm_info_set_device (info, deviceID.fromLastOccurrenceOf (",", false, false).getIntValue());
snd_pcm_info_set_subdevice (info, 0);
if (snd_ctl_pcm_info (handle, info) >= 0)
@@ -867,7 +867,7 @@ public:
{
String cardId (snd_ctl_card_info_get_id (info));
if (cardId.removeCharacters (T("0123456789")).isEmpty())
if (cardId.removeCharacters ("0123456789").isEmpty())
cardId = String (cardNum);
int device = -1;


+ 2
- 2
src/native/linux/juce_linux_Files.cpp View File

@@ -399,11 +399,11 @@ void juce_findFileClose (void* handle)
bool juce_launchFile (const String& fileName,
const String& parameters)
{
String cmdString (fileName.replace (T(" "), T("\\ "),false));
String cmdString (fileName.replace (" ", "\\ ",false));
cmdString << " " << parameters;
if (URL::isProbablyAWebsiteURL (fileName)
|| cmdString.startsWithIgnoreCase (T("file:"))
|| cmdString.startsWithIgnoreCase ("file:")
|| URL::isProbablyAnEmailAddress (fileName))
{
// create a command that tries to launch a bunch of likely browsers


+ 3
- 3
src/native/linux/juce_linux_Fonts.cpp View File

@@ -199,9 +199,9 @@ public:
// Surely there must be a better way to do this?
const String name (face->family_name);
newFace->setSerif (! (name.containsIgnoreCase (T("Sans"))
|| name.containsIgnoreCase (T("Verdana"))
|| name.containsIgnoreCase (T("Arial"))));
newFace->setSerif (! (name.containsIgnoreCase ("Sans")
|| name.containsIgnoreCase ("Verdana")
|| name.containsIgnoreCase ("Arial")));
}
FT_Done_Face (face);


+ 6
- 6
src/native/linux/juce_linux_JackAudio.cpp View File

@@ -193,8 +193,8 @@ public:
{
const String portName (ports [j++]);
if (portName.upToFirstOccurrenceOf (T(":"), false, false) == getName())
names.add (portName.fromFirstOccurrenceOf (T(":"), false, false));
if (portName.upToFirstOccurrenceOf (":", false, false) == getName())
names.add (portName.fromFirstOccurrenceOf (":", false, false));
}
free (ports);
@@ -240,7 +240,7 @@ public:
{
const String portName (ports[i]);
if (inputChannels[i] && portName.upToFirstOccurrenceOf (T(":"), false, false) == getName())
if (inputChannels[i] && portName.upToFirstOccurrenceOf (":", false, false) == getName())
{
int error = JUCE_NAMESPACE::jack_connect (client, ports[i], JUCE_NAMESPACE::jack_port_name ((jack_port_t*) inputPorts[i]));
if (error != 0)
@@ -264,7 +264,7 @@ public:
{
const String portName (ports[i]);
if (outputChannels[i] && portName.upToFirstOccurrenceOf (T(":"), false, false) == getName())
if (outputChannels[i] && portName.upToFirstOccurrenceOf (":", false, false) == getName())
{
int error = JUCE_NAMESPACE::jack_connect (client, JUCE_NAMESPACE::jack_port_name ((jack_port_t*) outputPorts[i]), ports[i]);
if (error != 0)
@@ -500,7 +500,7 @@ public:
while (ports[j] != 0)
{
String clientName (ports[j]);
clientName = clientName.upToFirstOccurrenceOf (T(":"), false, false);
clientName = clientName.upToFirstOccurrenceOf (":", false, false);
if (clientName != String (JUCE_JACK_CLIENT_NAME)
&& ! inputNames.contains (clientName))
@@ -524,7 +524,7 @@ public:
while (ports[j] != 0)
{
String clientName (ports[j]);
clientName = clientName.upToFirstOccurrenceOf (T(":"), false, false);
clientName = clientName.upToFirstOccurrenceOf (":", false, false);
if (clientName != String (JUCE_JACK_CLIENT_NAME)
&& ! outputNames.contains (clientName))


+ 7
- 9
src/native/linux/juce_linux_Network.cpp View File

@@ -131,7 +131,7 @@ public:
int proxyPort = 0;
String proxyURL (getenv ("http_proxy"));
if (proxyURL.startsWithIgnoreCase (T("http://")))
if (proxyURL.startsWithIgnoreCase ("http://"))
{
if (! decomposeURL (proxyURL, proxyName, proxyPath, proxyPort))
return false;
@@ -217,20 +217,18 @@ public:
StringArray lines;
lines.addLines (responseHeader);
// NB - using charToString() here instead of just T(" "), because that was
// causing a mysterious gcc internal compiler error...
const int statusCode = responseHeader.fromFirstOccurrenceOf (String::charToString (' '), false, false)
const int statusCode = responseHeader.fromFirstOccurrenceOf (" ", false, false)
.substring (0, 3).getIntValue();
//int contentLength = findHeaderItem (lines, T("Content-Length:")).getIntValue();
//bool isChunked = findHeaderItem (lines, T("Transfer-Encoding:")).equalsIgnoreCase ("chunked");
//int contentLength = findHeaderItem (lines, "Content-Length:").getIntValue();
//bool isChunked = findHeaderItem (lines, "Transfer-Encoding:").equalsIgnoreCase ("chunked");
String location (findHeaderItem (lines, "Location:"));
if (statusCode >= 300 && statusCode < 400
&& location.isNotEmpty())
{
if (! location.startsWithIgnoreCase (T("http://")))
if (! location.startsWithIgnoreCase ("http://"))
location = "http://" + location;
if (levelsOfRedirection++ < 3)
@@ -357,7 +355,7 @@ private:
const String header (String::fromUTF8 ((const char*) buffer.getData()));
if (header.startsWithIgnoreCase (T("HTTP/")))
if (header.startsWithIgnoreCase ("HTTP/"))
return header.trimEnd();
return String::empty;
@@ -367,7 +365,7 @@ private:
static bool decomposeURL (const String& url,
String& host, String& path, int& port)
{
if (! url.startsWithIgnoreCase (T("http://")))
if (! url.startsWithIgnoreCase ("http://"))
return false;
const int nextSlash = url.indexOfChar (7, '/');


+ 4
- 4
src/native/linux/juce_linux_SystemStats.cpp View File

@@ -92,22 +92,22 @@ static const String getCpuInfo (const char* key, bool lastOne = false) throw()
bool SystemStats::hasMMX() throw()
{
return getCpuInfo ("flags").contains (T("mmx"));
return getCpuInfo ("flags").contains ("mmx");
}
bool SystemStats::hasSSE() throw()
{
return getCpuInfo ("flags").contains (T("sse"));
return getCpuInfo ("flags").contains ("sse");
}
bool SystemStats::hasSSE2() throw()
{
return getCpuInfo ("flags").contains (T("sse2"));
return getCpuInfo ("flags").contains ("sse2");
}
bool SystemStats::has3DNow() throw()
{
return getCpuInfo ("flags").contains (T("3dnow"));
return getCpuInfo ("flags").contains ("3dnow");
}
const String SystemStats::getCpuVendor() throw()


+ 1
- 1
src/native/linux/juce_linux_Windowing.cpp View File

@@ -2639,7 +2639,7 @@ private:
}
for (int i = 0; i < lines.size(); ++i)
dragAndDropFiles.add (URL::removeEscapeChars (lines[i].fromFirstOccurrenceOf (T("file://"), false, true)));
dragAndDropFiles.add (URL::removeEscapeChars (lines[i].fromFirstOccurrenceOf ("file://", false, true)));
dragAndDropFiles.trim();
dragAndDropFiles.removeEmptyStrings();


+ 1
- 1
src/native/mac/juce_mac_FileChooser.mm View File

@@ -93,7 +93,7 @@ void FileChooser::showPlatformDialog (Array<File>& results,
const ScopedAutoReleasePool pool;
StringArray* filters = new StringArray();
filters->addTokens (filter.replaceCharacters (T(",:"), T(";;")), T(";"), String::empty);
filters->addTokens (filter.replaceCharacters (",:", ";;"), ";", String::empty);
filters->trim();
filters->removeEmptyStrings();


+ 1
- 1
src/native/mac/juce_mac_Files.mm View File

@@ -245,7 +245,7 @@ const File File::getSpecialLocation (const SpecialLocationType type)
const File exe (juce_getExecutableFile());
const File parent (exe.getParentDirectory());
return parent.getFullPathName().endsWithIgnoreCase (T("Contents/MacOS"))
return parent.getFullPathName().endsWithIgnoreCase ("Contents/MacOS")
? parent.getParentDirectory().getParentDirectory()
: exe;
}


+ 6
- 6
src/native/mac/juce_mac_Fonts.mm View File

@@ -65,13 +65,13 @@ public:
for (NSString* i in familyFonts)
{
const String fn (nsStringToJuce (i));
const String afterDash (fn.fromFirstOccurrenceOf (T("-"), false, false));
const String afterDash (fn.fromFirstOccurrenceOf ("-", false, false));
const bool probablyBold = afterDash.containsIgnoreCase (T("bold")) || fn.endsWithIgnoreCase (T("bold"));
const bool probablyItalic = afterDash.containsIgnoreCase (T("oblique"))
|| afterDash.containsIgnoreCase (T("italic"))
|| fn.endsWithIgnoreCase (T("oblique"))
|| fn.endsWithIgnoreCase (T("italic"));
const bool probablyBold = afterDash.containsIgnoreCase ("bold") || fn.endsWithIgnoreCase ("bold");
const bool probablyItalic = afterDash.containsIgnoreCase ("oblique")
|| afterDash.containsIgnoreCase ("italic")
|| fn.endsWithIgnoreCase ("oblique")
|| fn.endsWithIgnoreCase ("italic");
if (probablyBold == font.isBold()
&& probablyItalic == font.isItalic())


+ 1
- 1
src/native/mac/juce_mac_MainMenu.mm View File

@@ -245,7 +245,7 @@ public:
void addMenuItem (PopupMenu::MenuItemIterator& iter, NSMenu* menuToAddTo,
const int topLevelMenuId, const int topLevelIndex)
{
NSString* text = juceStringToNS (iter.itemName.upToFirstOccurrenceOf (T("<end>"), false, true));
NSString* text = juceStringToNS (iter.itemName.upToFirstOccurrenceOf ("<end>", false, true));
if (text == 0)
text = @"";


+ 5
- 5
src/native/mac/juce_mac_Network.mm View File

@@ -86,9 +86,9 @@ bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAdd
String script;
script << "tell application \"Mail\"\r\n"
"set newMessage to make new outgoing message with properties {subject:\""
<< emailSubject.replace (T("\""), T("\\\""))
<< emailSubject.replace ("\"", "\\\"")
<< "\", content:\""
<< bodyText.replace (T("\""), T("\\\""))
<< bodyText.replace ("\"", "\\\"")
<< "\" & return & return}\r\n"
"tell newMessage\r\n"
"set visible to true\r\n"
@@ -101,7 +101,7 @@ bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAdd
{
script << "tell content\r\n"
"make new attachment with properties {file name:\""
<< filesToAttach[i].replace (T("\""), T("\\\""))
<< filesToAttach[i].replace ("\"", "\\\"")
<< "\"} at after the last paragraph\r\n"
"end tell\r\n";
}
@@ -352,8 +352,8 @@ void* juce_openInternetFile (const String& url,
for (int i = 0; i < headerLines.size(); ++i)
{
const String key (headerLines[i].upToFirstOccurrenceOf (T(":"), false, false).trim());
const String value (headerLines[i].fromFirstOccurrenceOf (T(":"), false, false).trim());
const String key (headerLines[i].upToFirstOccurrenceOf (":", false, false).trim());
const String value (headerLines[i].fromFirstOccurrenceOf (":", false, false).trim());
if (key.isNotEmpty() && value.isNotEmpty())
[req addValue: juceStringToNS (value) forHTTPHeaderField: juceStringToNS (key)];


+ 2
- 2
src/native/mac/juce_mac_WebBrowserComponent.mm View File

@@ -117,8 +117,8 @@ public:
{
for (int i = 0; i < headers->size(); ++i)
{
const String headerName ((*headers)[i].upToFirstOccurrenceOf (T(":"), false, false).trim());
const String headerValue ((*headers)[i].fromFirstOccurrenceOf (T(":"), false, false).trim());
const String headerName ((*headers)[i].upToFirstOccurrenceOf (":", false, false).trim());
const String headerValue ((*headers)[i].fromFirstOccurrenceOf (":", false, false).trim());
[r setValue: juceStringToNS (headerValue)
forHTTPHeaderField: juceStringToNS (headerName)];


+ 3
- 3
src/native/windows/juce_win32_ASIO.cpp View File

@@ -229,7 +229,7 @@ public:
// unfortunate workaround for certain manufacturers whose drivers crash horribly if you make
// dynamic changes to the buffer size...
shouldUsePreferredSize = shouldUsePreferredSize
|| getName().containsIgnoreCase (T("Digidesign"));
|| getName().containsIgnoreCase ("Digidesign");
if (shouldUsePreferredSize)
{
@@ -1768,11 +1768,11 @@ public:
jassert (hasScanned); // need to call scanForDevices() before doing this
for (int i = deviceNames.size(); --i >= 0;)
if (deviceNames[i].containsIgnoreCase (T("asio4all")))
if (deviceNames[i].containsIgnoreCase ("asio4all"))
return i; // asio4all is a safe choice for a default..
#if JUCE_DEBUG
if (deviceNames.size() > 1 && deviceNames[0].containsIgnoreCase (T("digidesign")))
if (deviceNames.size() > 1 && deviceNames[0].containsIgnoreCase ("digidesign"))
return 1; // (the digi m-box driver crashes the app when you run
// it in the debugger, which can be a bit annoying)
#endif


+ 2
- 2
src/native/windows/juce_win32_CameraDevice.cpp View File

@@ -292,8 +292,8 @@ public:
"bicompression=\"WMV3\" bisizeimage=\"0\" bixpelspermeter=\"0\" biypelspermeter=\"0\" biclrused=\"0\" biclrimportant=\"0\"/> "
"</videoinfoheader></wmmediatype></streamconfig></profile>");
prof = prof.replace (T("$WIDTH"), String (width))
.replace (T("$HEIGHT"), String (height));
prof = prof.replace ("$WIDTH", String (width))
.replace ("$HEIGHT", String (height));
ComSmartPtr <IWMProfile> currentProfile;
hr = profileManager->LoadProfileByData ((const WCHAR*) prof, &currentProfile);


+ 1
- 1
src/native/windows/juce_win32_Fonts.cpp View File

@@ -38,7 +38,7 @@ static int CALLBACK wfontEnum2 (ENUMLOGFONTEXW* lpelfe,
{
const String fontName (lpelfe->elfLogFont.lfFaceName);
((StringArray*) lParam)->addIfNotAlreadyThere (fontName.removeCharacters (T("@")));
((StringArray*) lParam)->addIfNotAlreadyThere (fontName.removeCharacters ("@"));
}
return 1;


+ 1
- 1
src/native/windows/juce_win32_Midi.cpp View File

@@ -476,7 +476,7 @@ MidiOutput* MidiOutput::openDevice (int index)
{
// use the microsoft sw synth as a default - best not to allow deviceId
// to be MIDI_MAPPER, or else device sharing breaks
if (String (mc.szPname, sizeof (mc.szPname)).containsIgnoreCase (T("microsoft")))
if (String (mc.szPname, sizeof (mc.szPname)).containsIgnoreCase ("microsoft"))
deviceId = i;
if (index == n)


+ 2
- 2
src/native/windows/juce_win32_Network.cpp View File

@@ -133,7 +133,7 @@ void* juce_openInternetFile (const String& url,
InternetSetOption (sessionHandle, INTERNET_OPTION_CONNECT_TIMEOUT, &timeOutMs, sizeof (timeOutMs));
const bool isFtp = url.startsWithIgnoreCase (T("ftp:"));
const bool isFtp = url.startsWithIgnoreCase ("ftp:");
#if WORKAROUND_TIMEOUT_BUG
HINTERNET connection = 0;
@@ -179,7 +179,7 @@ void* juce_openInternetFile (const String& url,
DWORD flags = INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_CACHE_WRITE;
if (url.startsWithIgnoreCase (T("https:")))
if (url.startsWithIgnoreCase ("https:"))
flags |= INTERNET_FLAG_SECURE; // (this flag only seems necessary if the OS is running IE6 -
// IE7 seems to automatically work out when it's https)


+ 3
- 3
src/native/windows/juce_win32_PlatformUtils.cpp View File

@@ -35,11 +35,11 @@ static HKEY findKeyForPath (String name,
{
HKEY rootKey = 0;
if (name.startsWithIgnoreCase (T("HKEY_CURRENT_USER\\")))
if (name.startsWithIgnoreCase ("HKEY_CURRENT_USER\\"))
rootKey = HKEY_CURRENT_USER;
else if (name.startsWithIgnoreCase (T("HKEY_LOCAL_MACHINE\\")))
else if (name.startsWithIgnoreCase ("HKEY_LOCAL_MACHINE\\"))
rootKey = HKEY_LOCAL_MACHINE;
else if (name.startsWithIgnoreCase (T("HKEY_CLASSES_ROOT\\")))
else if (name.startsWithIgnoreCase ("HKEY_CLASSES_ROOT\\"))
rootKey = HKEY_CLASSES_ROOT;
if (rootKey != 0)


+ 23
- 0
src/text/juce_CharacterFunctions.cpp View File

@@ -174,6 +174,29 @@ int CharacterFunctions::compareIgnoreCase (const juce_wchar* s1, const juce_wcha
#endif
}
int CharacterFunctions::compareIgnoreCase (const juce_wchar* s1, const char* s2) throw()
{
jassert (s1 != 0 && s2 != 0);
for (;;)
{
if (*s1 != *s2)
{
const int diff = toUpperCase (*s1) - toUpperCase (*s2);
if (diff != 0)
return diff < 0 ? -1 : 1;
}
else if (*s1 == 0)
break;
++s1;
++s2;
}
return 0;
}
int CharacterFunctions::compareIgnoreCase (const char* const s1, const char* const s2, const int maxChars) throw()
{
jassert (s1 != 0 && s2 != 0);


+ 1
- 0
src/text/juce_CharacterFunctions.h View File

@@ -85,6 +85,7 @@ public:
static int compareIgnoreCase (const char* const s1, const char* const s2) throw();
static int compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2) throw();
static int compareIgnoreCase (const juce_wchar* s1, const char* s2) throw();
static int compareIgnoreCase (const char* const s1, const char* const s2, const int maxChars) throw();
static int compareIgnoreCase (const juce_wchar* s1, const juce_wchar* s2, int maxChars) throw();


+ 7
- 7
src/text/juce_LocalisedStrings.cpp View File

@@ -72,11 +72,11 @@ static int findCloseQuote (const String& text, int startPos)
static const String unescapeString (const String& s)
{
return s.replace (T("\\\""), T("\""))
.replace (T("\\\'"), T("\'"))
.replace (T("\\t"), T("\t"))
.replace (T("\\r"), T("\r"))
.replace (T("\\n"), T("\n"));
return s.replace ("\\\"", "\"")
.replace ("\\\'", "\'")
.replace ("\\t", "\t")
.replace ("\\r", "\r")
.replace ("\\n", "\n");
}
void LocalisedStrings::loadFromText (const String& fileContents)
@@ -105,11 +105,11 @@ void LocalisedStrings::loadFromText (const String& fileContents)
translations.set (originalText, newText);
}
}
else if (line.startsWithIgnoreCase (T("language:")))
else if (line.startsWithIgnoreCase ("language:"))
{
languageName = line.substring (9).trim();
}
else if (line.startsWithIgnoreCase (T("countries:")))
else if (line.startsWithIgnoreCase ("countries:"))
{
countryCodes.addTokens (line.substring (10).trim(), true);
countryCodes.trim();


+ 100
- 125
src/text/juce_String.cpp View File

@@ -563,6 +563,12 @@ bool String::equalsIgnoreCase (const juce_wchar* t) const throw()
: isEmpty();
}
bool String::equalsIgnoreCase (const char* t) const throw()
{
return t != 0 ? CharacterFunctions::compareIgnoreCase (text, t) == 0
: isEmpty();
}
bool String::equalsIgnoreCase (const String& other) const throw()
{
return text == other.text
@@ -807,17 +813,16 @@ int String::lastIndexOfChar (const juce_wchar character) const throw()
return -1;
}
int String::indexOf (const juce_wchar* const t) const throw()
int String::indexOf (const String& t) const throw()
{
const juce_wchar* const r = CharacterFunctions::find (text, t);
return (r == 0) ? -1
: (int) (r - text);
const juce_wchar* const r = CharacterFunctions::find (text, t.text);
return r == 0 ? -1 : (int) (r - text);
}
int String::indexOfChar (const int startIndex,
const juce_wchar character) const throw()
{
if (startIndex >= 0 && startIndex >= length())
if (startIndex > 0 && startIndex >= length())
return -1;
const juce_wchar* t = text + jmax (0, startIndex);
@@ -834,19 +839,18 @@ int String::indexOfChar (const int startIndex,
}
}
int String::indexOfAnyOf (const juce_wchar* const charactersToLookFor,
int String::indexOfAnyOf (const String& charactersToLookFor,
const int startIndex,
const bool ignoreCase) const throw()
{
if (charactersToLookFor == 0
|| (startIndex >= 0 && startIndex >= length()))
if (startIndex > 0 && startIndex >= length())
return -1;
const juce_wchar* t = text + jmax (0, startIndex);
while (*t != 0)
{
if (CharacterFunctions::indexOfChar (charactersToLookFor, *t, ignoreCase) >= 0)
if (CharacterFunctions::indexOfChar (charactersToLookFor.text, *t, ignoreCase) >= 0)
return (int) (t - text);
++t;
@@ -855,54 +859,51 @@ int String::indexOfAnyOf (const juce_wchar* const charactersToLookFor,
return -1;
}
int String::indexOf (const int startIndex,
const juce_wchar* const other) const throw()
int String::indexOf (const int startIndex, const String& other) const throw()
{
if (other == 0 || startIndex >= length())
if (startIndex > 0 && startIndex >= length())
return -1;
const juce_wchar* const found = CharacterFunctions::find (text + jmax (0, startIndex), other);
const juce_wchar* const found = CharacterFunctions::find (text + jmax (0, startIndex), other.text);
return (found == 0) ? -1
: (int) (found - text);
return found == 0 ? -1 : (int) (found - text);
}
int String::indexOfIgnoreCase (const juce_wchar* const other) const throw()
int String::indexOfIgnoreCase (const String& other) const throw()
{
if (other != 0 && *other != 0)
if (other.isNotEmpty())
{
const int len = CharacterFunctions::length (other);
const int len = other.length();
const int end = length() - len;
for (int i = 0; i <= end; ++i)
if (CharacterFunctions::compareIgnoreCase (text + i, other, len) == 0)
if (CharacterFunctions::compareIgnoreCase (text + i, other.text, len) == 0)
return i;
}
return -1;
}
int String::indexOfIgnoreCase (const int startIndex,
const juce_wchar* const other) const throw()
int String::indexOfIgnoreCase (const int startIndex, const String& other) const throw()
{
if (other != 0 && *other != 0)
if (other.isNotEmpty())
{
const int len = CharacterFunctions::length (other);
const int len = other.length();
const int end = length() - len;
for (int i = jmax (0, startIndex); i <= end; ++i)
if (CharacterFunctions::compareIgnoreCase (text + i, other, len) == 0)
if (CharacterFunctions::compareIgnoreCase (text + i, other.text, len) == 0)
return i;
}
return -1;
}
int String::lastIndexOf (const juce_wchar* const other) const throw()
int String::lastIndexOf (const String& other) const throw()
{
if (other != 0 && *other != 0)
if (other.isNotEmpty())
{
const int len = CharacterFunctions::length (other);
const int len = other.length();
int i = length() - len;
if (i >= 0)
@@ -911,7 +912,7 @@ int String::lastIndexOf (const juce_wchar* const other) const throw()
while (i >= 0)
{
if (CharacterFunctions::compare (n--, other, len) == 0)
if (CharacterFunctions::compare (n--, other.text, len) == 0)
return i;
--i;
@@ -922,11 +923,11 @@ int String::lastIndexOf (const juce_wchar* const other) const throw()
return -1;
}
int String::lastIndexOfIgnoreCase (const juce_wchar* const other) const throw()
int String::lastIndexOfIgnoreCase (const String& other) const throw()
{
if (other != 0 && *other != 0)
if (other.isNotEmpty())
{
const int len = CharacterFunctions::length (other);
const int len = other.length();
int i = length() - len;
if (i >= 0)
@@ -935,7 +936,7 @@ int String::lastIndexOfIgnoreCase (const juce_wchar* const other) const throw()
while (i >= 0)
{
if (CharacterFunctions::compareIgnoreCase (n--, other, len) == 0)
if (CharacterFunctions::compareIgnoreCase (n--, other.text, len) == 0)
return i;
--i;
@@ -946,17 +947,16 @@ int String::lastIndexOfIgnoreCase (const juce_wchar* const other) const throw()
return -1;
}
int String::lastIndexOfAnyOf (const juce_wchar* const charactersToLookFor,
const bool ignoreCase) const throw()
int String::lastIndexOfAnyOf (const String& charactersToLookFor, const bool ignoreCase) const throw()
{
for (int i = length(); --i >= 0;)
if (CharacterFunctions::indexOfChar (charactersToLookFor, text[i], ignoreCase) >= 0)
if (CharacterFunctions::indexOfChar (charactersToLookFor.text, text[i], ignoreCase) >= 0)
return i;
return -1;
}
bool String::contains (const juce_wchar* const other) const throw()
bool String::contains (const String& other) const throw()
{
return indexOf (other) >= 0;
}
@@ -967,32 +967,32 @@ bool String::containsChar (const juce_wchar character) const throw()
for (;;)
{
if (*t == character)
return true;
if (*t == 0)
return false;
if (*t == character)
return true;
++t;
}
}
bool String::containsIgnoreCase (const juce_wchar* const t) const throw()
bool String::containsIgnoreCase (const String& t) const throw()
{
return indexOfIgnoreCase (t) >= 0;
}
int String::indexOfWholeWord (const juce_wchar* const word) const throw()
int String::indexOfWholeWord (const String& word) const throw()
{
if (word != 0 && *word != 0)
if (word.isNotEmpty())
{
const int wordLen = CharacterFunctions::length (word);
const int wordLen = word.length();
const int end = length() - wordLen;
const juce_wchar* t = text;
for (int i = 0; i <= end; ++i)
{
if (CharacterFunctions::compare (t, word, wordLen) == 0
if (CharacterFunctions::compare (t, word.text, wordLen) == 0
&& (i == 0 || ! CharacterFunctions::isLetterOrDigit (* (t - 1)))
&& ! CharacterFunctions::isLetterOrDigit (t [wordLen]))
{
@@ -1006,17 +1006,17 @@ int String::indexOfWholeWord (const juce_wchar* const word) const throw()
return -1;
}
int String::indexOfWholeWordIgnoreCase (const juce_wchar* const word) const throw()
int String::indexOfWholeWordIgnoreCase (const String& word) const throw()
{
if (word != 0 && *word != 0)
if (word.isNotEmpty())
{
const int wordLen = CharacterFunctions::length (word);
const int wordLen = word.length();
const int end = length() - wordLen;
const juce_wchar* t = text;
for (int i = 0; i <= end; ++i)
{
if (CharacterFunctions::compareIgnoreCase (t, word, wordLen) == 0
if (CharacterFunctions::compareIgnoreCase (t, word.text, wordLen) == 0
&& (i == 0 || ! CharacterFunctions::isLetterOrDigit (* (t - 1)))
&& ! CharacterFunctions::isLetterOrDigit (t [wordLen]))
{
@@ -1030,12 +1030,12 @@ int String::indexOfWholeWordIgnoreCase (const juce_wchar* const word) const thro
return -1;
}
bool String::containsWholeWord (const juce_wchar* const wordToLookFor) const throw()
bool String::containsWholeWord (const String& wordToLookFor) const throw()
{
return indexOfWholeWord (wordToLookFor) >= 0;
}
bool String::containsWholeWordIgnoreCase (const juce_wchar* const wordToLookFor) const throw()
bool String::containsWholeWordIgnoreCase (const String& wordToLookFor) const throw()
{
return indexOfWholeWordIgnoreCase (wordToLookFor) >= 0;
}
@@ -1085,13 +1085,13 @@ static int indexOfMatch (const juce_wchar* const wildcard,
return -1;
}
bool String::matchesWildcard (const juce_wchar* wildcard, const bool ignoreCase) const throw()
bool String::matchesWildcard (const String& wildcard, const bool ignoreCase) const throw()
{
int i = 0;
for (;;)
{
const juce_wchar wc = wildcard [i];
const juce_wchar wc = wildcard.text [i];
const juce_wchar c = text [i];
if (wc == c
@@ -1106,7 +1106,7 @@ bool String::matchesWildcard (const juce_wchar* wildcard, const bool ignoreCase)
else
{
return wc == '*' && (wildcard [i + 1] == 0
|| indexOfMatch (wildcard + i + 1,
|| indexOfMatch (wildcard.text + i + 1,
text + i,
ignoreCase) >= 0);
}
@@ -1114,16 +1114,16 @@ bool String::matchesWildcard (const juce_wchar* wildcard, const bool ignoreCase)
}
//==============================================================================
const String String::repeatedString (const juce_wchar* const stringToRepeat, int numberOfTimesToRepeat)
const String String::repeatedString (const String& stringToRepeat, int numberOfTimesToRepeat)
{
const int len = CharacterFunctions::length (stringToRepeat);
const int len = stringToRepeat.length();
String result ((size_t) (len * numberOfTimesToRepeat + 1), (int) 0);
juce_wchar* n = result.text;
*n = 0;
while (--numberOfTimesToRepeat >= 0)
{
StringHolder::copyChars (n, stringToRepeat, len);
StringHolder::copyChars (n, stringToRepeat.text, len);
n += len;
}
@@ -1169,8 +1169,7 @@ const String String::paddedRight (const juce_wchar padCharacter, int minimumLeng
}
//==============================================================================
const String String::replaceSection (int index, int numCharsToReplace,
const juce_wchar* const stringToInsert) const
const String String::replaceSection (int index, int numCharsToReplace, const String& stringToInsert) const
{
if (index < 0)
{
@@ -1200,7 +1199,7 @@ const String String::replaceSection (int index, int numCharsToReplace,
numCharsToReplace = len - index;
}
const int newStringLen = (stringToInsert != 0) ? CharacterFunctions::length (stringToInsert) : 0;
const int newStringLen = stringToInsert.length();
const int newTotalLen = len + newStringLen - numCharsToReplace;
if (newTotalLen <= 0)
@@ -1211,7 +1210,7 @@ const String String::replaceSection (int index, int numCharsToReplace,
StringHolder::copyChars (result.text, text, index);
if (newStringLen > 0)
StringHolder::copyChars (result.text + index, stringToInsert, newStringLen);
StringHolder::copyChars (result.text + index, stringToInsert.text, newStringLen);
const int endStringLen = newTotalLen - (index + newStringLen);
@@ -1223,12 +1222,10 @@ const String String::replaceSection (int index, int numCharsToReplace,
return result;
}
const String String::replace (const juce_wchar* const stringToReplace,
const juce_wchar* const stringToInsert,
const bool ignoreCase) const
const String String::replace (const String& stringToReplace, const String& stringToInsert, const bool ignoreCase) const
{
const int stringToReplaceLen = CharacterFunctions::length (stringToReplace);
const int stringToInsertLen = CharacterFunctions::length (stringToInsert);
const int stringToReplaceLen = stringToReplace.length();
const int stringToInsertLen = stringToInsert.length();
int i = 0;
String result (*this);
@@ -1265,11 +1262,11 @@ const String String::replaceCharacter (const juce_wchar charToReplace, const juc
}
const String String::replaceCharacters (const String& charactersToReplace,
const juce_wchar* const charactersToInsertInstead) const
const String& charactersToInsertInstead) const
{
String result (*this, size_t());
juce_wchar* t = result.text;
const int len2 = CharacterFunctions::length (charactersToInsertInstead);
const int len2 = charactersToInsertInstead.length();
// the two strings passed in are supposed to be the same length!
jassert (len2 == charactersToReplace.length());
@@ -1288,16 +1285,14 @@ const String String::replaceCharacters (const String& charactersToReplace,
}
//==============================================================================
bool String::startsWith (const juce_wchar* const other) const throw()
bool String::startsWith (const String& other) const throw()
{
return other != 0
&& CharacterFunctions::compare (text, other, CharacterFunctions::length (other)) == 0;
return CharacterFunctions::compare (text, other.text, other.length()) == 0;
}
bool String::startsWithIgnoreCase (const juce_wchar* const other) const throw()
bool String::startsWithIgnoreCase (const String& other) const throw()
{
return other != 0
&& CharacterFunctions::compareIgnoreCase (text, other, CharacterFunctions::length (other)) == 0;
return CharacterFunctions::compareIgnoreCase (text, other.text, other.length()) == 0;
}
bool String::startsWithChar (const juce_wchar character) const throw()
@@ -1315,28 +1310,22 @@ bool String::endsWithChar (const juce_wchar character) const throw()
&& text [length() - 1] == character;
}
bool String::endsWith (const juce_wchar* const other) const throw()
bool String::endsWith (const String& other) const throw()
{
if (other == 0)
return false;
const int thisLen = length();
const int otherLen = CharacterFunctions::length (other);
const int otherLen = other.length();
return thisLen >= otherLen
&& CharacterFunctions::compare (text + thisLen - otherLen, other) == 0;
&& CharacterFunctions::compare (text + thisLen - otherLen, other.text) == 0;
}
bool String::endsWithIgnoreCase (const juce_wchar* const other) const throw()
bool String::endsWithIgnoreCase (const String& other) const throw()
{
if (other == 0)
return false;
const int thisLen = length();
const int otherLen = CharacterFunctions::length (other);
const int otherLen = other.length();
return thisLen >= otherLen
&& CharacterFunctions::compareIgnoreCase (text + thisLen - otherLen, other) == 0;
&& CharacterFunctions::compareIgnoreCase (text + thisLen - otherLen, other.text) == 0;
}
//==============================================================================
@@ -1414,7 +1403,7 @@ const String String::getLastCharacters (const int numCharacters) const
return String (text + jmax (0, length() - jmax (0, numCharacters)));
}
const String String::fromFirstOccurrenceOf (const juce_wchar* const sub,
const String String::fromFirstOccurrenceOf (const String& sub,
const bool includeSubString,
const bool ignoreCase) const
{
@@ -1424,10 +1413,10 @@ const String String::fromFirstOccurrenceOf (const juce_wchar* const sub,
if (i < 0)
return empty;
else
return substring (includeSubString ? i : i + CharacterFunctions::length (sub));
return substring (includeSubString ? i : i + sub.length());
}
const String String::fromLastOccurrenceOf (const juce_wchar* const sub,
const String String::fromLastOccurrenceOf (const String& sub,
const bool includeSubString,
const bool ignoreCase) const
{
@@ -1436,11 +1425,11 @@ const String String::fromLastOccurrenceOf (const juce_wchar* const sub,
if (i < 0)
return *this;
else
return substring (includeSubString ? i : i + CharacterFunctions::length (sub));
return substring (includeSubString ? i : i + sub.length());
}
const String String::upToFirstOccurrenceOf (const juce_wchar* const sub,
const String String::upToFirstOccurrenceOf (const String& sub,
const bool includeSubString,
const bool ignoreCase) const
{
@@ -1449,11 +1438,11 @@ const String String::upToFirstOccurrenceOf (const juce_wchar* const sub,
if (i < 0)
return *this;
else
return substring (0, includeSubString ? i + CharacterFunctions::length (sub) : i);
return substring (0, includeSubString ? i + sub.length() : i);
}
const String String::upToLastOccurrenceOf (const juce_wchar* const sub,
const String String::upToLastOccurrenceOf (const String& sub,
const bool includeSubString,
const bool ignoreCase) const
{
@@ -1462,7 +1451,7 @@ const String String::upToLastOccurrenceOf (const juce_wchar* const sub,
if (i < 0)
return *this;
return substring (0, includeSubString ? i + CharacterFunctions::length (sub) : i);
return substring (0, includeSubString ? i + sub.length() : i);
}
bool String::isQuotedString() const
@@ -1561,16 +1550,14 @@ const String String::trimEnd() const
return String (text, (int) (++endT - text));
}
const String String::trimCharactersAtStart (const juce_wchar* charactersToTrim) const
const String String::trimCharactersAtStart (const String& charactersToTrim) const
{
jassert (charactersToTrim != 0);
if (isEmpty())
return empty;
const juce_wchar* t = text;
while (CharacterFunctions::indexOfCharFast (charactersToTrim, *t) >= 0)
while (charactersToTrim.containsChar (*t))
++t;
if (t == text)
@@ -1579,26 +1566,22 @@ const String String::trimCharactersAtStart (const juce_wchar* charactersToTrim)
return String (t);
}
const String String::trimCharactersAtEnd (const juce_wchar* charactersToTrim) const
const String String::trimCharactersAtEnd (const String& charactersToTrim) const
{
jassert (charactersToTrim != 0);
if (isEmpty())
return empty;
const juce_wchar* endT = text + (length() - 1);
while ((endT >= text) && CharacterFunctions::indexOfCharFast (charactersToTrim, *endT) >= 0)
while (endT >= text && charactersToTrim.containsChar (*endT))
--endT;
return String (text, (int) (++endT - text));
}
//==============================================================================
const String String::retainCharacters (const juce_wchar* const charactersToRetain) const
const String String::retainCharacters (const String& charactersToRetain) const
{
jassert (charactersToRetain != 0);
if (isEmpty())
return empty;
@@ -1608,7 +1591,7 @@ const String String::retainCharacters (const juce_wchar* const charactersToRetai
while (*src != 0)
{
if (CharacterFunctions::indexOfCharFast (charactersToRetain, *src) >= 0)
if (charactersToRetain.containsChar (*src))
*dst++ = *src;
++src;
@@ -1618,10 +1601,8 @@ const String String::retainCharacters (const juce_wchar* const charactersToRetai
return result;
}
const String String::removeCharacters (const juce_wchar* const charactersToRemove) const
const String String::removeCharacters (const String& charactersToRemove) const
{
jassert (charactersToRemove != 0);
if (isEmpty())
return empty;
@@ -1631,7 +1612,7 @@ const String String::removeCharacters (const juce_wchar* const charactersToRemov
while (*src != 0)
{
if (CharacterFunctions::indexOfCharFast (charactersToRemove, *src) < 0)
if (! charactersToRemove.containsChar (*src))
*dst++ = *src;
++src;
@@ -1641,21 +1622,19 @@ const String String::removeCharacters (const juce_wchar* const charactersToRemov
return result;
}
const String String::initialSectionContainingOnly (const juce_wchar* const permittedCharacters) const
const String String::initialSectionContainingOnly (const String& permittedCharacters) const
{
return substring (0, CharacterFunctions::getIntialSectionContainingOnly (text, permittedCharacters));
return substring (0, CharacterFunctions::getIntialSectionContainingOnly (text, permittedCharacters.text));
}
const String String::initialSectionNotContaining (const juce_wchar* const charactersToStopAt) const
const String String::initialSectionNotContaining (const String& charactersToStopAt) const
{
jassert (charactersToStopAt != 0);
const juce_wchar* const t = text;
int i = 0;
while (t[i] != 0)
{
if (CharacterFunctions::indexOfCharFast (charactersToStopAt, t[i]) >= 0)
if (charactersToStopAt.containsChar (t[i]))
return String (text, i);
++i;
@@ -1664,27 +1643,23 @@ const String String::initialSectionNotContaining (const juce_wchar* const charac
return empty;
}
bool String::containsOnly (const juce_wchar* const chars) const throw()
bool String::containsOnly (const String& chars) const throw()
{
jassert (chars != 0);
const juce_wchar* t = text;
while (*t != 0)
if (CharacterFunctions::indexOfCharFast (chars, *t++) < 0)
if (! chars.containsChar (*t++))
return false;
return true;
}
bool String::containsAnyOf (const juce_wchar* const chars) const throw()
bool String::containsAnyOf (const String& chars) const throw()
{
jassert (chars != 0);
const juce_wchar* t = text;
while (*t != 0)
if (CharacterFunctions::indexOfCharFast (chars, *t++) >= 0)
if (chars.containsChar (*t++))
return true;
return false;


+ 40
- 37
src/text/juce_String.h View File

@@ -150,6 +150,9 @@ public:
/** Case-insensitive comparison with another string. */
bool equalsIgnoreCase (const juce_wchar* other) const throw();
/** Case-insensitive comparison with another string. */
bool equalsIgnoreCase (const char* other) const throw();
/** Case-sensitive comparison with another string.
@returns 0 if the two strings are identical; negative if this string
comes before the other one alphabetically, or positive if it
@@ -192,7 +195,7 @@ public:
/** Tests whether the string begins with another string.
Uses a case-sensitive comparison.
*/
bool startsWith (const juce_wchar* text) const throw();
bool startsWith (const String& text) const throw();
/** Tests whether the string begins with a particular character.
Uses a case-sensitive comparison.
@@ -202,12 +205,12 @@ public:
/** Tests whether the string begins with another string.
Uses a case-insensitive comparison.
*/
bool startsWithIgnoreCase (const juce_wchar* text) const throw();
bool startsWithIgnoreCase (const String& text) const throw();
/** Tests whether the string ends with another string.
Uses a case-sensitive comparison.
*/
bool endsWith (const juce_wchar* text) const throw();
bool endsWith (const String& text) const throw();
/** Tests whether the string ends with a particular character.
Uses a case-sensitive comparison.
@@ -217,12 +220,12 @@ public:
/** Tests whether the string ends with another string.
Uses a case-insensitive comparison.
*/
bool endsWithIgnoreCase (const juce_wchar* text) const throw();
bool endsWithIgnoreCase (const String& text) const throw();
/** Tests whether the string contains another substring.
Uses a case-sensitive comparison.
*/
bool contains (const juce_wchar* text) const throw();
bool contains (const String& text) const throw();
/** Tests whether the string contains a particular character.
Uses a case-sensitive comparison.
@@ -232,7 +235,7 @@ public:
/** Tests whether the string contains another substring.
Uses a case-insensitive comparison.
*/
bool containsIgnoreCase (const juce_wchar* text) const throw();
bool containsIgnoreCase (const String& text) const throw();
/** Tests whether the string contains another substring as a distict word.
@@ -240,7 +243,7 @@ public:
non-alphanumeric characters
@see indexOfWholeWord, containsWholeWordIgnoreCase
*/
bool containsWholeWord (const juce_wchar* wordToLookFor) const throw();
bool containsWholeWord (const String& wordToLookFor) const throw();
/** Tests whether the string contains another substring as a distict word.
@@ -248,7 +251,7 @@ public:
non-alphanumeric characters
@see indexOfWholeWordIgnoreCase, containsWholeWord
*/
bool containsWholeWordIgnoreCase (const juce_wchar* wordToLookFor) const throw();
bool containsWholeWordIgnoreCase (const String& wordToLookFor) const throw();
/** Finds an instance of another substring if it exists as a distict word.
@@ -257,7 +260,7 @@ public:
found, then it will return -1
@see indexOfWholeWordIgnoreCase, containsWholeWord
*/
int indexOfWholeWord (const juce_wchar* wordToLookFor) const throw();
int indexOfWholeWord (const String& wordToLookFor) const throw();
/** Finds an instance of another substring if it exists as a distict word.
@@ -266,7 +269,7 @@ public:
found, then it will return -1
@see indexOfWholeWord, containsWholeWordIgnoreCase
*/
int indexOfWholeWordIgnoreCase (const juce_wchar* wordToLookFor) const throw();
int indexOfWholeWordIgnoreCase (const String& wordToLookFor) const throw();
/** Looks for any of a set of characters in the string.
@@ -275,7 +278,7 @@ public:
@returns true if the string contains any of the characters from
the string that is passed in.
*/
bool containsAnyOf (const juce_wchar* charactersItMightContain) const throw();
bool containsAnyOf (const String& charactersItMightContain) const throw();
/** Looks for a set of characters in the string.
@@ -284,7 +287,7 @@ public:
@returns true if the all the characters in the string are also found in the
string that is passed in.
*/
bool containsOnly (const juce_wchar* charactersItMightContain) const throw();
bool containsOnly (const String& charactersItMightContain) const throw();
/** Returns true if this string contains any non-whitespace characters.
@@ -302,7 +305,7 @@ public:
This isn't a full-blown regex though! The only wildcard characters supported
are "*" and "?". It's mainly intended for filename pattern matching.
*/
bool matchesWildcard (const juce_wchar* wildcard, bool ignoreCase) const throw();
bool matchesWildcard (const String& wildcard, bool ignoreCase) const throw();
//==============================================================================
// Substring location methods..
@@ -339,7 +342,7 @@ public:
@see indexOfChar, lastIndexOfAnyOf
*/
int indexOfAnyOf (const juce_wchar* charactersToLookFor,
int indexOfAnyOf (const String& charactersToLookFor,
int startIndex = 0,
bool ignoreCase = false) const throw();
@@ -349,7 +352,7 @@ public:
@returns the index of the first occurrence of this substring, or -1 if it's not found.
*/
int indexOf (const juce_wchar* text) const throw();
int indexOf (const String& text) const throw();
/** Searches for a substring within this string.
@@ -360,7 +363,7 @@ public:
@returns the index of the first occurrence of this substring, or -1 if it's not found.
*/
int indexOf (int startIndex,
const juce_wchar* textToLookFor) const throw();
const String& textToLookFor) const throw();
/** Searches for a substring within this string.
@@ -368,7 +371,7 @@ public:
@returns the index of the first occurrence of this substring, or -1 if it's not found.
*/
int indexOfIgnoreCase (const juce_wchar* textToLookFor) const throw();
int indexOfIgnoreCase (const String& textToLookFor) const throw();
/** Searches for a substring within this string.
@@ -379,7 +382,7 @@ public:
@returns the index of the first occurrence of this substring, or -1 if it's not found.
*/
int indexOfIgnoreCase (int startIndex,
const juce_wchar* textToLookFor) const throw();
const String& textToLookFor) const throw();
/** Searches for a character inside this string (working backwards from the end of the string).
@@ -397,7 +400,7 @@ public:
@returns the index of the start of the last occurrence of the
substring within this string, or -1 if it's not found.
*/
int lastIndexOf (const juce_wchar* textToLookFor) const throw();
int lastIndexOf (const String& textToLookFor) const throw();
/** Searches for a substring inside this string (working backwards from the end of the string).
@@ -406,7 +409,7 @@ public:
@returns the index of the start of the last occurrence of the
substring within this string, or -1 if it's not found.
*/
int lastIndexOfIgnoreCase (const juce_wchar* textToLookFor) const throw();
int lastIndexOfIgnoreCase (const String& textToLookFor) const throw();
/** Returns the index of the last character in this string that matches one of the
characters passed-in to this method.
@@ -420,7 +423,7 @@ public:
@see lastIndexOf, indexOfAnyOf
*/
int lastIndexOfAnyOf (const juce_wchar* charactersToLookFor,
int lastIndexOfAnyOf (const String& charactersToLookFor,
bool ignoreCase = false) const throw();
@@ -507,7 +510,7 @@ public:
@see upToFirstOccurrenceOf, fromLastOccurrenceOf
*/
const String fromFirstOccurrenceOf (const juce_wchar* substringToStartFrom,
const String fromFirstOccurrenceOf (const String& substringToStartFrom,
bool includeSubStringInResult,
bool ignoreCase) const;
@@ -519,7 +522,7 @@ public:
@see fromFirstOccurrenceOf, upToLastOccurrenceOf
*/
const String fromLastOccurrenceOf (const juce_wchar* substringToFind,
const String fromLastOccurrenceOf (const String& substringToFind,
bool includeSubStringInResult,
bool ignoreCase) const;
@@ -536,7 +539,7 @@ public:
@see upToLastOccurrenceOf, fromFirstOccurrenceOf
*/
const String upToFirstOccurrenceOf (const juce_wchar* substringToEndWith,
const String upToFirstOccurrenceOf (const String& substringToEndWith,
bool includeSubStringInResult,
bool ignoreCase) const;
@@ -547,7 +550,7 @@ public:
@see upToFirstOccurrenceOf, fromFirstOccurrenceOf
*/
const String upToLastOccurrenceOf (const juce_wchar* substringToFind,
const String upToLastOccurrenceOf (const String& substringToFind,
bool includeSubStringInResult,
bool ignoreCase) const;
@@ -565,7 +568,7 @@ public:
@param charactersToTrim the set of characters to remove. This must not be null.
@see trim, trimStart, trimCharactersAtEnd
*/
const String trimCharactersAtStart (const juce_wchar* charactersToTrim) const;
const String trimCharactersAtStart (const String& charactersToTrim) const;
/** Returns a copy of this string, having removed a specified set of characters from its end.
Characters are removed from the end of the string until it finds one that is not in the
@@ -573,7 +576,7 @@ public:
@param charactersToTrim the set of characters to remove. This must not be null.
@see trim, trimEnd, trimCharactersAtStart
*/
const String trimCharactersAtEnd (const juce_wchar* charactersToTrim) const;
const String trimCharactersAtEnd (const String& charactersToTrim) const;
//==============================================================================
/** Returns an upper-case version of this string. */
@@ -600,7 +603,7 @@ public:
*/
const String replaceSection (int startIndex,
int numCharactersToReplace,
const juce_wchar* stringToInsert) const;
const String& stringToInsert) const;
/** Replaces all occurrences of a substring with another string.
@@ -609,8 +612,8 @@ public:
Note that this is a const method, and won't alter the string itself.
*/
const String replace (const juce_wchar* stringToReplace,
const juce_wchar* stringToInsertInstead,
const String replace (const String& stringToReplace,
const String& stringToInsertInstead,
bool ignoreCase = false) const;
/** Returns a string with all occurrences of a character replaced with a different one. */
@@ -623,12 +626,12 @@ public:
by the character at the equivalent position in newCharacters (so the two strings
passed in must be the same length).
e.g. translate ("abc", "def") replaces 'a' with 'd', 'b' with 'e', etc.
e.g. replaceCharacters ("abc", "def") replaces 'a' with 'd', 'b' with 'e', etc.
Note that this is a const method, and won't affect the string itself.
*/
const String replaceCharacters (const String& charactersToReplace,
const juce_wchar* charactersToInsertInstead) const;
const String& charactersToInsertInstead) const;
/** Returns a version of this string that only retains a fixed set of characters.
@@ -639,7 +642,7 @@ public:
Note that this is a const method, and won't alter the string itself.
*/
const String retainCharacters (const juce_wchar* charactersToRetain) const;
const String retainCharacters (const String& charactersToRetain) const;
/** Returns a version of this string with a set of characters removed.
@@ -650,21 +653,21 @@ public:
Note that this is a const method, and won't alter the string itself.
*/
const String removeCharacters (const juce_wchar* charactersToRemove) const;
const String removeCharacters (const String& charactersToRemove) const;
/** Returns a section from the start of the string that only contains a certain set of characters.
This returns the leftmost section of the string, up to (and not including) the
first character that doesn't appear in the string passed in.
*/
const String initialSectionContainingOnly (const juce_wchar* permittedCharacters) const;
const String initialSectionContainingOnly (const String& permittedCharacters) const;
/** Returns a section from the start of the string that only contains a certain set of characters.
This returns the leftmost section of the string, up to (and not including) the
first character that occurs in the string passed in.
*/
const String initialSectionNotContaining (const juce_wchar* charactersToStopAt) const;
const String initialSectionNotContaining (const String& charactersToStopAt) const;
//==============================================================================
/** Checks whether the string might be in quotation marks.
@@ -707,7 +710,7 @@ public:
@param stringToRepeat the string to repeat
@param numberOfTimesToRepeat how many times to repeat it
*/
static const String repeatedString (const juce_wchar* stringToRepeat,
static const String repeatedString (const String& stringToRepeat,
int numberOfTimesToRepeat);
/** Returns a copy of this string with the specified character repeatedly added to its


+ 1
- 1
src/text/juce_StringArray.cpp View File

@@ -334,7 +334,7 @@ const String StringArray::joinIntoString (const String& separator, int start, in
int StringArray::addTokens (const String& text, const bool preserveQuotedStrings)
{
return addTokens (text, T(" \n\r\t"), preserveQuotedStrings ? T("\"") : T(""));
return addTokens (text, " \n\r\t", preserveQuotedStrings ? "\"" : "");
}
int StringArray::addTokens (const String& text, const String& breakCharacters, const String& quoteCharacters)


+ 10
- 10
src/text/juce_XmlDocument.cpp View File

@@ -722,19 +722,19 @@ void XmlDocument::readEntity (String& result)
const String XmlDocument::expandEntity (const String& ent)
{
if (ent.equalsIgnoreCase (T("amp")))
if (ent.equalsIgnoreCase ("amp"))
return String::charToString ('&');
if (ent.equalsIgnoreCase (T("quot")))
if (ent.equalsIgnoreCase ("quot"))
return String::charToString ('"');
if (ent.equalsIgnoreCase (T("apos")))
if (ent.equalsIgnoreCase ("apos"))
return String::charToString ('\'');
if (ent.equalsIgnoreCase (T("lt")))
if (ent.equalsIgnoreCase ("lt"))
return String::charToString ('<');
if (ent.equalsIgnoreCase (T("gt")))
if (ent.equalsIgnoreCase ("gt"))
return String::charToString ('>');
if (ent[0] == '#')
@@ -763,7 +763,7 @@ const String XmlDocument::expandExternalEntity (const String& entity)
tokenisedDTD.addTokens (dtdText, true);
if (tokenisedDTD [tokenisedDTD.size() - 2].equalsIgnoreCase (T("system"))
if (tokenisedDTD [tokenisedDTD.size() - 2].equalsIgnoreCase ("system")
&& tokenisedDTD [tokenisedDTD.size() - 1].isQuotedString())
{
const String fn (tokenisedDTD [tokenisedDTD.size() - 1]);
@@ -810,7 +810,7 @@ const String XmlDocument::expandExternalEntity (const String& entity)
{
if (tokenisedDTD[i] == entity)
{
if (tokenisedDTD[i - 1].equalsIgnoreCase (T("<!entity")))
if (tokenisedDTD[i - 1].equalsIgnoreCase ("<!entity"))
{
String ent (tokenisedDTD [i + 1]);
@@ -824,7 +824,7 @@ const String XmlDocument::expandExternalEntity (const String& entity)
while (ampersand >= 0)
{
const int semiColon = ent.indexOf (i + 1, T(";"));
const int semiColon = ent.indexOf (i + 1, ";");
if (semiColon < 0)
{
@@ -858,14 +858,14 @@ const String XmlDocument::getParameterEntity (const String& entity)
if (tokenisedDTD[i] == entity)
{
if (tokenisedDTD [i - 1] == "%"
&& tokenisedDTD [i - 2].equalsIgnoreCase (T("<!entity")))
&& tokenisedDTD [i - 2].equalsIgnoreCase ("<!entity"))
{
String ent (tokenisedDTD [i + 1]);
while (ent.endsWithChar ('>'))
ent = ent.dropLastCharacters (1);
if (ent.equalsIgnoreCase (T("system")))
if (ent.equalsIgnoreCase ("system"))
{
String filename (tokenisedDTD [i + 2]);


+ 1
- 1
src/text/juce_XmlElement.cpp View File

@@ -61,7 +61,7 @@ XmlElement::XmlElement (const String& tagName_) throw()
jassert (tagName_.containsNonWhitespaceChars())
// The tag can't contain spaces or other characters that would create invalid XML!
jassert (! tagName_.containsAnyOf (T(" <>/&")));
jassert (! tagName_.containsAnyOf (" <>/&"));
}
XmlElement::XmlElement (int /*dummy*/) throw()


Loading…
Cancel
Save