Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions | Static Package Functions
tracesoup Class Reference

List of all members.

Static Public Member Functions

static void main (String[] args)

Static Package Functions

static void cook (String inputName)
static String quoteTags (String str)
 Simply replaces instances of '<' with "&LT;" and '>' with "&GT;".

Detailed Description

Definition at line 40 of file tracesoup.java.


Member Function Documentation

static void tracesoup.cook ( String  inputName) [inline, static, package]

Definition at line 61 of file tracesoup.java.

                                          {
              String outputName = inputName + ".html";

              try {
                     PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputName))));
                     writer.println("<TITLE>" + outputName + "</TITLE>");
                     writer.println("<PRE>");
                     
                     Hashtable fileTables = new Hashtable();
                     BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(inputName)));
                     String line = reader.readLine();
                     while (line != null) {
                            if (line.length() > 0) {
                                   // have to quote '<' & '>' characters.
                                   if (line.charAt(0) == '<')
                                          line = quoteTags(line);
                                   // lines containing square brackets need to be wrapped with <A HREF="..."></A>.
                                   int leftBracket = line.indexOf('[');
                                   if (leftBracket >= 0)
                                          line = FileLocator.getFileLocation(line);
                            }
                            writer.println(line);
                            line = reader.readLine();
                     }
                     reader.close();
                     
                     writer.println("</PRE>");
                     writer.close();
              } catch (Exception e) {
                     e.printStackTrace(System.err);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

static void tracesoup.main ( String[]  args) [inline, static]

Definition at line 41 of file tracesoup.java.

                                              {
              if (args.length == 0) {
                     System.out.println("usage:  tracesoup [-blame] trace");
                     System.exit(1);
              }
              
              for (int i = 0; i < args.length; i++) {
                     String arg = args[i];
                     if (arg.charAt(0) == '-') {
                            if (arg.equals("-blame"))
                                   FileLocator.USE_BLAME = true;
                     } else {
                            cook(arg);
                     }
              }
              
              // quit the application.
              System.exit(0);
       }

Here is the call graph for this function:

static String tracesoup.quoteTags ( String  str) [inline, static, package]

Simply replaces instances of '<' with "&LT;" and '>' with "&GT;".

Definition at line 97 of file tracesoup.java.

                                           {
              int length = str.length();
              StringBuffer buf = new StringBuffer(length);
              for (int i = 0; i < length; ++i) {
                     char ch = str.charAt(i);
                     switch (ch) {
                     case '<':
                            buf.append("&LT;");
                            break;
                     case '>':
                            buf.append("&GT;");
                            break;
                     default:
                            buf.append(ch);
                            break;
                     }
              }
              return buf.toString();
       }

Here is the caller graph for this function:


The documentation for this class was generated from the following file: