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

Side by Side Diff: ui/base/template_expressions.h

Issue 1220793010: [ui/base;css] adding string template expression replacement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better use of StringPiece in template expressions Created 5 years, 5 months 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This file defines utility functions for replacing template expressions.
6 // For example "Hello ${name}" could have ${name} replaced by the user's name.
7
8 #ifndef UI_BASE_TEMPLATE_EXPRESSIONS_H_
9 #define UI_BASE_TEMPLATE_EXPRESSIONS_H_
10
11 #include <map>
12 #include <string>
13
14 #include "base/strings/string16.h"
Dan Beam 2015/07/16 00:21:44 unneeded
Dan Beam 2015/07/17 01:57:18 ping
dschuyler 2015/07/17 02:31:39 Done.
15 #include "base/strings/string_piece.h"
16 #include "ui/base/ui_base_export.h"
17
18 namespace ui {
19
20 // Replace ${foo} in the format string with the value for the foo key in
21 // |subst|. If the key is not found in the |substitutions| that item will
22 // be unaltered.
23 UI_BASE_EXPORT std::string ReplaceTemplateExpressions(
24 base::StringPiece format_string,
25 const std::map<base::StringPiece, std::string>& substitutions);
26
27 } // namespace ui
28
29 #endif // UI_BASE_TEMPLATE_EXPRESSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698