~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmithContribItems/wxthings/wxthings/src/optvalue.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////////////////////
 
2
// Name     : optvalue.cpp
 
3
// Author   : John Labenski
 
4
// Created  : 07/01/02
 
5
// Copyright: John Labenski, 2002
 
6
// License  : wxWidgets v2
 
7
/////////////////////////////////////////////////////////////////////////////
 
8
 
 
9
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 
10
    #pragma implementation "optvalue.h"
 
11
#endif
 
12
 
 
13
// For compilers that support precompilation, includes "wx/wx.h"
 
14
#include "wx/wxprec.h"
 
15
 
 
16
#ifdef __BORLANDC__
 
17
    #pragma hdrstop
 
18
#endif
 
19
 
 
20
#ifndef WX_PRECOMP
 
21
    #include "wx/object.h"
 
22
    #include "wx/string.h"
 
23
    #include "wx/gdicmn.h"
 
24
#endif // WX_PRECOMP
 
25
 
 
26
#include "wx/tokenzr.h"
 
27
#include "wx/things/optvalue.h"
 
28
 
 
29
#include "wx/arrimpl.cpp"
 
30
WX_DEFINE_OBJARRAY(wxArrayOptionValue);
 
31
 
 
32
//----------------------------------------------------------------------------
 
33
// Global wxString utilities
 
34
//----------------------------------------------------------------------------
 
35
/*
 
36
wxArrayString wxStringToWords( const wxString &string )
 
37
{
 
38
 
 
39
//  wxArrayString arr;
 
40
//  wxString word, s = string.Strip(wxString::both);
 
41
//  wxMemoryInputStream memstream( s.c_str(), string.Length() );
 
42
//  wxTextInputStream textstream(memstream);
 
43
//  while (!memstream.Eof())
 
44
//  {
 
45
//      word = textstream.ReadWord();
 
46
//      if (!word.IsEmpty()) arr.Add(word.Strip(wxString::both));
 
47
//  }
 
48
//  return arr;
 
49
 
 
50
    wxArrayString arr;
 
51
    wxString s = string.Strip(wxString::both);
 
52
    while (!s.IsEmpty())
 
53
    {
 
54
        arr.Add(s.BeforeFirst(wxT(' ')));
 
55
        s = s.AfterFirst(wxT(' ')).Strip(wxString::both);
 
56
    }
 
57
    return arr;
 
58
}
 
59
*/
 
60
 
 
61
//----------------------------------------------------------------------------
 
62
// wxOptionValueRefData
 
63
//----------------------------------------------------------------------------
 
64
 
 
65
class wxOptionValueRefData: public wxObjectRefData
 
66
{
 
67
public:
 
68
    wxOptionValueRefData() : wxObjectRefData() {}
 
69
 
 
70
    wxOptionValueRefData(const wxOptionValueRefData& data) : wxObjectRefData()
 
71
    {
 
72
        m_type         = data.m_type;
 
73
        m_optionNames  = data.m_optionNames;
 
74
        m_optionValues = data.m_optionValues;
 
75
        m_children     = data.m_children;;
 
76
    }
 
77
 
 
78
    ~wxOptionValueRefData() {}
 
79
 
 
80
    wxString            m_type;
 
81
    wxArrayString       m_optionNames;
 
82
    wxArrayString       m_optionValues;
 
83
    wxArrayOptionValue  m_children;
 
84
};
 
85
 
 
86
#define M_OPTVALUDATA ((wxOptionValueRefData *)m_refData)
 
87
 
 
88
//----------------------------------------------------------------------------
 
89
// wxOptionValue - a ref counted wxString key, wxString value container
 
90
//----------------------------------------------------------------------------
 
91
 
 
92
IMPLEMENT_DYNAMIC_CLASS(wxOptionValue, wxObject);
 
93
 
 
94
wxObjectRefData *wxOptionValue::CreateRefData() const
 
95
{
 
96
    return new wxOptionValueRefData;
 
97
}
 
98
wxObjectRefData *wxOptionValue::CloneRefData(const wxObjectRefData *data) const
 
99
{
 
100
    return new wxOptionValueRefData(*(const wxOptionValueRefData *)data);
 
101
}
 
102
 
 
103
bool wxOptionValue::Create()
 
