Classes can be separated into several independent parts. The static class diagram is presented below:
The class can use files from JARs or Web-sites addressed by URLs but it can not flush them of cause.
Example of usage:
CIniFile iniFile = new CIniFile("test.ini"); boolean p1 = iniFile.readBool("Section 1", "P1", false); System.out.println("P1 = " + p1); iniFile.writeBool("Section 1", "P1", !p1); System.out.println("Section 2, Parameter 1 = " + iniFile.readString("Other X", "Param1", "")); System.out.println("Section 2, Parameter 2 = " + iniFile.readInteger("Section 2", "P2", 123)); System.out.println("Section 2, Parameter 3 = " + iniFile.readDateTime("Section 2", "P3", new Date())); iniFile.writeString("Section 2", "P1", "..\"xxx\"..."); iniFile.writeDateTime("Section 2", "P3", new Date()); iniFile.flush();
System.out.println("The match result (1): " + CRegExp.isMatch("BLA", "BLA")); System.out.println("The match result (2): " + CRegExp.isMatch("A*", "ABBA")); System.out.println("The match result (3): " + CRegExp.isMatch("[A-Z,_]*[A-Z,0-9,_]*0?7*", "AGENT_007"));
Different languages are supported by descendant classes such as C++, Pascal, Java, XML or others. Lexical scanners supports several types of lexems:
Example of simple scanner usage:
System.out.println("*********** Scanner Test *************"); CScanner scanner = new CScanner(); scanner.setBuffer("while(1.0e2*i := \t\r\n> \"string\'\'\")\n" + "// comment\n/.*second\ncomment*./{xxx}"); scanner.setShowEol(true); scanner.setShowSpace(true); // Testing string convertions String str = "The test \"string\""; System.out.println("Start string: " + str); str = scanner.wrapString(str); System.out.println("Wrapped string: " + str); str = scanner.unwrapString(str); System.out.println("Unwrapped string: " + str); System.out.println(); System.out.println("Initial string: " + scanner.getBuffer()); while (scanner.lex() != EOF) { switch (scanner.getTokenType()) { case UNKNOWN: System.out.print("Type: Unknown "); break; case COMMENT: System.out.print("Type: Comment "); break; case KEYWORD: System.out.print("Type: Keyword "); break; case TYPE: System.out.print("Type: Type "); break; case IDENT: System.out.print("Type: Ident "); break; ... } System.out.println("Value: '" + scanner.getToken() + "' Pos: " + scanner.getPosition() + " Line: " + scanner.getLineNo()); }The result of this program could be the next:
*********** Scanner Test ************* Start string: The test "string" Wrapped string: "The test "string"" Unwrapped string: The test "string" Initial string: while(1.0e2*i := > "string''") // comment /.second comment./{xxx} Type: Ident Value: 'while' Pos: 0 Line: 0 Type: Brace Value: '(' Pos: 5 Line: 0 Type: Float Value: '1.0e2' Pos: 6 Line: 0 Type: Operator Value: '*' Pos: 11 Line: 0 Type: Ident Value: 'i' Pos: 12 Line: 0 ...