예제 #1
0
        public virtual void FlushLine(Out fout, int indent)
        {
            int i;

            if (linelen > 0)
            {
                if (indent + linelen >= _options.WrapLen)
                {
                    WrapLine(fout, indent);
                }

                if (!inAttVal || _options.IndentAttributes)
                {
                    for (i = 0; i < indent; ++i)
                    {
                        fout.Outc((int) ' ');
                    }
                }

                for (i = 0; i < linelen; ++i)
                {
                    fout.Outc(linebuf[i]);
                }
            }

            fout.Newline();
            linelen = 0;
            wraphere = 0;
            inAttVal = false;
        }
예제 #2
0
        private void WrapLine(Out fout, int indent)
        {
            int i, p, q;

            if (wraphere == 0)
            {
                return;
            }

            for (i = 0; i < indent; ++i)
            {
                fout.Outc((int) ' ');
            }

            for (i = 0; i < wraphere; ++i)
            {
                fout.Outc(linebuf[i]);
            }

            if (InString)
            {
                fout.Outc((int) ' ');
                fout.Outc((int) '\\');
            }

            fout.Newline();

            if (linelen > wraphere)
            {
                p = 0;

                if (linebuf[wraphere] == ' ')
                {
                    ++wraphere;
                }

                q = wraphere;
                AddC('\x0000', linelen);

                while (true)
                {
                    linebuf[p] = linebuf[q];
                    if (linebuf[q] == 0)
                    {
                        break;
                    }
                    p++;
                    q++;
                }
                linelen -= wraphere;
            }
            else
            {
                linelen = 0;
            }

            wraphere = 0;
        }