Formatierung ist das A und O

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Formatierung ist das A und O

    gefunden auf dem gEb

    Manchmal kommt es halt vor, daß man sich durch fremden Code wühlen muß. Übersichtliche Quellcodeformatierung hilft da oft schon weiter. Kommentare auch.

    Aber bitte was hat der Typ geraucht, der das hier verbrochen hat?!

    *argh*

    Code:
                       //\\
           /////////////  \\\\\\\\\\\\\
         //                            \\
       //                                \\
     //   this is where the world begins   \\
    //     where we dive  into a stream     \\
     //         of evil tags of XML        \\
    //     save poor bytes out of thee      \\
    ///=/=/=/=/=/=/=/=/=/\=\=\=\=\=\=\=\=\=\\\
                      XMLByte
                        *
         print_dom_document_to_bytestream
              (DOM_Document * doc) {
    // what seems so empty here is our hope \\
    // or should we say -- the saving rope? \\
             XMLByte * bstream = NULL;
    //   struggle deep - fearless as well   \\
    //  to get the bytes out of their hell  \\
    DOMByteFormatTarget  *        formatTarget
                         
                        new
                DOMByteFormatTarget
                        ();
            /////////////\\\\\\\\\\\\\
    /////////////////////\\\\\\\\\\\\\\\\\\\\\
    // the fight begins there's no way back \\
    //   try hard to get out of this hack   \\
    /////////////////////\\\\\\\\\\\\\\\\\\\\\
                       try {
        //  oh my god! - the evil hits! \\
      // can we beat it  with these bits? \\
                    gFormatter
                      =  new
                  XMLFormatter (
                  gEncodingName,
                  formatTarget ,
                   XMLFormatter
                        ::
                    NoEscapes,
                   gUnRepFlags)
                        ;
                     ////\\\\
    /////////////////////\\\\\\\\\\\\\\\\\\\\\
     // it seems we won! hipp hipp hurray! \\
     //  append a feed to things so stray  \\
                cout     << * doc;
             *gFormatter <<      chLF
                         ;
                cout     << flush;
                         }
       // so much blood!  so many bytes! \\
      // how to save them  when they die? \\
            catch (XMLException & e) {
      // free the chain around their neck \\
                delete gFormatter;
      // and make sure it can't come back \\
                  gFormatter = 0;
      // no man left! - they all did die! \\
      delete                   formatTarget;
      // but for the caller  we might try \\
     // tell him something here went wrong \\
      // he has to make it! go on strong! \\
    /////////////////////\\\\\\\\\\\\\\\\\\\\\
                  return (NULL);
                        }
     // success!  we're glad and also free \\
         delete gFormatter; gFormatter = 0;
      // we grab the byte out of the stream \\
                     bstream
                        
          formatTarget->get_byte_stream ();
        // we do not  need that anymore \\
    delete                       formatTarget;
     // we have it now it's here for sure! \\
    /////////////////////\\\\\\\\\\\\\\\\\\\\\
    return (          bstream             ); }
    /////////////////////\\\\\\\\\\\\\\\\\\\\\
    TBT

    Die zwei wichtigsten Regeln für eine berufliche Karriere:
    1. Verrate niemals alles was du weißt!


    PHP 2 AllPatrizier II Browsergame

  • #2
    das is cool...
    Beantworte nie Threads mit mehr als 15 followups...
    Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

    Kommentar


    • #3
      und wo bleibt der code...

      Kommentar

      Lädt...
      X