Skip to content

Commit 79fda79

Browse files
committed
Added includeCache.String() and includeCacheItem.String()
1 parent fd754db commit 79fda79

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

legacy/builder/container_find_includes.go

+15-2
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,13 @@ type includeCacheEntry struct {
201201
}
202202

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

208213
func (entry *includeCacheEntry) Equals(other *includeCacheEntry) bool {
@@ -307,6 +312,14 @@ func (cache *includeCache) WriteToFile() error {
307312
return nil
308313
}
309314

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

0 commit comments

Comments
 (0)