void SongCacheIndex::AddCacheIndex(const CString &path, unsigned hash) { if( hash == 0 ) ++hash; /* no 0 hash values */ CacheIndex.SetValue( "Cache", "CacheVersion", FILE_CACHE_VERSION ); CacheIndex.SetValue( "Cache", MangleName(path), hash ); CacheIndex.WriteFile( CACHE_INDEX ); }
unsigned SongCacheIndex::GetCacheHash( const CString &path ) const { unsigned iDirHash; if( !CacheIndex.GetValue( "Cache", MangleName(path), iDirHash ) ) return 0; if( iDirHash == 0 ) ++iDirHash; /* no 0 hash values */ return iDirHash; }
void EmitClangCommentCommandList(RecordKeeper &Records, raw_ostream &OS) { emitSourceFileHeader("A list of commands useable in documentation " "comments", OS); OS << "#ifndef COMMENT_COMMAND\n" << "# define COMMENT_COMMAND(NAME)\n" << "#endif\n"; std::vector<Record *> Tags = Records.getAllDerivedDefinitions("Command"); for (size_t i = 0, e = Tags.size(); i != e; ++i) { Record &Tag = *Tags[i]; std::string MangledName = MangleName(Tag.getValueAsString("Name")); OS << "COMMENT_COMMAND(" << MangledName << ")\n"; } }