예제 #1
0
파일: PrintOps.cs 프로젝트: TerabyteX/main
 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);
 }
예제 #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);
 }
예제 #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 });
 }
예제 #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();
 }
예제 #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);
 }
예제 #6
0
 internal StringFormatter(StringFormatterSiteStorage/*!*/ siteStorage, string/*!*/ format, IList/*!*/ data)
     : this(siteStorage.Context, format, data) {
     Assert.NotNull(siteStorage);
     _siteStorage = siteStorage;
 }
예제 #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();
        }
예제 #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)
            );
        }
예제 #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);
        }
예제 #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);
 }
예제 #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();
 }
예제 #12
0
 internal StringFormatter(StringFormatterSiteStorage /*!*/ siteStorage, string /*!*/ format, RubyEncoding /*!*/ encoding, IList /*!*/ data)
     : this(siteStorage.Context, format, encoding, data)
 {
     Assert.NotNull(siteStorage);
     _siteStorage = siteStorage;
 }
예제 #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 }));
 }
예제 #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());
        }