components/variations/service/generate_ui_string_overrider.py
def _GenerateHeaderFileContent(namespace, header_filename):
  """Generates the .h for to the .cc generated by _GenerateSourceFileContent.

  Args:
    namespace: The namespace in which the generated code should be scoped. If
        not defined, then the code will be in the global namespace.

    header_filename: Path to the corresponding .h. Used to generate the include
        guards.

  Returns:
    .cc file content implementing the CreateUIStringOverrider() factory.
  """

  include_guard = re.sub('[^A-Z]', '_', header_filename.upper()) + '_'
  namespace_prefix, namespace_suffix = _GenerateNamespacePrefixAndSuffix(
      namespace)

  return (
      "// This file was generated by %(script_name)s. Do not edit.\n"
      "\n"
      "#ifndef %(include_guard)s\n"
      "#define %(include_guard)s\n"
      "\n"
      "#include \"components/variations/service/ui_string_overrider.h\"\n\n"
      "%(namespace_prefix)s"
      "// Returns an initialized UIStringOverrider.\n"
      "variations::UIStringOverrider CreateUIStringOverrider();\n"
      "%(namespace_suffix)s"
      "\n"
      "#endif  // %(include_guard)s\n"
      ) % {
          'script_name': SCRIPT_NAME,
          'include_guard': include_guard,
          'namespace_prefix': namespace_prefix,
          'namespace_suffix': namespace_suffix,
      }
Generates the .h for to the .cc generated by _GenerateSourceFileContent.

  Args:
    namespace: The namespace in which the generated code should be scoped. If
        not defined, then the code will be in the global namespace.

    header_filename: Path to the corresponding .h. Used to generate the include
        guards.

  Returns:
    .cc file content implementing the CreateUIStringOverrider() factory.
  
Generates the .h for to the .cc generated by _GenerateSourceFileContent.
Generates the . h for to the . cc generated by _GenerateSourceFileContent .
def _GenerateHeaderFileContent(namespace, header_filename):
  include_guard = re.sub('[^A-Z]', '_', header_filename.upper()) + '_'
  namespace_prefix, namespace_suffix = _GenerateNamespacePrefixAndSuffix(
      namespace)
  return (
      "// This file was generated by %(script_name)s. Do not edit.\n"
      "\n"
      "#ifndef %(include_guard)s\n"
      "#define %(include_guard)s\n"
      "\n"
      "#include \"components/variations/service/ui_string_overrider.h\"\n\n"
      "%(namespace_prefix)s"
      "// Returns an initialized UIStringOverrider.\n"
      "variations::UIStringOverrider CreateUIStringOverrider();\n"
      "%(namespace_suffix)s"
      "\n"
      "#endif  // %(include_guard)s\n"
      ) % {
          'script_name': SCRIPT_NAME,
          'include_guard': include_guard,
          'namespace_prefix': namespace_prefix,
          'namespace_suffix': namespace_suffix,
      }
def _GenerateHeaderFileContent ( namespace , header_filename ) : include_guard = re . sub ( '[^A-Z]' , '_' , header_filename . upper ( ) ) + '_' namespace_prefix , namespace_suffix = _GenerateNamespacePrefixAndSuffix ( namespace ) return ( "// This file was generated by %(script_name)s. Do not edit.\n" "\n" "#ifndef %(include_guard)s\n" "#define %(include_guard)s\n" "\n" "#include \"components/variations/service/ui_string_overrider.h\"\n\n" "%(namespace_prefix)s" "// Returns an initialized UIStringOverrider.\n" "variations::UIStringOverrider CreateUIStringOverrider();\n" "%(namespace_suffix)s" "\n" "#endif  // %(include_guard)s\n" ) % { 'script_name' : SCRIPT_NAME , 'include_guard' : include_guard , 'namespace_prefix' : namespace_prefix , 'namespace_suffix' : namespace_suffix , }
Generates the .h for to the .cc generated by _GenerateSourceFileContent.
Generates the . h for to the . cc generated by _GenerateSourceFileContent .
"""Generates the .h for to the .cc generated by _GenerateSourceFileContent.

  Args:
    namespace: The namespace in which the generated code should be scoped. If
        not defined, then the code will be in the global namespace.

    header_filename: Path to the corresponding .h. Used to generate the include
        guards.

  Returns:
    .cc file content implementing the CreateUIStringOverrider() factory.
  """
.cc file content implementing the CreateUIStringOverrider() factory.
. cc file content implementing the CreateUIStringOverrider () factory .
namespace
The namespace in which the generated code should be scoped. If
not defined, then the code will be in the global namespace.
The namespace in which the generated code should be scoped . If not defined then the code will be in the global namespace .
header_filename
Path to the corresponding .h. Used to generate the include
guards.
Path to the corresponding . h . Used to generate the include guards .