--- parser3/src/include/pa_string.h 2002/08/01 11:41:16 1.141 +++ parser3/src/include/pa_string.h 2003/01/21 15:51:11 1.144 @@ -1,14 +1,14 @@ /** @file Parser: string class decl. - Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_STRING_H #define PA_STRING_H -static const char* IDENT_STRING_H="$Date: 2002/08/01 11:41:16 $"; +static const char* IDENT_STRING_H="$Date: 2003/01/21 15:51:11 $"; #include "pa_pool.h" #include "pa_types.h" @@ -178,8 +178,10 @@ public: /// simple hash code of string. used by Hash uint hash_code() const; - /// extracts first char of a string - char first_char() const; + /// extracts first char of a string, if any + char first_char() const { + return is_empty()?0:*head.chunk.rows[0].item.ptr; + } /// extracts [start, finish) piece of string String& mid(size_t start, size_t finish) const;