104
{
 
105
    UnRef();
 
106
    m_refData = new wxOptionValueRefData();
 
107
    return Ok();
 
108
}
 
109
 
 
110
bool wxOptionValue::Create( const wxOptionValue &optValue )
 
111
{
 
112
    wxCHECK_MSG( optValue.Ok(), false, wxT("Invalid wxOptionValue") );
 
113
 
 
114
    UnRef();
 
115
    Ref( optValue );
 
116
    return Ok();
 
117
}
 
118
 
 
119
bool wxOptionValue::Create( const wxString &string )
 
120
{
 
121
    UnRef();
 
122
    m_refData = new wxOptionValueRefData();
 
123
 
 
124
    int i, start = 0, length = string.Length();
 
125
 
 
126
    wxString buff;
 
127
 
 
128
    const wxChar *s = string.GetData();
 
129
 
 
130
//  const wxChar comma = 44; // comma
 
131
    const wxChar tab = 9;  // tab
 
132
//    const wxChar space = 32; // space
 
133
    const wxChar cr = 13; // carrage return
 
134
    const wxChar lf = 10; // line feed
 
135
    const wxChar openbracket  = wxT('[');
 
136
    const wxChar closebracket  = wxT(']');
 
137
    const wxChar equals = wxT('=');
 
138
    const wxChar ccr = wxT('\n');
 
139
 
 
140
    bool has_type = false;
 
141
 
 
142
    for (i=0; i<length; i++, s++)                    // find opening [ for type
 
143
    {
 
144
        if (*s == openbracket)
 
145
        {
 
146
            start = i+1;
 
147
            s++;                               // don't include bracket in type
 
148
            has_type = true;
 
149
            break;
 
150
        }
 
151
    }
 
152
    if (has_type)
 
153
    {
 
154
        for (i=start; i<length; i++, s++)            // find closing ] for type
 
155
        {
 
156
            if ((*s == closebracket))
 
157
            {
 
158
                M_OPTVALUDATA->m_type = buff;
 
159
                s++;
 
160
                start = i+1;
 
161
                break;
 
162
            }
 
163
            else if ((*s != tab) && (*s != cr) && (*s != lf) && (*s != ccr))
 
164
            {
 
165
                buff.Append(*s);
 
166
            }
 
167
            else
 
168
                return false;
 
169
        }
 
170
    }
 
171
 
 
172
    buff.Clear();
 
173
    for (i=start; i<length; i++)  // add options
 
174
    {
 
175
        // add up characters until an = sign then the word before is the name
 
176
        //   the rest of the string before that is the value for the previous name
 
177
        if (*s != equals)
 
178
            buff.Append(*s);
 
179
        else
 
180
        {
 
181
            buff.Trim(false).Trim(true);
 
182
            if (!buff.IsEmpty())
 
183
            {
 
184
                const wxChar *t = buff.GetData();
 
185
                int j;
 
186
                for (j = buff.Length()-1; j>=0; j--)
 
187
                {
 
188
                    const wxChar c = t[j];
 
189
                    if ((c == cr) || (c == lf) || (c == ccr) || (c == tab))
 
190
                    {
 
191
                        j++;
 
192
                        break;
 
193
                    }
 
194
                }
 
195
                if (j<0) j = 0;
 
196
                M_OPTVALUDATA->m_optionNames.Add(buff.Mid(j));
 
197
                buff.Remove(j).Trim(true);
 
198
            }
 
199
            if (!buff.IsEmpty())
 
200
                M_OPTVALUDATA->m_optionValues.Add(buff);
 
201
 
 
202
            buff.Clear();
 
203
        }
 
204
        s++;
 
205
    }
 
206
 
 
207
    buff.Trim(false).Trim(true);
 
208
    if (!buff.IsEmpty())
 
209
        M_OPTVALUDATA->m_optionValues.Add(buff);
 
210
 
 
211
    if ((M_OPTVALUDATA->m_optionValues.GetCount() != M_OPTVALUDATA->m_optionNames.GetCount()))
 
212
    {
 
213
        int i;
 
214
        wxPrintf(wxT("wxOptionValue::wxOptionValue( const wxString &string BUSTED\n"));
 
215
 
 
216
        wxPrintf(wxT("[%s]\n"), M_OPTVALUDATA->m_type.c_str());
 
217
        for (i=0; i<(int)M_OPTVALUDATA->m_optionNames.GetCount(); i++)
 
218
            wxPrintf(wxT("{%s}\n"), M_OPTVALUDATA->m_optionNames[i].c_str());
 
219
        for (i=0; i<(int)M_OPTVALUDATA->m_optionValues.GetCount(); i++)
 
220
            wxPrintf(wxT("{%s}\n"), M_OPTVALUDATA->m_optionValues[i].c_str());
 
221
        fflush(stdout);
 
222
    }
 
223
 
 
224
    return ((M_OPTVALUDATA->m_optionValues.GetCount() > 0) &&
 
225
            (M_OPTVALUDATA->m_optionValues.GetCount() !=
 
226
             M_OPTVALUDATA->m_optionNames.GetCount()));
 
227
}
 
