FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Dobbs M-Dev
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
October 01, 2003

URL Canonicalization Testing

(Page 9 of 16)
URL Canonicalization Testing

Listing 7 CStringEncoder header


#ifndef CStringEncoder_h
#define CStringEncoder_h

#include <assert.h>
#include <string>
#include <vector>
#include "IEncoder.h"

typedef std::vector<std::wstring> EncodingsBag;

class CStringEncoder 
    {
    private:
    EncodingsBag encodings;

    public:
    CStringEncoder(std::wstring stringToEncode, unsigned long level
        , IEncoder & encoder);
    public:
    virtual ~CStringEncoder();

    public:
    //-------------------------------------------------
    // Valid indices are zero through Count - 1.
    unsigned long Count() const;
    std::wstring Item(unsigned long index) const;

    private:
    void AddEncoding(std::wstring encodingToAdd);
    bool DontAlreadyHaveEncoding(std::wstring encodingToAdd) const;

    void CreateEntireStringFullEncodings(std::wstring stringToEncode
        , unsigned long level, IEncoder & encoder);
    void CreateEntireStringRandomEncodings(std::wstring stringToEncode
        , unsigned long level, IEncoder & encoder);
    void CreateSingleCharacterEncodings(std::wstring stringToEncode
        , unsigned long level, IEncoder & encoder);
    };
#endif // CStringEncoder_h

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK