1 /*
2  * Copyright 2021 Google LLC
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SKSL_MANGLER
9 #define SKSL_MANGLER
10 
11 #include "include/private/SkSLString.h"
12 
13 namespace SkSL {
14 
15 class SymbolTable;
16 
17 class Mangler {
18 public:
19     /**
20      * Mangles baseName to create a name that is unique within symbolTable.
21      */
22     String uniqueName(String baseName, SymbolTable* symbolTable);
23 
reset()24     void reset() {
25         fCounter = 0;
26     }
27 
28 private:
29     int fCounter = 0;
30 };
31 
32 } // namespace SkSL
33 
34 #endif
35