| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Utilies and constants specific to Chromium C++ code. | 5 """Utilies and constants specific to Chromium C++ code. |
| 6 """ | 6 """ |
| 7 | 7 |
| 8 from code import Code | 8 from code import Code |
| 9 from datetime import datetime | 9 from datetime import datetime |
| 10 from model import Property, PropertyType, Type | 10 from model import PropertyType |
| 11 import os | 11 import os |
| 12 import re | 12 import re |
| 13 | 13 |
| 14 CHROMIUM_LICENSE = ( | 14 CHROMIUM_LICENSE = ( |
| 15 """// Copyright (c) %d The Chromium Authors. All rights reserved. | 15 """// Copyright (c) %d The Chromium Authors. All rights reserved. |
| 16 // Use of this source code is governed by a BSD-style license that can be | 16 // Use of this source code is governed by a BSD-style license that can be |
| 17 // found in the LICENSE file.""" % datetime.now().year | 17 // found in the LICENSE file.""" % datetime.now().year |
| 18 ) | 18 ) |
| 19 GENERATED_FILE_MESSAGE = """// GENERATED FROM THE API DEFINITION IN | 19 GENERATED_FILE_MESSAGE = """// GENERATED FROM THE API DEFINITION IN |
| 20 // %s | 20 // %s |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 c.Append('namespace %s {' % component) | 104 c.Append('namespace %s {' % component) |
| 105 return c | 105 return c |
| 106 | 106 |
| 107 def CloseNamespace(namespace): | 107 def CloseNamespace(namespace): |
| 108 """Get closing root namespace declarations. | 108 """Get closing root namespace declarations. |
| 109 """ | 109 """ |
| 110 c = Code() | 110 c = Code() |
| 111 for component in reversed(namespace.split('::')): | 111 for component in reversed(namespace.split('::')): |
| 112 c.Append('} // namespace %s' % component) | 112 c.Append('} // namespace %s' % component) |
| 113 return c | 113 return c |
| OLD | NEW |