228
 
 
229
bool wxOptionValue::Copy( const wxOptionValue &optValue )
 
230
{
 
231
    wxCHECK_MSG( optValue.Ok(), false, wxT("Invalid wxOptionValue") );
 
232
 
 
233
    if (!Ok()) Create();
 
234
 
 
235
    M_OPTVALUDATA->m_type         = optValue.GetType();
 
236
    M_OPTVALUDATA->m_optionNames  = optValue.GetOptionNames();
 
237
    M_OPTVALUDATA->m_optionValues = optValue.GetOptionValues();
 
238
    if (optValue.GetChildrenCount())
 
239
        M_OPTVALUDATA->m_children = *optValue.GetChildren();
 
240
    else
 
241
        M_OPTVALUDATA->m_children.Clear();
 
242
 
 
243
    return true;
 
244
}
 
245
 
 
246
bool wxOptionValue::Ok() const
 
247
{
 
248
    return M_OPTVALUDATA != NULL;
 
249
}
 
250
 
 
251
void wxOptionValue::Destroy()
 
252
{
 
253
    UnRef();
 
254
}
 
255
 
 
256
//-----------------------------------------------------------------------------
 
257
 
 
258
wxString wxOptionValue::GetType() const
 
259
{
 
260
    wxCHECK_MSG( Ok(), wxEmptyString, wxT("Invalid wxOptionValue") );
 
261
    return M_OPTVALUDATA->m_type;
 
262
}
 
263
 
 
264
void wxOptionValue::SetType( const wxString &type )
 
265
{
 
266
    wxCHECK_RET( Ok(), wxT("Invalid wxOptionValue") );
 
267
    M_OPTVALUDATA->m_type = type;
 
268
}
 
269
 
 
270
//-----------------------------------------------------------------------------
 
271
 
 
272
size_t wxOptionValue::GetChildrenCount() const
 
273
{
 
274
    wxCHECK_MSG( Ok(), 0, wxT("Invalid wxOptionValue") );
 
275
    return M_OPTVALUDATA->m_children.GetCount();
 
276
}
 
277
wxArrayOptionValue *wxOptionValue::GetChildren() const
 
278
{
 
279
    wxCHECK_MSG( Ok(), NULL, wxT("Invalid wxOptionValue") );
 
280
    return &M_OPTVALUDATA->m_children;
 
281
}
 
282
bool wxOptionValue::AddChild( const wxOptionValue& child )
 
283
{
 
284
    wxCHECK_MSG( Ok() && child.Ok(), 0, wxT("Invalid wxOptionValue") );
 
285
    M_OPTVALUDATA->m_children.Add(child);
 
286
    return true;
 
287
}
 
288
void wxOptionValue::DeleteChildren()
 
289
{
 
290
    wxCHECK_RET( Ok(), wxT("Invalid wxOptionValue") );
 
291
    M_OPTVALUDATA->m_children.Clear();
 
292
}
 
293
 
 
294
//-----------------------------------------------------------------------------
 
295
 
 
296
size_t wxOptionValue::GetOptionCount() const
 
297
{
 
298
    wxCHECK_MSG( Ok(), 0, wxT("Invalid wxOptionValue") );
 
299
    return M_OPTVALUDATA->m_optionNames.GetCount();
 
300
}
 
301
 
 
302
wxArrayString wxOptionValue::GetOptionNames() const
 
