Skip to content

Commit 0479b6a

Browse files
committed
Added includeCache.String() and includeCacheItem.String()
1 parent 63cfef4 commit 0479b6a

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
@@ -202,8 +202,13 @@ type includeCacheEntry struct {
202202
}
203203

204204
func (entry *includeCacheEntry) String() string {
205-
return fmt.Sprintf("SourceFile: %s; Include: %s; IncludePath: %s",
206-
entry.Sourcefile, entry.Include, entry.Includepath)
205+
if entry.Sourcefile == nil {
206+
return fmt.Sprintf("Include path added: %s", entry.Includepath)
207+
}
208+
if entry.Include == "" {
209+
return fmt.Sprintf("%s successfully compiled", entry.Sourcefile)
210+
}
211+
return fmt.Sprintf("%s requires %s: include path added %s", entry.Sourcefile, entry.Include, entry.Includepath)
207212
}
208213

209214
func (entry *includeCacheEntry) Equals(other *includeCacheEntry) bool {
@@ -308,6 +313,14 @@ func (cache *includeCache) WriteToFile() error {
308313
return nil
309314
}
310315

316+
func (cache *includeCache) String() string {
317+
res := "[\n"
318+
for _, entry := range cache.entries {
319+
res = res + " " + entry.String() + "\n"
320+
}
321+
return res + "]"
322+
}
323+
311324
func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile *SourceFile) error {
312325
sourcePath := sourceFile.SourcePath()
313326
targetFilePath := paths.NullPath()

0 commit comments

Comments
 (0)