Skip to content

Commit 111d6ea

Browse files
committed
Added includeCache.String() and includeCacheItem.String()
1 parent 9699a1b commit 111d6ea

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

legacy/builder/container_find_includes.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,13 @@ type includeCacheEntry struct {
212212
}
213213

214214
func (entry *includeCacheEntry) String() string {
215-
return fmt.Sprintf("SourceFile: %s; Include: %s; IncludePath: %s",
216-
entry.Sourcefile, entry.Include, entry.Includepath)
215+
if entry.Sourcefile == nil {
216+
return fmt.Sprintf("Include path added: %s", entry.Includepath)
217+
}
218+
if entry.Include == "" {
219+
return fmt.Sprintf("%s successfully compiled", entry.Sourcefile)
220+
}
221+
return fmt.Sprintf("%s requires %s: include path added %s", entry.Sourcefile, entry.Include, entry.Includepath)
217222
}
218223

219224
func (entry *includeCacheEntry) Equals(other *includeCacheEntry) bool {
@@ -318,6 +323,14 @@ func (cache *includeCache) WriteToFile() error {
318323
return nil
319324
}
320325

326+
func (cache *includeCache) String() string {
327+
res := "[\n"
328+
for _, entry := range cache.entries {
329+
res = res + " " + entry.String() + "\n"
330+
}
331+
return res + "]"
332+
}
333+
321334
func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile *SourceFile) error {
322335
sourcePath := sourceFile.SourcePath()
323336
targetFilePath := paths.NullPath()

0 commit comments

Comments
 (0)