Project

General

Profile

Feature #538 ยป src.patch

Redmine Admin, 14 Jan 2008 03:33

View differences:

basicio.hpp (working copy)
467 467
        // DATA
468 468
        std::string path_;
469 469
        std::string openMode_;
470
        FILE *fp_;
470
	std::FILE *fp_;
471 471
        OpMode opMode_;
472 472

  
473 473
        byte* pMappedArea_;
exif.hpp (working copy)
168 168
        //@{
169 169
        //! Return the key of the %Exifdatum.
170 170
        std::string key() const
171
            { return key_.get() == 0 ? "" : key_->key(); }
171
            { return key_.get() == 0 ? std::string("") : key_->key(); }
172 172
        std::string groupName() const
173
            { return key_.get() == 0 ? "" : key_->groupName(); }
173
            { return key_.get() == 0 ? std::string("") : key_->groupName(); }
174 174
        std::string tagName() const
175
            { return key_.get() == 0 ? "" : key_->tagName(); }
175
            { return key_.get() == 0 ? std::string("") : key_->tagName(); }
176 176
        std::string tagLabel() const
177
            { return key_.get() == 0 ? "" : key_->tagLabel(); }
177
            { return key_.get() == 0 ? std::string("") : key_->tagLabel(); }
178 178
        uint16_t tag() const
179 179
            { return key_.get() == 0 ? 0xffff : key_->tag(); }
180 180
        //! Return the IFD id
......
185 185
            { return key_.get() == 0 ? "" : key_->ifdName(); }
186 186
        //! Return the related image item (deprecated)
187 187
        std::string ifdItem() const
188
            { return key_.get() == 0 ? "" : key_->ifdItem(); }
188
            { return key_.get() == 0 ? std::string("") : key_->ifdItem(); }
189 189
        //! Return the index (unique id of this key within the original IFD)
190 190
        int idx() const
191 191
            { return key_.get() == 0 ? 0 : key_->idx(); }
......
219 219
            { return value_.get() == 0 ? 0 : value_->size(); }
220 220
        //! Return the value as a string.
221 221
        std::string toString() const
222
            { return value_.get() == 0 ? "" : value_->toString(); }
222
            { return value_.get() == 0 ? std::string("") : value_->toString(); }
223 223
        std::string toString(long n) const
224
            { return value_.get() == 0 ? "" : value_->toString(n); }
224
            { return value_.get() == 0 ? std::string("") : value_->toString(n); }
225 225
        long toLong(long n =0) const
226 226
            { return value_.get() == 0 ? -1 : value_->toLong(n); }
227 227
        float toFloat(long n =0) const
iptc.hpp (working copy)
117 117
                 is not necessarily unique, i.e., an IptcData object may contain
118 118
                 multiple metadata with the same key.
119 119
         */
120
        std::string key() const { return key_.get() == 0 ? "" : key_->key(); }
120
        std::string key() const { return key_.get() == 0 ? std::string("") : key_->key(); }
121 121
        /*!
122 122
           @brief Return the name of the record
123 123
           @return record name
124 124
         */
125 125
        std::string recordName() const
126
            { return key_.get() == 0 ? "" : key_->recordName(); }
126
            { return key_.get() == 0 ? std::string("") : key_->recordName(); }
127 127
        /*!
128 128
           @brief Return the record id
129 129
           @return record id
......
135 135
           @return tag name
136 136
         */
137 137
        std::string tagName() const
138
            { return key_.get() == 0 ? "" : key_->tagName(); }
138
            { return key_.get() == 0 ? std::string("") : key_->tagName(); }
139 139
        std::string tagLabel() const
140
            { return key_.get() == 0 ? "" : key_->tagLabel(); }
140
            { return key_.get() == 0 ? std::string("") : key_->tagLabel(); }
141 141
        //! Return the tag (aka dataset) number
142 142
        uint16_t tag() const
143 143
            { return key_.get() == 0 ? 0 : key_->tag(); }
......
148 148
        long count() const { return value_.get() == 0 ? 0 : value_->count(); }
149 149
        long size() const { return value_.get() == 0 ? 0 : value_->size(); }
150 150
        std::string toString() const
151
            { return value_.get() == 0 ? "" : value_->toString(); }
151
            { return value_.get() == 0 ? std::string("") : value_->toString(); }
152 152
        std::string toString(long n) const
153
            { return value_.get() == 0 ? "" : value_->toString(n); }
153
            { return value_.get() == 0 ? std::string("") : value_->toString(n); }
154 154
        long toLong(long n =0) const
155 155
            { return value_.get() == 0 ? -1 : value_->toLong(n); }
156 156
        float toFloat(long n =0) const
