Changeset 2277


Ignore:
Timestamp:
Mar 19, 2009, 9:19:14 AM (15 years ago)
Author:
mloskot
Message:
Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/build/msvc90/geos_unit/geos_unit.vcproj

    r2265 r2277  
    453453                        </File>
    454454                        <File
     455                                RelativePath="..\..\..\tests\unit\capi\GEOSGeomFromWKBTest.cpp"
     456                                >
     457                        </File>
     458                        <File
     459                                RelativePath="..\..\..\tests\unit\capi\GEOSGeomToWKTTest.cpp"
     460                                >
     461                        </File>
     462                        <File
     463                                RelativePath="..\..\..\tests\unit\capi\GEOSPolygonizer_getCutEdgesTest.cpp"
     464                                >
     465                        </File>
     466                        <File
    455467                                RelativePath="..\..\..\tests\unit\capi\GEOSSimplifyTest.cpp"
    456468                                >
  • trunk/tests/unit/utility.h

    r2162 r2277  
    2929#include <cstdlib>
    3030#include <cassert>
     31#include <string>
     32#include <vector>
    3133// tut
    3234#include <tut.h>
     
    216218}
    217219
     220//
     221// Utility functions
     222//
     223
     224// Decodes hex-encoded WKB/EWKB to raw binary.
     225struct wkb_hex_decoder
     226{
     227    typedef std::vector<unsigned char> binary_type;
     228
     229    // bytes [out] - buffer for binary output
     230    static void decode(std::string const& hexstr, binary_type& bytes)
     231    {
     232        bytes.clear();
     233        for(std::string::size_type i = 0; i < hexstr.size() / 2; ++i)
     234        {
     235            std::istringstream iss(hexstr.substr(i * 2, 2));
     236            unsigned int n;
     237            iss >> std::hex >> n;
     238            bytes.push_back(static_cast<unsigned char>(n));
     239        }
     240    }
     241};
     242
     243
    218244} // namespace tut
    219245
Note: See TracChangeset for help on using the changeset viewer.