Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

mstring.h File Reference


#include <string.h>
#include <stdlib.h>
#include "magic/mtypes.h"
#include "magic/mobject.h"
#include "magic/mmagisupp.h"
#include "magic/mi18n.h"

Go to the source code of this file.


namespace  MagiC


class  String
 Generic string and buffer class. More...

class  SubString


#define STRING_GETCHAR(n)   return mData[n];


bool isempty (const String &str)
char * safedup (const char *orig, int maxlen=-1)

Detailed Description

Definition in file mstring.h.

Define Documentation


Length of the default initial buffer used in strformat and vstrformat.

Definition at line 235 of file mstring.h.

#define STRING_GETCHAR      return mData[n];

Causes the String class NOT to check bounds anywhere.

Checking makes world very safe, recommended. Can be a heavy bottleneck in some cases.

Definition at line 75 of file mstring.h.

Function Documentation


This file is part of the MagiC++ library.

* * Copyright (C) 1998-2004 Marko Grönroos <> * *

* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, Inc., 59 Temple Place *

  • Suite 330, Boston, MA 02111-1307, USA. * *

bool isempty const String   str [inline]

true if the string is empty or null.

Definition at line 221 of file mstring.h.

References String::isEmpty().

char* safedup const char *    orig,
int    maxlen

Duplicates a null-terminated C-style string.

Safer version of strdup - checks if the string is NULL.

Also, uses new to allocate the string.

Pointer to the newly allocated copy.

Definition at line 1221 of file

Generated on Thu Feb 10 20:06:43 2005 for LibMagiC by doxygen1.2.18