@@ -231,7 +231,7 @@ public: | |||||
if (getColour() != newColour) | if (getColour() != newColour) | ||||
{ | { | ||||
if (newColour == defaultColour && defaultButton.isVisible()) | if (newColour == defaultColour && defaultButton.isVisible()) | ||||
colourValue = var::null; | |||||
colourValue = var(); | |||||
else | else | ||||
colourValue = newColour.toDisplayString (true); | colourValue = newColour.toDisplayString (true); | ||||
} | } | ||||
@@ -120,7 +120,7 @@ bool PluginDirectoryScanner::skipNextFile() | |||||
void PluginDirectoryScanner::setDeadMansPedalFile (const StringArray& newContents) | void PluginDirectoryScanner::setDeadMansPedalFile (const StringArray& newContents) | ||||
{ | { | ||||
if (deadMansPedalFile != File::nonexistent) | |||||
if (deadMansPedalFile.getFullPathName().isNotEmpty()) | |||||
deadMansPedalFile.replaceWithText (newContents.joinIntoString ("\n"), true, true); | deadMansPedalFile.replaceWithText (newContents.joinIntoString ("\n"), true, true); | ||||
} | } | ||||
@@ -252,7 +252,7 @@ public: | |||||
} | } | ||||
} | } | ||||
return var::null; | |||||
return var(); | |||||
} | } | ||||
bool hasProperty (const Identifier& propertyName) const override | bool hasProperty (const Identifier& propertyName) const override | ||||
@@ -297,7 +297,7 @@ public: | |||||
void removeProperty (const Identifier& propertyName) override | void removeProperty (const Identifier& propertyName) override | ||||
{ | { | ||||
setProperty (propertyName, var::null); | |||||
setProperty (propertyName, var()); | |||||
} | } | ||||
bool hasMethod (const Identifier& methodName) const override | bool hasMethod (const Identifier& methodName) const override | ||||
@@ -401,7 +401,7 @@ var variantTojuceVar (const VARIANT& v) | |||||
switch (v.vt & ~VT_BYREF) | switch (v.vt & ~VT_BYREF) | ||||
{ | { | ||||
case VT_VOID: | case VT_VOID: | ||||
case VT_EMPTY: return var::null; | |||||
case VT_EMPTY: return var(); | |||||
case VT_I1: return var ((int) v.cVal); | case VT_I1: return var ((int) v.cVal); | ||||
case VT_I2: return var ((int) v.iVal); | case VT_I2: return var ((int) v.iVal); | ||||
case VT_I4: return var ((int) v.lVal); | case VT_I4: return var ((int) v.lVal); | ||||
@@ -421,7 +421,7 @@ var variantTojuceVar (const VARIANT& v) | |||||
} | } | ||||
} | } | ||||
return var::null; | |||||
return var(); | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
@@ -896,7 +896,7 @@ static var createValueFromNPVariant (NPP npp, const NPVariant& v) | |||||
else if (NPVARIANT_IS_OBJECT (v) && npp != nullptr) | else if (NPVARIANT_IS_OBJECT (v) && npp != nullptr) | ||||
return var (new DynamicObjectWrappingNPObject (npp, NPVARIANT_TO_OBJECT (v))); | return var (new DynamicObjectWrappingNPObject (npp, NPVARIANT_TO_OBJECT (v))); | ||||
return var::null; | |||||
return var(); | |||||
} | } | ||||
static void createNPVariantFromValue (NPP npp, NPVariant& out, const var& v) | static void createNPVariantFromValue (NPP npp, NPVariant& out, const var& v) | ||||
@@ -155,7 +155,7 @@ void PropertySet::removeValue (StringRef keyName) | |||||
void PropertySet::setValue (const String& keyName, const XmlElement* const xml) | void PropertySet::setValue (const String& keyName, const XmlElement* const xml) | ||||
{ | { | ||||
setValue (keyName, xml == nullptr ? var::null | |||||
setValue (keyName, xml == nullptr ? var() | |||||
: var (xml->createDocument ("", true))); | : var (xml->createDocument ("", true))); | ||||
} | } | ||||
@@ -322,7 +322,7 @@ String File::getFileNameWithoutExtension() const | |||||
bool File::isAChildOf (const File& potentialParent) const | bool File::isAChildOf (const File& potentialParent) const | ||||
{ | { | ||||
if (potentialParent == File::nonexistent) | |||||
if (potentialParent.fullPath.isEmpty()) | |||||
return false; | return false; | ||||
const String ourPath (getPathUpToLastSlash()); | const String ourPath (getPathUpToLastSlash()); | ||||
@@ -629,7 +629,7 @@ bool File::hasFileExtension (StringRef possibleSuffix) const | |||||
File File::withFileExtension (StringRef newExtension) const | File File::withFileExtension (StringRef newExtension) const | ||||
{ | { | ||||
if (fullPath.isEmpty()) | if (fullPath.isEmpty()) | ||||
return File::nonexistent; | |||||
return File(); | |||||
String filePart (getFileName()); | String filePart (getFileName()); | ||||
@@ -50,7 +50,7 @@ TemporaryFile::TemporaryFile (const File& target, const int optionFlags) | |||||
targetFile (target) | targetFile (target) | ||||
{ | { | ||||
// If you use this constructor, you need to give it a valid target file! | // If you use this constructor, you need to give it a valid target file! | ||||
jassert (targetFile != File::nonexistent); | |||||
jassert (targetFile != File()); | |||||
} | } | ||||
TemporaryFile::TemporaryFile (const File& target, const File& temporary) | TemporaryFile::TemporaryFile (const File& target, const File& temporary) | ||||
@@ -79,7 +79,7 @@ bool TemporaryFile::overwriteTargetFileWithTemporary() const | |||||
{ | { | ||||
// This method only works if you created this object with the constructor | // This method only works if you created this object with the constructor | ||||
// that takes a target file! | // that takes a target file! | ||||
jassert (targetFile != File::nonexistent); | |||||
jassert (targetFile != File()); | |||||
if (temporaryFile.exists()) | if (temporaryFile.exists()) | ||||
{ | { | ||||
@@ -35,7 +35,7 @@ public: | |||||
switch (t.getAndAdvance()) | switch (t.getAndAdvance()) | ||||
{ | { | ||||
case 0: result = var::null; return Result::ok(); | |||||
case 0: result = var(); return Result::ok(); | |||||
case '{': return parseObject (t, result); | case '{': return parseObject (t, result); | ||||
case '[': return parseArray (t, result); | case '[': return parseArray (t, result); | ||||
} | } | ||||
@@ -148,7 +148,7 @@ private: | |||||
if (t2.getAndAdvance() == 'u' && t2.getAndAdvance() == 'l' && t2.getAndAdvance() == 'l') | if (t2.getAndAdvance() == 'u' && t2.getAndAdvance() == 'l' && t2.getAndAdvance() == 'l') | ||||
{ | { | ||||
t = t2; | t = t2; | ||||
result = var::null; | |||||
result = var(); | |||||
return Result::ok(); | return Result::ok(); | ||||
} | } | ||||
break; | break; | ||||
@@ -254,7 +254,7 @@ private: | |||||
if (c2 != ':') | if (c2 != ':') | ||||
return createFail ("Expected ':', but found", &oldT); | return createFail ("Expected ':', but found", &oldT); | ||||
resultProperties.set (propertyName, var::null); | |||||
resultProperties.set (propertyName, var()); | |||||
var* propertyValue = resultProperties.getVarPointer (propertyName); | var* propertyValue = resultProperties.getVarPointer (propertyName); | ||||
Result r2 (parseAny (t, *propertyValue)); | Result r2 (parseAny (t, *propertyValue)); | ||||
@@ -300,7 +300,7 @@ private: | |||||
return createFail ("Unexpected end-of-input in array declaration"); | return createFail ("Unexpected end-of-input in array declaration"); | ||||
t = oldT; | t = oldT; | ||||
destArray->add (var::null); | |||||
destArray->add (var()); | |||||
Result r (parseAny (t, destArray->getReference (destArray->size() - 1))); | Result r (parseAny (t, destArray->getReference (destArray->size() - 1))); | ||||
if (r.failed()) | if (r.failed()) | ||||
@@ -514,7 +514,7 @@ var JSON::parse (const String& text) | |||||
var result; | var result; | ||||
if (! JSONParser::parseObjectOrArray (text.getCharPointer(), result)) | if (! JSONParser::parseObjectOrArray (text.getCharPointer(), result)) | ||||
result = var::null; | |||||
result = var(); | |||||
return result; | return result; | ||||
} | } | ||||
@@ -610,7 +610,7 @@ public: | |||||
{ | { | ||||
switch (r.nextInt (depth > 3 ? 6 : 8)) | switch (r.nextInt (depth > 3 ? 6 : 8)) | ||||
{ | { | ||||
case 0: return var::null; | |||||
case 0: return var(); | |||||
case 1: return r.nextInt(); | case 1: return r.nextInt(); | ||||
case 2: return r.nextInt64(); | case 2: return r.nextInt64(); | ||||
case 3: return r.nextBool(); | case 3: return r.nextBool(); | ||||
@@ -638,7 +638,7 @@ public: | |||||
} | } | ||||
default: | default: | ||||
return var::null; | |||||
return var(); | |||||
} | } | ||||
} | } | ||||
@@ -1244,7 +1244,7 @@ struct JavascriptEngine::RootObject : public DynamicObject | |||||
if (matchIf (TokenTypes::openParen)) return parseSuffixes (matchCloseParen (parseExpression())); | if (matchIf (TokenTypes::openParen)) return parseSuffixes (matchCloseParen (parseExpression())); | ||||
if (matchIf (TokenTypes::true_)) return parseSuffixes (new LiteralValue (location, (int) 1)); | if (matchIf (TokenTypes::true_)) return parseSuffixes (new LiteralValue (location, (int) 1)); | ||||
if (matchIf (TokenTypes::false_)) return parseSuffixes (new LiteralValue (location, (int) 0)); | if (matchIf (TokenTypes::false_)) return parseSuffixes (new LiteralValue (location, (int) 0)); | ||||
if (matchIf (TokenTypes::null_)) return parseSuffixes (new LiteralValue (location, var::null)); | |||||
if (matchIf (TokenTypes::null_)) return parseSuffixes (new LiteralValue (location, var())); | |||||
if (matchIf (TokenTypes::undefined)) return parseSuffixes (new Expression (location)); | if (matchIf (TokenTypes::undefined)) return parseSuffixes (new Expression (location)); | ||||
if (currentType == TokenTypes::literal) | if (currentType == TokenTypes::literal) | ||||
@@ -80,7 +80,7 @@ File File::getSpecialLocation (const SpecialLocationType type) | |||||
break; | break; | ||||
} | } | ||||
return File::nonexistent; | |||||
return File(); | |||||
} | } | ||||
bool File::moveToTrash() const | bool File::moveToTrash() const | ||||
@@ -115,7 +115,7 @@ File File::getSpecialLocation (const SpecialLocationType type) | |||||
if (struct passwd* const pw = getpwuid (getuid())) | if (struct passwd* const pw = getpwuid (getuid())) | ||||
return File (CharPointer_UTF8 (pw->pw_dir)); | return File (CharPointer_UTF8 (pw->pw_dir)); | ||||
return File::nonexistent; | |||||
return File(); | |||||
} | } | ||||
case userDocumentsDirectory: return resolveXDGFolder ("XDG_DOCUMENTS_DIR", "~"); | case userDocumentsDirectory: return resolveXDGFolder ("XDG_DOCUMENTS_DIR", "~"); | ||||
@@ -163,7 +163,7 @@ File File::getSpecialLocation (const SpecialLocationType type) | |||||
break; | break; | ||||
} | } | ||||
return File::nonexistent; | |||||
return File(); | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
@@ -257,7 +257,7 @@ File File::getSpecialLocation (const SpecialLocationType type) | |||||
return File (resultPath.convertToPrecomposedUnicode()); | return File (resultPath.convertToPrecomposedUnicode()); | ||||
} | } | ||||
return File::nonexistent; | |||||
return File(); | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
@@ -93,7 +93,7 @@ namespace WindowsFileHelpers | |||||
if (SHGetSpecialFolderPath (0, path, type, FALSE)) | if (SHGetSpecialFolderPath (0, path, type, FALSE)) | ||||
return File (String (path)); | return File (String (path)); | ||||
return File::nonexistent; | |||||
return File(); | |||||
} | } | ||||
File getModuleFileName (HINSTANCE moduleHandle) | File getModuleFileName (HINSTANCE moduleHandle) | ||||
@@ -542,7 +542,7 @@ File JUCE_CALLTYPE File::getSpecialLocation (const SpecialLocationType type) | |||||
default: | default: | ||||
jassertfalse; // unknown type? | jassertfalse; // unknown type? | ||||
return File::nonexistent; | |||||
return File(); | |||||
} | } | ||||
return WindowsFileHelpers::getSpecialFolderPath (csidlType); | return WindowsFileHelpers::getSpecialFolderPath (csidlType); | ||||
@@ -28,7 +28,7 @@ | |||||
static void appendToFile (const File& f, const String& s) | static void appendToFile (const File& f, const String& s) | ||||
{ | { | ||||
if (f != File::nonexistent) | |||||
if (f.getFullPathName().isNotEmpty()) | |||||
{ | { | ||||
FileOutputStream out (f); | FileOutputStream out (f); | ||||
@@ -65,7 +65,7 @@ public: | |||||
*/ | */ | ||||
PerformanceCounter (const String& counterName, | PerformanceCounter (const String& counterName, | ||||
int runsPerPrintout = 100, | int runsPerPrintout = 100, | ||||
const File& loggingFile = File::nonexistent); | |||||
const File& loggingFile = File()); | |||||
/** Destructor. */ | /** Destructor. */ | ||||
~PerformanceCounter(); | ~PerformanceCounter(); | ||||
@@ -90,8 +90,8 @@ File PropertiesFile::Options::getDefaultFile() const | |||||
File dir (File::getSpecialLocation (commonToAllUsers ? File::commonApplicationDataDirectory | File dir (File::getSpecialLocation (commonToAllUsers ? File::commonApplicationDataDirectory | ||||
: File::userApplicationDataDirectory)); | : File::userApplicationDataDirectory)); | ||||
if (dir == File::nonexistent) | |||||
return File::nonexistent; | |||||
if (dir == File()) | |||||
return File(); | |||||
dir = dir.getChildFile (folderName.isNotEmpty() ? folderName | dir = dir.getChildFile (folderName.isNotEmpty() ? folderName | ||||
: applicationName); | : applicationName); | ||||
@@ -165,7 +165,7 @@ bool PropertiesFile::save() | |||||
stopTimer(); | stopTimer(); | ||||
if (options.doNotSave | if (options.doNotSave | ||||
|| file == File::nonexistent | |||||
|| file == File() | |||||
|| file.isDirectory() | || file.isDirectory() | ||||
|| ! file.getParentDirectory().createDirectory()) | || ! file.getParentDirectory().createDirectory()) | ||||
return false; | return false; | ||||
@@ -168,7 +168,7 @@ public: | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
undoManager->perform (new SetPropertyAction (this, name, newValue, var::null, true, false)); | |||||
undoManager->perform (new SetPropertyAction (this, name, newValue, var(), true, false)); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -188,7 +188,7 @@ public: | |||||
else | else | ||||
{ | { | ||||
if (properties.contains (name)) | if (properties.contains (name)) | ||||
undoManager->perform (new SetPropertyAction (this, name, var::null, properties [name], false, true)); | |||||
undoManager->perform (new SetPropertyAction (this, name, var(), properties [name], false, true)); | |||||
} | } | ||||
} | } | ||||
@@ -206,7 +206,7 @@ public: | |||||
else | else | ||||
{ | { | ||||
for (int i = properties.size(); --i >= 0;) | for (int i = properties.size(); --i >= 0;) | ||||
undoManager->perform (new SetPropertyAction (this, properties.getName(i), var::null, | |||||
undoManager->perform (new SetPropertyAction (this, properties.getName(i), var(), | |||||
properties.getValueAt(i), false, true)); | properties.getValueAt(i), false, true)); | ||||
} | } | ||||
} | } | ||||
@@ -230,7 +230,7 @@ public: | |||||
return ValueTree (s); | return ValueTree (s); | ||||
} | } | ||||
return ValueTree::invalid; | |||||
return ValueTree(); | |||||
} | } | ||||
ValueTree getOrCreateChildWithName (const Identifier typeToMatch, UndoManager* undoManager) | ValueTree getOrCreateChildWithName (const Identifier typeToMatch, UndoManager* undoManager) | ||||
@@ -257,7 +257,7 @@ public: | |||||
return ValueTree (s); | return ValueTree (s); | ||||
} | } | ||||
return ValueTree::invalid; | |||||
return ValueTree(); | |||||
} | } | ||||
bool isAChildOf (const SharedObject* const possibleParent) const noexcept | bool isAChildOf (const SharedObject* const possibleParent) const noexcept | ||||
@@ -846,17 +846,17 @@ ValueTree ValueTree::getChild (int index) const | |||||
ValueTree ValueTree::getChildWithName (const Identifier type) const | ValueTree ValueTree::getChildWithName (const Identifier type) const | ||||
{ | { | ||||
return object != nullptr ? object->getChildWithName (type) : ValueTree::invalid; | |||||
return object != nullptr ? object->getChildWithName (type) : ValueTree(); | |||||
} | } | ||||
ValueTree ValueTree::getOrCreateChildWithName (const Identifier type, UndoManager* undoManager) | ValueTree ValueTree::getOrCreateChildWithName (const Identifier type, UndoManager* undoManager) | ||||
{ | { | ||||
return object != nullptr ? object->getOrCreateChildWithName (type, undoManager) : ValueTree::invalid; | |||||
return object != nullptr ? object->getOrCreateChildWithName (type, undoManager) : ValueTree(); | |||||
} | } | ||||
ValueTree ValueTree::getChildWithProperty (const Identifier propertyName, const var& propertyValue) const | ValueTree ValueTree::getChildWithProperty (const Identifier propertyName, const var& propertyValue) const | ||||
{ | { | ||||
return object != nullptr ? object->getChildWithProperty (propertyName, propertyValue) : ValueTree::invalid; | |||||
return object != nullptr ? object->getChildWithProperty (propertyName, propertyValue) : ValueTree(); | |||||
} | } | ||||
bool ValueTree::isAChildOf (const ValueTree& possibleParent) const | bool ValueTree::isAChildOf (const ValueTree& possibleParent) const | ||||
@@ -976,7 +976,7 @@ ValueTree ValueTree::readFromStream (InputStream& input) | |||||
const String type (input.readString()); | const String type (input.readString()); | ||||
if (type.isEmpty()) | if (type.isEmpty()) | ||||
return ValueTree::invalid; | |||||
return ValueTree(); | |||||
ValueTree v (type); | ValueTree v (type); | ||||
@@ -136,7 +136,7 @@ File DirectoryContentsList::getFile (const int index) const | |||||
if (const FileInfo* const info = files [index]) | if (const FileInfo* const info = files [index]) | ||||
return root.getChildFile (info->filename); | return root.getChildFile (info->filename); | ||||
return File::nonexistent; | |||||
return File(); | |||||
} | } | ||||
bool DirectoryContentsList::contains (const File& targetFile) const | bool DirectoryContentsList::contains (const File& targetFile) const | ||||
@@ -952,6 +952,6 @@ void ListBoxModel::selectedRowsChanged (int) {} | |||||
void ListBoxModel::deleteKeyPressed (int) {} | void ListBoxModel::deleteKeyPressed (int) {} | ||||
void ListBoxModel::returnKeyPressed (int) {} | void ListBoxModel::returnKeyPressed (int) {} | ||||
void ListBoxModel::listWasScrolled() {} | void ListBoxModel::listWasScrolled() {} | ||||
var ListBoxModel::getDragSourceDescription (const SparseSet<int>&) { return var::null; } | |||||
var ListBoxModel::getDragSourceDescription (const SparseSet<int>&) { return var(); } | |||||
String ListBoxModel::getTooltipForRow (int) { return String::empty; } | String ListBoxModel::getTooltipForRow (int) { return String::empty; } | ||||
MouseCursor ListBoxModel::getMouseCursorForRow (int) { return MouseCursor::NormalCursor; } | MouseCursor ListBoxModel::getMouseCursorForRow (int) { return MouseCursor::NormalCursor; } |
@@ -466,7 +466,7 @@ void TableListBoxModel::returnKeyPressed (int) {} | |||||
void TableListBoxModel::listWasScrolled() {} | void TableListBoxModel::listWasScrolled() {} | ||||
String TableListBoxModel::getCellTooltip (int /*rowNumber*/, int /*columnId*/) { return String::empty; } | String TableListBoxModel::getCellTooltip (int /*rowNumber*/, int /*columnId*/) { return String::empty; } | ||||
var TableListBoxModel::getDragSourceDescription (const SparseSet<int>&) { return var::null; } | |||||
var TableListBoxModel::getDragSourceDescription (const SparseSet<int>&) { return var(); } | |||||
Component* TableListBoxModel::refreshComponentForCell (int, int, bool, Component* existingComponentToUpdate) | Component* TableListBoxModel::refreshComponentForCell (int, int, bool, Component* existingComponentToUpdate) | ||||
{ | { | ||||
@@ -1371,7 +1371,7 @@ String TreeViewItem::getTooltip() | |||||
var TreeViewItem::getDragSourceDescription() | var TreeViewItem::getDragSourceDescription() | ||||
{ | { | ||||
return var::null; | |||||
return var(); | |||||
} | } | ||||
bool TreeViewItem::isInterestedInFileDrag (const StringArray&) | bool TreeViewItem::isInterestedInFileDrag (const StringArray&) | ||||