303
{
 
304
    wxCHECK_MSG( Ok(), wxArrayString(), wxT("Invalid wxOptionValue") );
 
305
    return M_OPTVALUDATA->m_optionNames;
 
306
}
 
307
wxArrayString wxOptionValue::GetOptionValues() const
 
308
{
 
309
    wxCHECK_MSG( Ok(), wxArrayString(), wxT("Invalid wxOptionValue") );
 
310
    return M_OPTVALUDATA->m_optionValues;
 
311
}
 
312
 
 
313
wxString wxOptionValue::GetOptionName( size_t n ) const
 
314
{
 
315
    wxCHECK_MSG( Ok() && (n<M_OPTVALUDATA->m_optionNames.GetCount()),
 
316
                 wxEmptyString, wxT("Invalid wxOptionValue") );
 
317
    return M_OPTVALUDATA->m_optionNames[n];
 
318
}
 
319
 
 
320
wxString wxOptionValue::GetOptionValue( size_t n ) const
 
321
{
 
322
    wxCHECK_MSG( Ok() && (n<M_OPTVALUDATA->m_optionValues.GetCount()),
 
323
                 wxEmptyString, wxT("Invalid wxOptionValue") );
 
324
    return M_OPTVALUDATA->m_optionValues[n];
 
325
}
 
326
 
 
327
int wxOptionValue::HasOption(const wxString& name) const
 
328
{
 
329
    wxCHECK_MSG( Ok(), wxNOT_FOUND, wxT("Invalid wxOptionValue") );
 
330
    int index = M_OPTVALUDATA->m_optionNames.Index(name, false);
 
331
    return index;
 
332
}
 
333
 
 
334
int wxOptionValue::FindOption(const wxString &part_of_option_name) const
 
335
{
 
336
    wxCHECK_MSG( Ok(), wxNOT_FOUND, wxT("Invalid wxOptionValue") );
 
337
    int i, count = M_OPTVALUDATA->m_optionNames.GetCount();
 
338
 
 
339
    for (i=0; i<count; i++)
 
340
    {
 
341
        if (M_OPTVALUDATA->m_optionNames[i].Contains(part_of_option_name))
 
342
            return i;
 
343
    }
 
344
    return wxNOT_FOUND;
 
345
}
 
346
 
 
347
bool wxOptionValue::DeleteOption(const wxString &name)
 
348
{
 
349
    wxCHECK_MSG( Ok(), false, wxT("Invalid wxOptionValue"));
 
350
    int index = M_OPTVALUDATA->m_optionNames.Index(name, false);
 
351
    if (index == wxNOT_FOUND) return false;
 
352
    M_OPTVALUDATA->m_optionNames.RemoveAt(index);
 
353
    M_OPTVALUDATA->m_optionValues.RemoveAt(index);
 
354
    return true;
 
355
}
 
356
 
 
357
bool wxOptionValue::DeleteOption( size_t n )
 
358
{
 
359
    wxCHECK_MSG( Ok(), false, wxT("Invalid wxOptionValue") );
 
360
    wxCHECK_MSG( n < M_OPTVALUDATA->m_optionValues.GetCount(), false, wxT("invalid index"));
 
361
    M_OPTVALUDATA->m_optionNames.RemoveAt(n);
 
362
    M_OPTVALUDATA->m_optionValues.RemoveAt(n);
 
363
    return true;
 
364
}
 
365
 
 
366
//-----------------------------------------------------------------------------
 
367
// Set Options
 
368
 
 
369
// Option functions (arbitrary name/value mapping)
 
370
void wxOptionValue::SetOption(const wxString& name, const wxString& value, bool force)
 
371
{
 
372
    wxCHECK_RET( Ok() && (name.Length() > 0), wxT("Invalid wxOptionValue or option") );
 
373
 
 
374
    int idx = M_OPTVALUDATA->m_optionNames.Index(name, false);
 
375
    if (idx == wxNOT_FOUND)
 
376
    {
 
377
        M_OPTVALUDATA->m_optionNames.Add(name);
 
378
        M_OPTVALUDATA->m_optionValues.Add(value);
 
379
    }
 
380
    else if (force)
 
381
    {
 
382
        M_OPTVALUDATA->m_optionNames[idx]  = name;
 
383
        M_OPTVALUDATA->m_optionValues[idx] = value;
 
384
    }
 
385
}
 
