|
Gin
|
Files | |
| file | gin_varianthelpers.h |
| Utility functions for working with JUCE var objects and their properties. | |
Namespaces | |
| namespace | macOS |
| macOS-specific image conversion utilities. | |
| namespace | juce |
Classes | |
| class | LambdaTimer |
| Timer that calls a std::function callback instead of requiring virtual override. More... | |
| class | LambdaAsyncUpdater |
| Async updater that calls a std::function callback instead of requiring virtual override. More... | |
| class | LambdaMouseListener |
| Mouse listener that uses std::function callbacks instead of virtual overrides. More... | |
| class | CoalescedTimer |
| An efficient timer that shares a single juce::Timer between multiple instances. More... | |
| class | ComponentMap |
| Internal class for mapping component paths to component pointers. More... | |
| class | ElevatedFileCopy |
| Copies files, creating folders where required requesting admin access only if required. More... | |
| class | ConstantsStack |
| class | ConstantsStack::ScopedSave |
| class | Parser |
| class | LayoutSupport |
| JSON-based layout system for JUCE components. More... | |
| struct | LayoutSupport::Bounds |
| struct | LayoutSupport::JsonFile |
| class | OpenStreetMaps |
| Fetches map files from OSM servers. More... | |
| class | OpenStreetMaps::Listener |
| class | SystemClipboard |
| Utilities for reading and writing images to the system clipboard. More... | |
| class | AsyncDownload |
| Async Download. More... | |
| struct | Property |
| Simple key-value pair structure for representing a property. More... | |
| struct | juce::VarIterator |
| Iterator for a var. More... | |
| struct | juce::VarIterator::NamedValue |
Typedefs | |
| using | juce::VarIterator::difference_type = std::ptrdiff_t |
| using | juce::VarIterator::value_type = NamedValue |
| using | juce::VarIterator::reference = NamedValue & |
| using | juce::VarIterator::pointer = NamedValue * |
| using | juce::VarIterator::iterator_category = std::forward_iterator_tag |
Functions | |
| void | callOnMainThreadBlocking (std::function< void()> func) |
| juce::Colour | goldenRatioColor (int idx) |
| Returns the next colour in a set where the hues differ by the golden ratio. | |
| void | asyncDownload (const juce::URL &, std::function< void(const juce::String &)>) |
| void | asyncDownload (const juce::URL &, std::function< void(const juce::MemoryBlock &)>) |
| juce::Image | createDesktopSnapshot () |
| juce::Image | createSnapshotOfNativeWindow (juce::Component &c) |
| juce::var | jsonObject () |
| Creates an empty JSON object (DynamicObject wrapped in a var). | |
| std::string | toStdString (const juce::var &v) |
| Convert a var to a std::string. | |
| Property::Property ()=default | |
| Property::Property (const juce::String &k, const juce::var v) | |
| Construct a Property with a key and value. | |
| juce::var | getPropertyWithDefault (const juce::var &v, const juce::Identifier &i, const juce::var &defaultValue) |
| Get a property value with a default fallback. | |
| void | setProperty (juce::var &v, const juce::Identifier &i, const juce::var &value) |
| Set a property on a var object. | |
| void | removeProperty (juce::var &v, const juce::Identifier &i) |
| Remove a property from a var object. | |
| bool | setJSONPointer (juce::var &v, juce::String pointer, const juce::var &newValue) |
| Given a JSON array/object 'v', a string representing a JSON pointer, and a new property value 'newValue', updates 'v' where the property or array index referenced by the pointer has been set to 'newValue'. | |
| juce::var | getJSONPointer (const juce::var &v, juce::String pointer, const juce::var &defaultValue) |
| Given a JSON array/object 'v', a string representing a JSON pointer, returns the value of the property or array index referenced by the pointer If the pointer cannot be followed, due to referencing missing array indices or fields, then this returns defaultValue. | |
| bool | hasJSONPointer (const juce::var &v, juce::String pointer) |
| Check if a JSON Pointer path exists in a var. | |
| juce::String | removeJsonComments (const juce::String &input) |
| Remove C-style and C++-style comments from a JSON string. | |
| juce::VarIterator::VarIterator (const juce::var &, bool isEnd) | |
| VarIterator & | juce::VarIterator::operator++ () |
| bool | juce::VarIterator::operator== (const VarIterator &) const |
| bool | juce::VarIterator::operator!= (const VarIterator &) const |
| NamedValue | juce::VarIterator::operator* () const |
| VarIterator | juce::begin (const juce::var &) |
| VarIterator | juce::end (const juce::var &) |
Variables | |
| juce::String | Property::key |
| Property name/key. | |
| juce::var | Property::value |
| Property value. | |
| juce::var | juce::VarIterator::NamedValue::name |
| juce::var | juce::VarIterator::NamedValue::value |
| using juce::VarIterator::difference_type = std::ptrdiff_t |
| using juce::VarIterator::iterator_category = std::forward_iterator_tag |
| juce::Colour goldenRatioColor | ( | int | idx | ) |
Returns the next colour in a set where the hues differ by the golden ratio.
Good for coming up with a random set of colours
| juce::Image createDesktopSnapshot | ( | ) |
| juce::Image createSnapshotOfNativeWindow | ( | juce::Component & | c | ) |
| juce::var jsonObject | ( | ) |
Creates an empty JSON object (DynamicObject wrapped in a var).
This is a convenience function that's cleaner than writing juce::var (new juce::DynamicObject()) repeatedly.
| std::string toStdString | ( | const juce::var & | v | ) |
Convert a var to a std::string.
This is a convenience function equivalent to v.toString().toStdString().
| v | The var to convert |
|
default |
| juce::var getPropertyWithDefault | ( | const juce::var & | v, |
| const juce::Identifier & | i, | ||
| const juce::var & | defaultValue | ||
| ) |
Get a property value with a default fallback.
Returns the property value if it exists, otherwise returns the default value. This is a safer alternative to direct property access when the property might not exist.
| v | The var object to get the property from |
| i | Property name identifier |
| defaultValue | Value to return if property doesn't exist |
Set a property on a var object.
If the var contains a DynamicObject, sets the property on it. If the var is not a DynamicObject, this function does nothing.
| v | The var object to set the property on (passed by reference) |
| i | Property name identifier |
| value | Value to set for the property |
Remove a property from a var object.
If the var contains a DynamicObject, removes the specified property from it. If the var is not a DynamicObject, this function does nothing.
| v | The var object to remove the property from (passed by reference) |
| i | Property name identifier to remove |
Given a JSON array/object 'v', a string representing a JSON pointer, and a new property value 'newValue', updates 'v' where the property or array index referenced by the pointer has been set to 'newValue'.
If intermediate objects in the path don't exist, they will be automatically created as empty DynamicObjects. However, intermediate arrays are NOT automatically created - the array must already exist.
If the pointer cannot be followed due to referencing missing array indices, this returns false.
| v | The var object to modify (passed by reference) |
| pointer | JSON Pointer string (e.g., "/user/name") |
| newValue | The value to set at the pointer location |
For more details, check the JSON Pointer RFC 6901: https://datatracker.ietf.org/doc/html/rfc6901
| juce::var getJSONPointer | ( | const juce::var & | v, |
| juce::String | pointer, | ||
| const juce::var & | defaultValue | ||
| ) |
Given a JSON array/object 'v', a string representing a JSON pointer, returns the value of the property or array index referenced by the pointer If the pointer cannot be followed, due to referencing missing array indices or fields, then this returns defaultValue.
For more details, check the JSON Pointer RFC 6901: https://datatracker.ietf.org/doc/html/rfc6901
Check if a JSON Pointer path exists in a var.
Given a JSON array/object 'v' and a JSON pointer string, returns true if the property or array index referenced by the pointer exists.
This is useful for checking existence before calling getJSONPointer to distinguish between "property doesn't exist" and "property exists but is null/void".
| v | The var object to check |
| pointer | JSON Pointer string (e.g., "/user/name") |
For more details, check the JSON Pointer RFC 6901: https://datatracker.ietf.org/doc/html/rfc6901
| juce::String removeJsonComments | ( | const juce::String & | input | ) |
Remove C-style and C++-style comments from a JSON string.
This function strips both line comments and block comments from JSON text, allowing you to use commented JSON files. Comments within string literals are preserved.
Supported comment styles:
String handling:
| input | The JSON string potentially containing comments |
| VarIterator & juce::VarIterator::operator++ | ( | ) |
| bool juce::VarIterator::operator== | ( | const VarIterator & | ) | const |
| bool juce::VarIterator::operator!= | ( | const VarIterator & | ) | const |
| NamedValue juce::VarIterator::operator* | ( | ) | const |
| VarIterator juce::begin | ( | const juce::var & | ) |
| VarIterator juce::end | ( | const juce::var & | ) |
| juce::String Property::key |
Property name/key.
| juce::var Property::value |
Property value.
| juce::var juce::VarIterator::NamedValue::name |
| juce::var juce::VarIterator::NamedValue::value |