Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(813)

Unified Diff: third_party/re2/re2/testing/string_generator.h

Issue 1544433002: Replace RE2 import with a dependency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-Added LICENSE and OWNERS file Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/re2/re2/testing/simplify_test.cc ('k') | third_party/re2/re2/testing/string_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/re2/testing/string_generator.h
diff --git a/third_party/re2/re2/testing/string_generator.h b/third_party/re2/re2/testing/string_generator.h
deleted file mode 100644
index 52e5e22ca0df0833d4097cbb617159ac753688dd..0000000000000000000000000000000000000000
--- a/third_party/re2/re2/testing/string_generator.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2008 The RE2 Authors. All Rights Reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// String generator: generates all possible strings of up to
-// maxlen letters using the set of letters in alpha.
-// Fetch strings using a Java-like Next()/HasNext() interface.
-
-#ifndef RE2_TESTING_STRING_GENERATOR_H__
-#define RE2_TESTING_STRING_GENERATOR_H__
-
-#include <string>
-#include <vector>
-#include "util/util.h"
-#include "util/random.h"
-#include "re2/stringpiece.h"
-
-namespace re2 {
-
-class StringGenerator {
- public:
- StringGenerator(int maxlen, const vector<string>& alphabet);
- ~StringGenerator();
- const StringPiece& Next();
- bool HasNext() { return hasnext_; }
-
- // Resets generator to start sequence over.
- void Reset();
-
- // Causes generator to emit random strings for next n calls to Next().
- void Random(int32 seed, int n);
-
- // Causes generator to emit a NULL as the next call.
- void GenerateNULL();
-
- private:
- bool IncrementDigits();
- bool RandomDigits();
-
- // Global state.
- int maxlen_; // Maximum length string to generate.
- vector<string> alphabet_; // Alphabet, one string per letter.
-
- // Iteration state.
- StringPiece sp_; // Last StringPiece returned by Next().
- string s_; // String data in last StringPiece returned by Next().
- bool hasnext_; // Whether Next() can be called again.
- vector<int> digits_; // Alphabet indices for next string.
- bool generate_null_; // Whether to generate a NULL StringPiece next.
- bool random_; // Whether generated strings are random.
- int nrandom_; // Number of random strings left to generate.
- ACMRandom* acm_; // Random number generator
- DISALLOW_COPY_AND_ASSIGN(StringGenerator);
-};
-
-} // namespace re2
-
-#endif // RE2_TESTING_STRING_GENERATOR_H__
« no previous file with comments | « third_party/re2/re2/testing/simplify_test.cc ('k') | third_party/re2/re2/testing/string_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698