Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Tools/StringFunctions.cpp

Go to the documentation of this file.
00001 /**
00002 * @file StringFunctions.cpp
00003 *
00004 * Implementation of common string functions
00005 *
00006 * @author Uwe Düffert
00007 */
00008 
00009 #include "StringFunctions.h"
00010 #include <string.h>
00011 
00012 void getXmlString(char* dstXml, const char* src)
00013 {
00014 /** @todo Header/Xabsl interpretation differences:
00015 * tail-mode.TAIL-center/left/right-*
00016 * top.left/right-ONLY
00017 * *-paw-kick-forward vs. paw-kick-with-*-forward
00018 * start-me-UP
00019 * HEAD-CONTROL-MODE.*
00020   */
00021   unsigned int i=0;
00022   unsigned int j=0;
00023   char lastChar='A';
00024   int charsSinceLastMinus=0;
00025   while (i<strlen(src))
00026   {
00027     if (((lastChar<'A')||(lastChar>'Z'))&&(src[i]>='A')&&(src[i]<='Z'))
00028     {
00029       lastChar=src[i]|0x20; 
00030       if (charsSinceLastMinus > 1)
00031       {
00032         dstXml[j++]='-';
00033         charsSinceLastMinus=0;
00034       }
00035       dstXml[j++]=src[i++]|0x20;
00036       dstXml[j]=0;
00037       charsSinceLastMinus++;
00038     }
00039     else
00040     {
00041       lastChar=src[i];
00042       dstXml[j++]=src[i++];
00043       dstXml[j]=0;
00044       charsSinceLastMinus++;
00045     }
00046   }
00047 }
00048 
00049 /*
00050 * Change log :
00051 * 
00052 * $Log: StringFunctions.cpp,v $
00053 * Revision 1.1.1.1  2004/05/22 17:35:55  cvsadm
00054 * created new repository GT2004_WM
00055 *
00056 * Revision 1.2  2004/02/25 15:28:03  jhoffman
00057 * kick renamed
00058 *
00059 * Revision 1.1  2003/10/07 10:13:21  cvsadm
00060 * Created GT2004 (M.J.)
00061 *
00062 * Revision 1.1.1.1  2003/07/02 09:40:28  cvsadm
00063 * created new repository for the competitions in Padova from the 
00064 * tamara CVS (Tuesday 2:00 pm)
00065 *
00066 * removed unused solutions
00067 *
00068 * Revision 1.2  2003/05/11 23:56:15  dueffert
00069 * doxygen bugs fixed
00070 *
00071 * Revision 1.1  2003/05/06 16:02:54  loetzsch
00072 * added class RobotPoseSymbols
00073 *
00074 */

Generated on Thu Sep 23 19:57:41 2004 for GT2004 by doxygen 1.3.6