/*===========================================================================
 *
 * File:	DL_Chr.H
 * Author:	Dave Humphrey (uesp@m0use.net)
 * Created On:	Sunday, May 06, 2001
 *
 * Contains definitions for character related functions of Dave's Library
 * of common code.
 *
 *=========================================================================*/
#ifndef __DL_CHR_H
#define __DL_CHR_H

/*===========================================================================
 *
 * Begin Required Include Files
 *
 *=========================================================================*/
  #include "dl_base.h"
  #include "dl_mem.h"
  #include "dl_err.h"
  #include "dl_log.h"
  #include <string.h>
/*===========================================================================
 *		End of Required Include Files
 *=========================================================================*/


/*===========================================================================
 *
 * Begin Function Prototypes
 *
 *=========================================================================*/

	/* Insert a character somewhere in a string */
  void chradd (char* pString, const size_t CharIndex, const char NewChar);

	/* Add a character to the end of a string */
  void chrcat (char* pString, const char NewChar);

	/* Delete a character from a string */
  void chrdel (char* pString, const size_t CharIndex);

	/* Delete the last character from the string */
  void chrdellast (char* pString);

	/* Reverse search for last punctuation character in string */
  boolean chrrpunc (size_t& CharIndex, const char* pString);

	/* Divide string into substrings seperated by token character */
  char* chrtok (char* pString, const char TokenChar);

	/* Truncate a string at first/last occurence of character */
  char* chrtrunc  (char* pString, const char TruncateChar);
  char* chrrtrunc (char* pString, const char TruncateChar);

/*===========================================================================
 *		End of Function Prototypes
 *=========================================================================*/


/*===========================================================================
 *
 * Begin Testing Routine Prototypes
 *
 * Prototypes for test functions of module.  Only available in DEBUG builds.
 *
 *=========================================================================*/
#if defined(_DEBUG)
  void Test_chradd (void);
  void Test_chrcat (void);
  void Test_chrdel (void);
  void Test_chrdellast (void);
  void Test_chrtok (void);
  void Test_chrrpunc (void);
  void Test_chrtrunc (void);
  void Test_chrrtrunc (void);
  void Test_DLChr (void);
#endif
/*===========================================================================
 *		End of Testing Routine Prototypes
 *=========================================================================*/

#endif
/*===========================================================================
 *		End of File DL_Chr.H
 *=========================================================================*/