/// <summary> /// Loads one or more CSV format trade files. /// <para> /// CSV files sometimes contain a Unicode Byte Order Mark. /// This method uses <seealso cref="UnicodeBom"/> to interpret it. /// /// </para> /// </summary> /// <param name="resources"> the CSV resources </param> /// <returns> the loaded trades, all errors are captured in the result </returns> public ValueWithFailures <IList <Trade> > load(ICollection <ResourceLocator> resources) { ICollection <CharSource> charSources = resources.Select(r => UnicodeBom.toCharSource(r.ByteSource)).ToList(); return(parse(charSources)); }
//------------------------------------------------------------------------- /// <summary> /// Loads one or more CSV format sensitivities files. /// <para> /// In most cases each file contains one sensitivity instance, however the file format is capable /// of representing any number. /// </para> /// <para> /// Within a single file and identifier, the same combination of type, reference and tenor must not be repeated. /// No checks are performed between different input files. /// It may be useful to merge the sensitivities in the resulting list in a separate step after parsing. /// </para> /// <para> /// CSV files sometimes contain a Unicode Byte Order Mark. /// This method uses <seealso cref="UnicodeBom"/> to interpret it. /// /// </para> /// </summary> /// <param name="resources"> the CSV resources </param> /// <returns> the sensitivities keyed by identifier, parsing errors are captured in the result </returns> public ValueWithFailures <ListMultimap <string, CurveSensitivities> > load(ICollection <ResourceLocator> resources) { ICollection <CharSource> charSources = resources.Select(r => UnicodeBom.toCharSource(r.ByteSource)).ToList(); return(parse(charSources)); }