NAMD
Public Member Functions | Public Attributes | List of all members
StringList Class Reference

#include <ConfigList.h>

Public Member Functions

 StringList (char *newdata)
 
void set (const char *newdata)
 
 ~StringList (void)
 

Public Attributes

char * data
 
StringListnext
 

Detailed Description

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 46 of file ConfigList.h.

Constructor & Destructor Documentation

◆ StringList()

StringList::StringList ( char *  newdata)
inline

Definition at line 50 of file ConfigList.h.

References data, NAMD_die(), and next.

50  { // take a string, and copy it
51  data = new char[strlen(newdata)+1];
52  if ( data == NULL )
53  {
54  NAMD_die("new failed in struct StringList");
55  }
56  strcpy( data, newdata);
57  next = NULL;
58  }
void NAMD_die(const char *err_msg)
Definition: common.C:147
StringList * next
Definition: ConfigList.h:49
char * data
Definition: ConfigList.h:48

◆ ~StringList()

StringList::~StringList ( void  )
inline

Definition at line 68 of file ConfigList.h.

References data, and next.

68  { // just clear out my info
69  delete [] data;
70  data = NULL;
71  next = NULL;
72  }
StringList * next
Definition: ConfigList.h:49
char * data
Definition: ConfigList.h:48

Member Function Documentation

◆ set()

void StringList::set ( const char *  newdata)
inline

Definition at line 59 of file ConfigList.h.

References data, and NAMD_die().

59  { // take a string, and copy it
60  delete [] data;
61  data = new char[strlen(newdata)+1];
62  if ( data == NULL )
63  {
64  NAMD_die("new failed in struct StringList");
65  }
66  strcpy( data, newdata);
67  }
void NAMD_die(const char *err_msg)
Definition: common.C:147
char * data
Definition: ConfigList.h:48

Member Data Documentation

◆ data

char* StringList::data

◆ next

StringList* StringList::next

The documentation for this class was generated from the following file: