Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 135504 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-11 / +12 lines)
Line  Link Here
0
-- fbpager-0.1.4.orig/src/Resources.hh
0
++ fbpager-0.1.4/src/Resources.hh
Lines 8-15 Link Here
8
#include <cstdio>
8
#include <cstdio>
9
#include <cstring>
9
#include <cstring>
10
10
11
namespace FbTk {
12
11
template<>
13
template<>
12
void FbTk::Resource<bool>::
14
void Resource<bool>::
13
setFromString(char const *strval) {
15
setFromString(char const *strval) {
14
    if (strcasecmp(strval, "true") == 0 ||
16
    if (strcasecmp(strval, "true") == 0 ||
15
        strcasecmp(strval, "yes") == 0)
17
        strcasecmp(strval, "yes") == 0)
Lines 19-56 Link Here
19
}
21
}
20
22
21
template<>
23
template<>
22
std::string FbTk::Resource<bool>::
24
std::string Resource<bool>::
23
getString() {				
25
getString() {				
24
    return std::string(**this == true ? "true" : "false");
26
    return std::string(**this == true ? "true" : "false");
25
}
27
}
26
28
27
template <>
29
template <>
28
void FbTk::Resource<std::string>::setFromString(const char *str) {
30
void Resource<std::string>::setFromString(const char *str) {
29
    *(*this) = (str ?  str : "");
31
    *(*this) = (str ?  str : "");
30
}
32
}
31
33
32
template <>
34
template <>
33
std::string FbTk::Resource<std::string>::getString() {
35
std::string Resource<std::string>::getString() {
34
    return *(*this);
36
    return *(*this);
35
}
37
}
36
38
37
template <>
39
template <>
38
void FbTk::Resource<int>::setFromString(const char *str) {
40
void Resource<int>::setFromString(const char *str) {
39
    if (str == 0)
41
    if (str == 0)
40
        return;
42
        return;
41
    sscanf(str, "%d", &(*(*this)));
43
    sscanf(str, "%d", &(*(*this)));
42
}
44
}
43
45
44
template <>
46
template <>
45
std::string FbTk::Resource<int>::getString() {
47
std::string Resource<int>::getString() {
46
    char buff[16];
48
    char buff[16];
47
    sprintf(buff, "%d", (*(*this)));
49
    sprintf(buff, "%d", (*(*this)));
48
    return std::string(buff);
50
    return std::string(buff);
49
}
51
}
50
52
51
namespace FbPager {
52
template <>
53
template <>
53
void FbTk::Resource<FbPager::Alignment>::setFromString(const char *str) {
54
void Resource<FbPager::FbPager::Alignment>::setFromString(const char *str) {
54
    if (strcmp("TopToBottom", str) == 0)
55
    if (strcmp("TopToBottom", str) == 0)
55
        *(*this) = FbPager::FbPager::TOP_TO_BOTTOM;
56
        *(*this) = FbPager::FbPager::TOP_TO_BOTTOM;
56
    else
57
    else
Lines 58-64 Link Here
58
}
59
}
59
60
60
template <>
61
template <>
61
std::string FbTk::Resource<FbPager::Alignment>::getString() {
62
std::string Resource<FbPager::FbPager::Alignment>::getString() {
62
    switch (*(*this)) {
63
    switch (*(*this)) {
63
    case FbPager::FbPager::LEFT_TO_RIGHT:
64
    case FbPager::FbPager::LEFT_TO_RIGHT:
64
        return "LeftToRight";
65
        return "LeftToRight";
Lines 67-72 Link Here
67
    }
68
    }
68
}
69
}
69
70
70
} // end namespace FbPager
71
} // end namespace FbTk
71
72
72
#endif // RESOURCES
73
#endif // RESOURCES

Return to bug 135504