~ubuntu-branches/debian/sid/pgadmin3/sid

« back to all changes in this revision

Viewing changes to pgadmin/include/pgscript/generators/pgsRegexGen.h

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2009-07-30 12:27:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730122716-fddbh42on721bbs2
Tags: 1.10.0-1
* New upstream release.
* Adjusted watch file to match release candidates.
* Updated to Standards-Version 3.8.2:
  - Moved to Section: database.
  - Add DEB_BUILD_OPTIONS support for parallel building.
  - Move from findstring to filter suggestion for DEB_BUILD_OPTIONS parsing.
* pgagent got split into its own separate source package by upstream.
* Exclude Docs.vcproj from installation.
* Move doc-base.enus from pgadmin3 to pgadmin3-data package, the files are
  in there too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//////////////////////////////////////////////////////////////////////////
 
2
//
 
3
// pgScript - PostgreSQL Tools
 
4
// RCS-ID:      $Id: pgsRegexGen.h 7758 2009-03-26 20:49:59Z dpage $
 
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
 
6
// This software is released under the BSD Licence
 
7
//
 
8
//////////////////////////////////////////////////////////////////////////
 
9
 
 
10
 
 
11
#ifndef PGSREGEXGEN_H_
 
12
#define PGSREGEXGEN_H_
 
13
 
 
14
#include "pgscript/pgScript.h"
 
15
#include "pgscript/generators/pgsObjectGen.h"
 
16
#include "pgscript/generators/pgsStringGen.h"
 
17
 
 
18
WX_DECLARE_OBJARRAY(pgsStringGen, pgsVectorStringGen);
 
19
 
 
20
class pgsRegexGen : public pgsObjectGen
 
21
{
 
22
        
 
23
private:
 
24
        
 
25
        class pgsRegex
 
26
        {
 
27
                
 
28
        private:
 
29
                
 
30
                pgsVectorChar m_characters;
 
31
                
 
32
                long m_first;
 
33
                long m_second;
 
34
                
 
35
        public:
 
36
                
 
37
                pgsRegex(const pgsVectorChar & characters, const long & first,
 
38
                                const long & second);
 
39
                
 
40
                pgsRegex();
 
41
 
 
42
                ~pgsRegex();
 
43
 
 
44
                pgsRegex * clone();
 
45
                
 
46
                /* pgsRegex & operator =(const pgsRegex & that); */
 
47
 
 
48
                /* pgsRegex(const pgsRegex & that); */
 
49
                
 
50
                void set_characters(const pgsVectorChar & characters);
 
51
                
 
52
                void add_character(const wxChar & c);
 
53
                
 
54
                void set_first(const long & first);
 
55
                
 
56
                void set_second(const long & second);
 
57
                
 
58
                const pgsVectorChar & get_characters() const;
 
59
                
 
60
                const long & get_first() const;
 
61
                
 
62
                const long & get_second() const;
 
63
                
 
64
        };
 
65
        
 
66
private:
 
67
 
 
68
        wxString m_regex;
 
69
        
 
70
        bool m_valid;
 
71
        
 
72
        pgsVectorStringGen m_string_gens;
 
73
 
 
74
public:
 
75
 
 
76
        pgsRegexGen(const wxString & regex, const long & seed = wxDateTime::GetTimeNow());
 
77
 
 
78
        virtual wxString random();
 
79
 
 
80
        virtual ~pgsRegexGen();
 
81
 
 
82
        virtual pgsRegexGen * clone();
 
83
        
 
84
        /* pgsRegexGen & operator =(const pgsRegexGen & that); */
 
85
 
 
86
        /* pgsRegexGen(const pgsRegexGen & that); */
 
87
        
 
88
        const bool & is_valid() const;
 
89
        
 
90
        const pgsVectorStringGen & string_gens() const;
 
91
        
 
92
        size_t string_gens_size() const;
 
93
 
 
94
private:
 
95
 
 
96
        static wxString espace_xml_char(const wxChar & c);
 
97
        
 
98
        static wxString char_range(const wxChar & b, const wxChar & c);
 
99
 
 
100
};
 
101
 
 
102
#endif /*PGSREGEXGEN_H_*/