~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to pgadmin/pgscript/generators/pgsStringGen.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2011-06-07 23:03:54 UTC
  • mfrom: (1.3.1 upstream) (13 sid)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110607230354-3td4j9y71u4ahcvj
Tags: 1.14.0~beta1-1
* New upstream development release, adding Build-Depends on
  postgresql-server-dev-all >= 117~.
* Add Build-Depends on quilt, (un)patch to debian/rules and patch for fixing
  the include for kwlist.h in pgadmin/db/keywords.c.
* Add pg_config --includedir-server output to CPPFLAGS.
* Remove unrecognized configure options: --with-wx-config,
  --with-pgsql-include, --enable-gtk2, --enable-unicode.
* Clean up manually the files that are left behind after the broken
  distclean.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//////////////////////////////////////////////////////////////////////////
2
2
//
3
3
// pgScript - PostgreSQL Tools
4
 
// 
5
 
// Copyright (C) 2002 - 2010, The pgAdmin Development Team
 
4
//
 
5
// Copyright (C) 2002 - 2011, The pgAdmin Development Team
6
6
// This software is released under the PostgreSQL Licence
7
7
//
8
8
//////////////////////////////////////////////////////////////////////////
15
15
WX_DEFINE_OBJARRAY(pgsVectorChar);
16
16
 
17
17
pgsStringGen::pgsStringGen(USHORT w_size_min, USHORT w_size_max,
18
 
                const UCHAR & nb_words, const long & seed, pgsVectorChar characters) :
 
18
                           const UCHAR &nb_words, const long &seed, pgsVectorChar characters) :
19
19
        pgsObjectGen(seed), m_nb_words(nb_words), m_characters(characters)
20
20
{
21
21
        init_characters(); // Initialize vector if it is empty
26
26
 
27
27
        size_t char_count = m_characters.GetCount();
28
28
        m_w_size_randomizer = pgsRandomizer(pnew pgsIntegerGen(w_size_min,
29
 
                        w_size_max, false, seed));
 
29
                                            w_size_max, false, seed));
30
30
        m_letter_randomizer = pgsRandomizer(pnew pgsIntegerGen(0,
31
 
                        wx_static_cast(long, char_count) - 1, false, seed));
 
31
                                            wx_static_cast(long, char_count) - 1, false, seed));
32
32
}
33
33
 
34
34
wxString pgsStringGen::random()
42
42
                for (long j = 0; j < w_size; j++)
43
43
                {
44
44
                        str_result.Append(m_characters
45
 
                                        .Item(m_letter_randomizer->random_long()), 1);
 
45
                                          .Item(m_letter_randomizer->random_long()), 1);
46
46
                }
47
47
                if (w_size > 0 && m_nb_words != (i + 1))
48
48
                {
77
77
        }
78
78
}
79
79
 
80
 
pgsStringGen * pgsStringGen::clone()
 
80
pgsStringGen *pgsStringGen::clone()
81
81
{
82
82
        return pnew pgsStringGen(*this);
83
83
}