parameters: (filters_path, source_files,
                                  rule_dependencies, extension_to_rule_name)
docstring: Generate the filters file.
  
    This file is used by Visual Studio to organize the presentation of source
    files into folders.
  
    Arguments:
        filters_path: The path of the file to be created.
        source_files: The hierarchical structure of all the sources.
        extension_to_rule_name: A dictionary mapping file extensions to rules.
docstring_summary: Generate the filters file.
docstring_tokens: Generate the filters file .
function: def _GenerateMSBuildFiltersFile(filters_path, source_files,
                                  rule_dependencies, extension_to_rule_name):
    """Generate the filters file.
  
    This file is used by Visual Studio to organize the presentation of source
    files into folders.
  
    Arguments:
        filters_path: The path of the file to be created.
        source_files: The hierarchical structure of all the sources.
        extension_to_rule_name: A dictionary mapping file extensions to rules.
    """
    filter_group = []
    source_group = []
    _AppendFiltersForMSBuild('', source_files, rule_dependencies,
                             extension_to_rule_name, filter_group, source_group)
    if filter_group:
      content = ['Project',
                 {'ToolsVersion': '4.0',
                  'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'
                 },
                 ['ItemGroup'] + filter_group,
                 ['ItemGroup'] + source_group
                ]
      easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True)
    elif os.path.exists(filters_path):
      # We don't need this filter anymore.  Delete the old filter file.
      os.unlink(filters_path)
function_tokens: def _GenerateMSBuildFiltersFile ( filters_path , source_files , rule_dependencies , extension_to_rule_name ) : filter_group = [ ] source_group = [ ] _AppendFiltersForMSBuild ( '' , source_files , rule_dependencies , extension_to_rule_name , filter_group , source_group ) if filter_group : content = [ 'Project' , { 'ToolsVersion' : '4.0' , 'xmlns' : 'http://schemas.microsoft.com/developer/msbuild/2003' } , [ 'ItemGroup' ] + filter_group , [ 'ItemGroup' ] + source_group ] easy_xml . WriteXmlIfChanged ( content , filters_path , pretty = True , win32 = True ) elif os . path . exists ( filters_path ) : # We don't need this filter anymore.  Delete the old filter file. os . unlink ( filters_path )