def GetHeaderGuardCPPVariable(filename):
 filename = re.sub('_flymake\\.h$', '.h', filename)
 filename = re.sub('/\\.flymake/([^/]*)$', '/\\1', filename)
 filename = filename.replace('C++', 'cpp').replace('c++', 'cpp')
 fileinfo = FileInfo(filename)
 file_path_from_root = fileinfo.RepositoryName()
 if _root:
  suffix = os.sep
  if (suffix == '\\'):
   suffix += '\\'
  file_path_from_root = re.sub((('^' + _root) + suffix), '', file_path_from_root)
 return (re.sub('[^a-zA-Z0-9]', '_', file_path_from_root).upper() + '_')

def GetHeaderGuardCPPVariable ( filename ) : filename = re . sub ( '_flymake\\.h$' , '.h' , filename ) filename = re . sub ( '/\\.flymake/([^/]*)$' , '/\\1' , filename ) filename = filename . replace ( 'C++' , 'cpp' ) . replace ( 'c++' , 'cpp' ) fileinfo = FileInfo ( filename ) file_path_from_root = fileinfo . RepositoryName ( ) if _root : suffix = os . sep if ( suffix == '\\' ) : suffix += '\\' file_path_from_root = re . sub ( ( ( '^' + _root ) + suffix ) , '' , file_path_from_root ) return ( re . sub ( '[^a-zA-Z0-9]' , '_' , file_path_from_root ) . upper ( ) + '_' )
returns the cpp variable that should be used as a header guard .