Subversion Repositories svn.mios32

Rev

Rev 1556 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1556 Rev 1724
Line 1... Line 1...
1
/* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
1
/* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
2
// $Id: HexTextEditor.cpp 1556 2012-11-28 23:09:41Z tk $
2
// $Id: HexTextEditor.cpp 1724 2013-03-28 20:23:40Z tk $
3
/*
3
/*
4
 * Text Editor variant which allows to edit hex bytes
4
 * Text Editor variant which allows to edit hex bytes
5
 *
5
 *
6
 * ==========================================================================
6
 * ==========================================================================
7
 *
7
 *
Line 63... Line 63...
63
    String hexStr = getText();
63
    String hexStr = getText();
64
    int size = hexStr.length();
64
    int size = hexStr.length();
65
#if JUCE_MAJOR_VERSION==1 && JUCE_MINOR_VERSION<51
65
#if JUCE_MAJOR_VERSION==1 && JUCE_MINOR_VERSION<51
66
    const char *strBuffer = (const char *)hexStr; // for *much* faster access! The String[pos] handling of Juce should be optimized!
66
    const char *strBuffer = (const char *)hexStr; // for *much* faster access! The String[pos] handling of Juce should be optimized!
67
#else
67
#else
68
    const char *strBuffer = hexStr.toCString(); // for *much* faster access! The String[pos] handling of Juce should be optimized!
68
    const char *strBuffer = hexStr.toUTF8().getAddress(); // for *much* faster access! The String[pos] handling of Juce should be optimized!
69
#endif
69
#endif
70
70
71
    int numBytes = 0;
71
    int numBytes = 0;
72
    int charCounter = 0;
72
    int charCounter = 0;
73
    bool invalidBytesFound = false;
73
    bool invalidBytesFound = false;
Line 156... Line 156...
156
    int size = hexStr.length();
156
    int size = hexStr.length();
157
157
158
#if JUCE_MAJOR_VERSION==1 && JUCE_MINOR_VERSION<51
158
#if JUCE_MAJOR_VERSION==1 && JUCE_MINOR_VERSION<51
159
    const char *strBuffer = (const char *)hexStr; // for *much* faster access! The String[pos] handling of Juce should be optimized!
159
    const char *strBuffer = (const char *)hexStr; // for *much* faster access! The String[pos] handling of Juce should be optimized!
160
#else
160
#else
161
    const char *strBuffer = hexStr.toCString(); // for *much* faster access! The String[pos] handling of Juce should be optimized!
161
    const char *strBuffer = hexStr.toUTF8().getAddress(); // for *much* faster access! The String[pos] handling of Juce should be optimized!
162
#endif
162
#endif
163
163
164
    Array<uint8> retArray;
164
    Array<uint8> retArray;
165
    int charCounter = 0;
165
    int charCounter = 0;
166
    uint8 b = 0;
166
    uint8 b = 0;