Example #1
0
 public static void PrintFormatted(
     StringFormatterSiteStorage/*!*/ storage,
     ConversionStorage<MutableString>/*!*/ stringCast,
     BinaryOpStorage/*!*/ writeStorage,
     object/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ format, params object[]/*!*/ args)
 {
     KernelOps.PrintFormatted(storage, stringCast, writeStorage, null, self, format, args);
 }
Example #2
0
 public static void PrintFormatted(
     StringFormatterSiteStorage /*!*/ storage,
     ConversionStorage <MutableString> /*!*/ stringCast,
     BinaryOpStorage /*!*/ writeStorage,
     object /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ format, params object[] /*!*/ args)
 {
     KernelOps.PrintFormatted(storage, stringCast, writeStorage, null, self, format, args);
 }
Example #3
0
 public static string/*!*/ Format(StringFormatterSiteStorage/*!*/ storage, ConversionStorage<IList>/*!*/ arrayTryCast,
     string/*!*/ self, object args) {
     return Format(storage, self, Protocols.TryCastToArray(arrayTryCast, args) ?? new[] { args });
 }
Example #4
0
 public static string/*!*/ Format(StringFormatterSiteStorage/*!*/ storage, string/*!*/ self, [NotNull]IList/*!*/ args) {
     StringFormatter formatter = new StringFormatter(storage, self, RubyEncoding.UTF8, args);
     return formatter.Format().ToString();
 }
Example #5
0
 public static MutableString/*!*/ Format(StringFormatterSiteStorage/*!*/ storage, MutableString/*!*/ self, object arg) {
     IList args = arg as IList ?? new object[] { arg };
     StringFormatter formatter = new StringFormatter(storage, self.ConvertToString(), self.Encoding, args);
     return formatter.Format().TaintBy(self);
 }
Example #6
0
 internal StringFormatter(StringFormatterSiteStorage/*!*/ siteStorage, string/*!*/ format, IList/*!*/ data)
     : this(siteStorage.Context, format, data) {
     Assert.NotNull(siteStorage);
     _siteStorage = siteStorage;
 }
Example #7
0
        public static MutableString/*!*/ Sprintf(StringFormatterSiteStorage/*!*/ storage, 
            object self, [DefaultProtocol, NotNull]MutableString/*!*/ format, [NotNull]params object[] args) {

            return new StringFormatter(storage, format.ConvertToString(), args).Format();
        }
Example #8
0
        public static void PrintFormatted(
            StringFormatterSiteStorage/*!*/ storage, 
            ConversionStorage<MutableString>/*!*/ stringCast, 
            BinaryOpStorage/*!*/ writeStorage,
            object self, object io, [NotNull]object/*!*/ format, [NotNull]params object[]/*!*/ args) {

            Debug.Assert(!(io is MutableString));
            
            // TODO: BindAsObject attribute on format?
            // format cannot be strongly typed to MutableString due to ambiguity between signatures (MS, object) vs (object, MS)
            Protocols.Write(writeStorage, io, 
                Sprintf(storage, self, Protocols.CastToString(stringCast, format), args)
            );
        }
Example #9
0
        public static void PrintFormatted(
            StringFormatterSiteStorage/*!*/ storage,
            ConversionStorage<MutableString>/*!*/ stringCast, 
            BinaryOpStorage/*!*/ writeStorage,
            object self, [NotNull]MutableString/*!*/ format, [NotNull]params object[]/*!*/ args) {

            PrintFormatted(storage, stringCast, writeStorage, self, storage.Context.StandardOutput, format, args);
        }
Example #10
0
 public static MutableString/*!*/ Format(StringFormatterSiteStorage/*!*/ storage, MutableString/*!*/ self, [NotNull]IList/*!*/ args) {
     StringFormatter formatter = new StringFormatter(storage, self.ConvertToString(), self.Encoding, args);
     return formatter.Format().TaintBy(self);
 }
Example #11
0
 public static string/*!*/ Format(StringFormatterSiteStorage/*!*/ storage, string/*!*/ self, object arg) {
     IList args = arg as IList ?? new object[] { arg };
     StringFormatter formatter = new StringFormatter(storage, self, args);
     return formatter.Format().ToString();
 }
Example #12
0
 internal StringFormatter(StringFormatterSiteStorage /*!*/ siteStorage, string /*!*/ format, RubyEncoding /*!*/ encoding, IList /*!*/ data)
     : this(siteStorage.Context, format, encoding, data)
 {
     Assert.NotNull(siteStorage);
     _siteStorage = siteStorage;
 }
Example #13
0
 public static string /*!*/ Format(StringFormatterSiteStorage /*!*/ storage, ConversionStorage <IList> /*!*/ arrayTryCast,
                                   string /*!*/ self, object args)
 {
     return(Format(storage, self, Protocols.TryCastToArray(arrayTryCast, args) ?? new[] { args }));
 }
Example #14
0
        public static string /*!*/ Format(StringFormatterSiteStorage /*!*/ storage, string /*!*/ self, [NotNull] IList /*!*/ args)
        {
            StringFormatter formatter = new StringFormatter(storage, self, RubyEncoding.UTF8, args);

            return(formatter.Format().ToString());
        }