| OLD | NEW |
| 1 // Copyright 2008 The RE2 Authors. All Rights Reserved. | 1 // Copyright 2008 The RE2 Authors. All Rights Reserved. |
| 2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
| 3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // String generator: generates all possible strings of up to | 5 // String generator: generates all possible strings of up to |
| 6 // maxlen letters using the set of letters in alpha. | 6 // maxlen letters using the set of letters in alpha. |
| 7 // Fetch strings using a Java-like Next()/HasNext() interface. | 7 // Fetch strings using a Java-like Next()/HasNext() interface. |
| 8 | 8 |
| 9 #ifndef RE2_TESTING_STRING_GENERATOR_H__ | 9 #ifndef RE2_TESTING_STRING_GENERATOR_H__ |
| 10 #define RE2_TESTING_STRING_GENERATOR_H__ | 10 #define RE2_TESTING_STRING_GENERATOR_H__ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Iteration state. | 44 // Iteration state. |
| 45 StringPiece sp_; // Last StringPiece returned by Next(). | 45 StringPiece sp_; // Last StringPiece returned by Next(). |
| 46 string s_; // String data in last StringPiece returned by Next
(). | 46 string s_; // String data in last StringPiece returned by Next
(). |
| 47 bool hasnext_; // Whether Next() can be called again. | 47 bool hasnext_; // Whether Next() can be called again. |
| 48 vector<int> digits_; // Alphabet indices for next string. | 48 vector<int> digits_; // Alphabet indices for next string. |
| 49 bool generate_null_; // Whether to generate a NULL StringPiece next. | 49 bool generate_null_; // Whether to generate a NULL StringPiece next. |
| 50 bool random_; // Whether generated strings are random. | 50 bool random_; // Whether generated strings are random. |
| 51 int nrandom_; // Number of random strings left to generate. | 51 int nrandom_; // Number of random strings left to generate. |
| 52 ACMRandom* acm_; // Random number generator | 52 ACMRandom* acm_; // Random number generator |
| 53 DISALLOW_EVIL_CONSTRUCTORS(StringGenerator); | 53 DISALLOW_COPY_AND_ASSIGN(StringGenerator); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace re2 | 56 } // namespace re2 |
| 57 | 57 |
| 58 #endif // RE2_TESTING_STRING_GENERATOR_H__ | 58 #endif // RE2_TESTING_STRING_GENERATOR_H__ |
| OLD | NEW |