/// <summary> /// Writes this versification to the specified fileName. /// </summary> /// <param name="fileName">full path where versification file should be written</param> /// <exception cref="IOException">if the fileName cannot be written</exception> public void Save(string fileName) { StringBuilder builder = new StringBuilder(); using (StringWriter writer = new StringWriter(builder)) VersInfo.WriteToStream(writer); File.WriteAllText(fileName, builder.ToString()); }
/// <summary> /// Gets last chapter number in the given book. /// </summary> public int GetLastChapter(int bookNum) { return(VersInfo.LastChapter(bookNum)); }
/// <summary> /// Gets last book in this project /// </summary> public int GetLastBook() { return(VersInfo.LastBook()); }
/// <summary> /// Get the string description of the versification. /// </summary> public override string ToString() { return(VersInfo.ToString()); }
/// <summary> /// Change the passed VerseRef to be this versification. /// </summary> public void ChangeVersification(ref VerseRef vref) { VersInfo.ChangeVersification(ref vref); }
/// <summary> /// Change the versification of an entry with Verse like 1-3 or 1,3a. /// Can't really work in the most general case because the verse parts could become separate chapters. /// </summary> /// <returns>true if successful (i.e. all verses were in the same the same chapter in the new versification), /// false if the changing resulted in the reference spanning chapters (which makes the results undefined)</returns> public bool ChangeVersificationWithRanges(VerseRef vref, out VerseRef newRef) { return(VersInfo.ChangeVersificationWithRanges(vref, out newRef)); }
/// <summary> /// Gets a list of verse segments for the specified reference or null if the specified /// reference does not have segments defined in the versification. /// </summary> public string[] VerseSegments(int bbbcccvvv) { return(VersInfo.VerseSegments(bbbcccvvv)); }
/// <summary> /// Determines whether the specified verse is excluded in the versification. /// </summary> public bool IsExcluded(int bbbcccvvv) { return(VersInfo != null && VersInfo.IsExcluded(bbbcccvvv)); }
/// <summary> /// Gets last verse number in the given book/chapter. /// </summary> public int GetLastVerse(int bookNum, int chapterNum) { return(VersInfo.LastVerse(bookNum, chapterNum)); }