types.hpp (working copy)
52 48
#endif
53 49

  
54 50
// MSVC doesn't provide C99 types, but it has MS specific variants
55
#ifdef _MSC_VER
51
#ifdef WIN32
56 52
typedef unsigned __int8  uint8_t;
57 53
typedef unsigned __int16 uint16_t;
58 54
typedef unsigned __int32 uint32_t;
......
69 65

  
70 66
// *****************************************************************************
71 67
// forward declarations
68
#if 0
72 69
struct tm;
70
#endif
73 71

  
74 72
// *****************************************************************************
75 73
// namespace extensions
value.hpp (working copy)
1306 1306
    template<typename T> T getValue(const byte* buf, ByteOrder byteOrder);
1307 1307
    // Specialization for a 2 byte unsigned short value.
1308 1308
    template<>
1309
    inline uint16_t getValue(const byte* buf, ByteOrder byteOrder)
1309
    inline uint16_t getValue<uint16_t>(const byte* buf, ByteOrder byteOrder)
1310 1310
    {
1311 1311
        return getUShort(buf, byteOrder);
1312 1312
    }
1313 1313
    // Specialization for a 4 byte unsigned long value.
1314 1314
    template<>
1315
    inline uint32_t getValue(const byte* buf, ByteOrder byteOrder)
1315
    inline uint32_t getValue<uint32_t>(const byte* buf, ByteOrder byteOrder)
1316 1316
    {
1317 1317
        return getULong(buf, byteOrder);
1318 1318
    }
1319 1319
    // Specialization for an 8 byte unsigned rational value.
1320 1320
    template<>
1321
    inline URational getValue(const byte* buf, ByteOrder byteOrder)
1321
    inline URational getValue<URational>(const byte* buf, ByteOrder byteOrder)
1322 1322
    {
1323 1323
        return getURational(buf, byteOrder);
1324 1324
    }
1325 1325
    // Specialization for a 2 byte signed short value.
1326 1326
    template<>
1327
    inline int16_t getValue(const byte* buf, ByteOrder byteOrder)
1327
    inline int16_t getValue<int16_t>(const byte* buf, ByteOrder byteOrder)
1328 1328
    {
1329 1329
        return getShort(buf, byteOrder);
1330 1330
    }
1331 1331
    // Specialization for a 4 byte signed long value.
1332 1332
    template<>
1333
    inline int32_t getValue(const byte* buf, ByteOrder byteOrder)
1333
    inline int32_t getValue<int32_t>(const byte* buf, ByteOrder byteOrder)
1334 1334
    {
1335 1335
        return getLong(buf, byteOrder);
1336 1336
    }
1337 1337
    // Specialization for an 8 byte signed rational value.
1338 1338
    template<>
1339
    inline Rational getValue(const byte* buf, ByteOrder byteOrder)
1339
    inline Rational getValue<Rational>(const byte* buf, ByteOrder byteOrder)
1340 1340
    {
1341 1341
        return getRational(buf, byteOrder);
1342 1342
    }
xmp.cpp (working copy)
161 161

  
162 162
    std::string Xmpdatum::key() const
163 163
    {
164
        return p_->key_.get() == 0 ? "" : p_->key_->key(); 
164
        return p_->key_.get() == 0 ? std::string("") : p_->key_->key(); 
165 165
    }
166 166

  
167 167
    std::string Xmpdatum::groupName() const
168 168
    {
169
        return p_->key_.get() == 0 ? "" : p_->key_->groupName();
169
        return p_->key_.get() == 0 ? std::string("") : p_->key_->groupName();
170 170
    }
171 171

  
172 172
    std::string Xmpdatum::tagName() const
173 173
    {
174
        return p_->key_.get() == 0 ? "" : p_->key_->tagName();
174
        return p_->key_.get() == 0 ? std::string("") : p_->key_->tagName();
175 175
    }
176 176

  
177 177
    std::string Xmpdatum::tagLabel() const
178 178
    {
179
        return p_->key_.get() == 0 ? "" : p_->key_->tagLabel();
179
        return p_->key_.get() == 0 ? std::string("") : p_->key_->tagLabel();
180 180
    }
181 181

  
182 182
    uint16_t Xmpdatum::tag() const
......
206 206

  
207 207
    std::string Xmpdatum::toString() const
208 208
    {
209
        return p_->value_.get() == 0 ? "" : p_->value_->toString();
209
        return p_->value_.get() == 0 ? std::string("") : p_->value_->toString();
210 210
    }
211 211

  
212 212
    std::string Xmpdatum::toString(long n) const
213 213
    {
214
        return p_->value_.get() == 0 ? "" : p_->value_->toString(n);
214
        return p_->value_.get() == 0 ? std::string("") : p_->value_->toString(n);
215 215
    }
216 216

  
217 217
    long Xmpdatum::toLong(long n) const
    (1-1/1)