386
 
 
387
void wxOptionValue::SetOption(const wxString &name, bool update, const wxChar *format, ...)
 
388
{
 
389
    va_list argptr;
 
390
    va_start(argptr, format);
 
391
    wxString s;
 
392
    s.PrintfV(format, argptr);
 
393
    va_end(argptr);
 
394
    SetOption(name, s, update);
 
395
}
 
396
 
 
397
//-----------------------------------------------------------------------------
 
398
// Get Options
 
399
 
 
400
wxString wxOptionValue::GetOption(const wxString& name) const
 
401
{
 
402
    wxCHECK_MSG( Ok(), wxEmptyString, wxT("Invalid wxOptionValue") );
 
403
 
 
404
    int idx = M_OPTVALUDATA->m_optionNames.Index(name, false);
 
405
    if (idx != wxNOT_FOUND)
 
406
        return M_OPTVALUDATA->m_optionValues[idx];
 
407
 
 
408
    return wxEmptyString;
 
409
}
 
410
 
 
411
int wxOptionValue::GetOptionInt(const wxString& name) const
 
412
{
 
413
    return wxAtoi(GetOption(name));
 
414
}
 
415
 
 
416
bool wxOptionValue::GetOption(const wxString& name, wxString &value ) const
 
417
{
 
418
    wxString s = GetOption(name);
 
419
    if (!s.IsEmpty()) { value = s; return true; }
 
420
    return false;
 
421
}
 
422
bool wxOptionValue::GetOption(const wxString& name, int *value ) const
 
423
{
 
424
    long n;
 
425
    if (GetOption(name).ToLong(&n))
 
426
    {
 
427
        *value = (int)n;
 
428
        return true;
 
429
    }
 
430
    return false;
 
431
}
 
432
bool wxOptionValue::GetOption(const wxString& name, float *value ) const
 
433
{
 
434
    double n;
 
435
    if (GetOption(name, &n))
 
436
    {
 
437
        *value = (float)n;
 
438
        return true;
 
439
    }
 
440
    return false;
 
441
}
 
442
bool wxOptionValue::GetOption(const wxString& name, double *value ) const
 
443
{
 
444
    double n;
 
445
    if (GetOption(name).ToDouble(&n))
 
446
    {
 
447
        *value = n;
 
448
        return true;
 
449
    }
 
450
    return false;
 
451
}
 
452
 
 
453
int wxOptionValue::GetOption(const wxString& name, const wxChar *format, ...) const
 
454
{
 
455
    wxString n = GetOption(name);
 
456
    if (n.IsEmpty()) return 0;
 
457
    va_list argptr;
 
458
    va_start(argptr, format);
 
459
//  int i = wxVsscanf(n.c_str(), format, argptr); // VisualStudio doesn't have this
 
460
    int i = wxSscanf(n.c_str(), format, argptr);
 
461
    va_end(argptr);
 
462
    return i;
 
463
}
 
464
 
 
465
int wxOptionValue::GetOption(const wxString& name, wxArrayInt &values,
 
466
                             int count, const wxString& delims) const
 
467
{
 
468
    wxString value = GetOption(name);
 
469
    wxStringTokenizer tokens(value, delims, wxTOKEN_STRTOK);
 
470
    int read_count = 0;
 
471
 
 
472
    while (((count < 0) || (read_count <= count)) && tokens.HasMoreTokens())
 
473
    {
 
474
        long num;
 
475
        if (!tokens.GetNextToken().ToLong(&num)) return read_count;
 
476
        values.Add(num);
 
477
        read_count++;
 
478
    }
 
479
    return read_count;
 
480
}
 
481
 
 
482
bool wxOptionValue::GetOption(const wxString& name, unsigned char *value, int count,
 
483
                              const wxString& delims) const
 
484
{
 
485
    wxArrayInt intArr; intArr.Alloc(count);
 
486
    if (GetOption(name, intArr, count, delims) != count)
 
487
        return false;
 
488
 
 
489
    for (int i = 0; i < count; i++) value[i] = (unsigned char)intArr[i];
 
490
    return true;
 
491
}
 
492
bool wxOptionValue::GetOption(const wxString& name, int *value, int count,
 
493
                              const wxString& delims) const
 
