/* XBN Java: Generically useful, non-GUI Java code. http://sourceforge.net/projects/xbnjava Copyright (C) 1997-2003, Jeff Epstein All rights reserved. Modifications: No Redistribution in binary form, with or without modifications, are permitted provided that the following conditions are met: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * If modifications are made to source code then this license should indicate that fact in the "Modifications" section above. * Neither the author, nor the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [NOTE: This license contains NO advertising clause.] */ package xbn.config; import xbn.XBNObject; import xbn.string.escape.USCIgnore; /**

Configuration related to unescaping configuration variable names and values. Provided to ConfigReader via CRConfig.

Source code:  CRCVUnescape.java

@version 0.9b @author Jeff Epstein, http://sourceforge.net/projects/xbnjava. **/ public class CRCVUnescape extends XBNObject { private USCIgnore usci = null; private char cEscape = ' '; /**

Create a CRCVUnescape with default values.

Equal to CRCVUnescape('\\\\')

**/ public CRCVUnescape() { this('\\'); } /**

Create a CRCVUnescape.

Equal to CRCVUnescape(usc_ignore, '\\\\')

**/ public CRCVUnescape(USCIgnore usc_ignore) { this(usc_ignore, '\\'); } /**

Create a CRCVUnescape.

Equal to CRCVUnescape((new USCIgnore()), '\\\\')

**/ public CRCVUnescape(char c_escape) { this((new USCIgnore()), c_escape); } /**

Create a CRCVUnescape.

The restrictions on these parameters are verified in the CRConfig constructor and CRLAObjects constructor.

@param usc_ignore Defines how to deal with escaped characters other than.... May not be null and no character in usc_ignore.getAPCIgnore() may equal to any in CRCVDelimiters, CRCVTrim, or c_escape. See getUSCIgnore. @param c_escape The escape character. May not equal any character in usc_ignore getAPCIgnore, nor any characters in crc_variable or crc_comment. **/ public CRCVUnescape(USCIgnore usc_ignore, char c_escape) { throwAXIfNull(usc_ignore, "usc_ignore", sCNSTR); usci = usc_ignore; cEscape = c_escape; } /**

Get the USCIgnore for direct manipulation.

@return usc_ignore Exactly as provided to the constructor. **/ public final USCIgnore getUSCIgnore() { return usci; } /**

What is the character used to escape other characters?

When this procedes another character, it is said to be "escaped". The escape character is traditionally the 'up-left' slash ('\\').

@return c_escape Exactly as provided to the constructor. **/ public final char getEscapeChar() { return cEscape; } /**

Get some information about this CRCVUnescape.

**/ public String toString() { return this.getClass().getName() + ": [" + getUSCIgnore().toString() + "], getEscapeChar()='" + getEscapeChar() + "'"; } }