1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

add option in JUCE to allow forbidden characters in OSC addresses.

This commit is contained in:
Ben Kuper 2019-05-13 18:48:15 +02:00
parent 6b5fc49f71
commit 6f438012be
2 changed files with 15 additions and 0 deletions

View file

@ -54,6 +54,14 @@
#include <juce_core/juce_core.h>
#include <juce_events/juce_events.h>
/** Config: JUCE_ALLOW_SPECIAL_CHARS_IN_ADDRESS
Enables the use of characters in adress that are not allowed by the OSC specifications (like spaces), but that are used
by some applications anyway (e.g. /my spaced/address)
*/
#ifndef JUCE_ALLOW_SPECIAL_CHARS_IN_ADDRESS
#define JUCE_ALLOW_SPECIAL_CHARS_IN_ADDRESS 0
#endif
//==============================================================================
#include "osc/juce_OSCTypes.h"
#include "osc/juce_OSCTimeTag.h"

View file

@ -274,10 +274,17 @@ namespace
return c >= ' ' && c <= '~';
}
#pragma warning(push)
#pragma warning(disable: 4100)
static bool isDisallowedChar (juce_wchar c) noexcept
{
#if JUCE_ALLOW_SPECIAL_CHARS_IN_ADDRESS
return false;
#else
return CharPointer_ASCII (Traits::getDisallowedChars()).indexOf (c, false) >= 0;
#endif
}
#pragma warning(pop)
static bool containsOnlyAllowedPrintableASCIIChars (const String& string) noexcept
{