Compare commits
No commits in common. "main" and "1.0.2" have entirely different histories.
@ -32,19 +32,3 @@ func CollectionFromString(content string) (*NML, error) {
|
|||||||
|
|
||||||
return &collection, nil
|
return &collection, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SaveCollectionToFile(collection *NML, filePath string) error {
|
|
||||||
// Marshal the Collection struct into XML content
|
|
||||||
content, err := xml.MarshalIndent(collection, "", " ")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write the XML content to the file
|
|
||||||
err = os.WriteFile(filePath, content, 0644)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
@ -57,19 +57,3 @@ func IsHistoryFile(path string) bool {
|
|||||||
func IsHistoryString(content string) bool {
|
func IsHistoryString(content string) bool {
|
||||||
return strings.Contains(content, "HistoryData")
|
return strings.Contains(content, "HistoryData")
|
||||||
}
|
}
|
||||||
|
|
||||||
func SaveHistoryToFile(history *NML, filePath string) error {
|
|
||||||
// Marshal the NML struct into XML content
|
|
||||||
content, err := xml.MarshalIndent(history, "", " ")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write the XML content to the file
|
|
||||||
err = os.WriteFile(filePath, content, 0644)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user