494
{
 
495
    wxArrayInt intArr; intArr.Alloc(count);
 
496
    if (GetOption(name, intArr, count, delims) != count)
 
497
        return false;
 
498
 
 
499
    for (int i = 0; i < count; i++) value[i] = intArr[i];
 
500
    return true;
 
501
}
 
502
bool wxOptionValue::GetOption(const wxString& name, long *value, int count,
 
503
                              const wxString& delims) const
 
504
{
 
505
    wxArrayInt intArr; intArr.Alloc(count);
 
506
    if (GetOption(name, intArr, count, delims) != count)
 
507
        return false;
 
508
 
 
509
    for (int i = 0; i < count; i++) value[i] = intArr[i];
 
510
    return true;
 
511
}
 
512
bool wxOptionValue::GetOption(const wxString& name, float *value, int count,
 
513
                              const wxString& delims) const
 
514
{
 
515
    double *nums = (double*)malloc(sizeof(double)*count);
 
516
    if (GetOption(name, nums, count, delims))
 
517
    {
 
518
        for (int i=0; i < count; i++) value[i] = (float)nums[i];
 
519
        free(nums);
 
520
        return true;
 
521
    }
 
522
    free(nums);
 
523
    return false;
 
524
}
 
525
bool wxOptionValue::GetOption(const wxString& name, double *value, int count,
 
526
                              const wxString& delims) const
 
527
{
 
528
    wxString optValue = GetOption(name);
 
529
    wxStringTokenizer tokens(optValue, delims, wxTOKEN_STRTOK);
 
530
    int read_count = 0;
 
531
    double *nums = (double*)malloc(sizeof(double)*count);
 
532
    double num;
 
533
 
 
534
    while ((read_count <= count) && tokens.HasMoreTokens())
 
535
    {
 
536
        if (!tokens.GetNextToken().ToDouble(&num))
 
537
        {
 
538
            free(nums);
 
539
            return false;
 
540
        }
 
541
        if (read_count >= count) break;
 
542
        read_count++;
 
543
    }
 
544
 
 
545
    if (read_count == count)
 
546
    {
 
547
        for (int i = 0; i < count; i++) value[i] = nums[i];
 
548
        free(nums);
 
549
        return true;
 
550
    }
 
551
 
 
552
    free(nums);
 
553
    return false;
 
554
}
 
555
 
 
556
 
 
557
bool wxOptionValue::GetOption(const wxString& name, int *v1, int *v2,
 
558
                              const wxString& delims) const
 
559
{
 
560
    wxArrayInt intArr;
 
561
    if (GetOption(name, intArr, 2, delims) != 2)
 
562
        return false;
 
563
 
 
564
    if (v1) *v1 = intArr[0];
 
565
    if (v2) *v2 = intArr[1];
 
566
    return true;
 
567
}
 
568
bool wxOptionValue::GetOption(const wxString& name, int *v1, int *v2, int *v3,
 
569
                              const wxString& delims) const
 
570
{
 
571
    wxArrayInt intArr;
 
572
    if (GetOption(name, intArr, 3, delims) != 3)
 
573
        return false;
 
574
 
 
575
    if (v1) *v1 = intArr[0];
 
576
    if (v2) *v2 = intArr[1];
 
577
    if (v3) *v3 = intArr[2];
 
578
    return true;
 
579
}
 
580
bool wxOptionValue::GetOption(const wxString& name, float *v1, float *v2, float *v3,
 
581
                              const wxString& delims) const
 
582
{
 
583
    double nums[3];
 
584
    if (GetOption(name, nums, 3, delims))
 
585
        return false;
 
586
 
 
587
    if (v1) *v1 = (float)nums[0];
 
588
    if (v2) *v2 = (float)nums[1];
 
589
    if (v3) *v3 = (float)nums[2];
 
590
    return true;
 
591
}
 
592
 
 
593
bool wxOptionValue::GetOption(const wxString& name, wxRect &value,
 
594
                              const wxString& delims) const
 
595
{
 
596
    wxArrayInt intArr;
 
597
    if (GetOption(name, intArr, 4, delims) != 4)
 
598
        return false;
 
599
 
 
600
    value = wxRect(intArr[0], intArr[1], intArr[2], intArr[3]);
 
601
    return true;
 
602
}