1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/* -*- mode: C++; tab-width: 4 -*- */
/* ===================================================================== *\
Copyright (c) 1999-2001 Palm, Inc. or its subsidiaries.
All rights reserved.
This file is part of the Palm OS Emulator.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
\* ===================================================================== */
#ifndef StringConversions_h
#define StringConversions_h
#include "EmDevice.h" // EmDevice
#include <string>
class EmDirRef;
class EmFileRef;
class EmTransportDescriptor;
// ----------------------------------------------------------------------
// Our preferences routines need to convert our preference data to and
// from string format (the format in which the data is stored on disk).
// Following are a bunch of overloaded routines for converting strings
// into all the data types we use for preferences.
// ----------------------------------------------------------------------
bool FromString (const string& s, bool& value);
bool FromString (const string& s, char& value);
bool FromString (const string& s, signed char& value);
bool FromString (const string& s, unsigned char& value);
bool FromString (const string& s, signed short& value);
bool FromString (const string& s, unsigned short& value);
bool FromString (const string& s, signed int& value);
bool FromString (const string& s, unsigned int& value);
bool FromString (const string& s, signed long& value);
bool FromString (const string& s, unsigned long& value);
bool FromString (const string& s, string& value);
bool FromString (const string& s, char* value);
bool FromString (const string& s, CloseActionType& value);
bool FromString (const string& s, EmDevice& value);
bool FromString (const string& s, EmDirRef& value);
bool FromString (const string& s, EmErrorHandlingOption& value);
bool FromString (const string& s, EmFileRef& value);
bool FromString (const string& s, EmTransportDescriptor& value);
// ----------------------------------------------------------------------
// Our preferences routines need to convert our preference data to and
// from string format (the format in which the data is stored on disk).
// Following are a bunch of overloaded routines for converting data
// (in all the types we use for preferences) into strings.
// ----------------------------------------------------------------------
string ToString (bool value);
string ToString (char value);
string ToString (signed char value);
string ToString (unsigned char value);
string ToString (signed short value);
string ToString (unsigned short value);
string ToString (signed int value);
string ToString (unsigned int value);
string ToString (signed long value);
string ToString (unsigned long value);
string ToString (const string& value);
string ToString (const char* value);
string ToString (CloseActionType value);
string ToString (const EmDevice& value);
string ToString (const EmDirRef& value);
string ToString (EmErrorHandlingOption value);
string ToString (const EmFileRef& value);
string ToString (const EmTransportDescriptor& value);
#endif /* StringConversions_h */
|