diff options
| author | Paul Buetow <paul@buetow.org> | 2010-11-21 17:01:59 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2010-11-21 17:01:59 +0000 |
| commit | b891420946d5269cc326d67555c6aab3db41a01a (patch) | |
| tree | f6c5e7d6dbf18ec8c0ea9ec0b037251df46b4cbb /yhttpd/src/name.cpp | |
| parent | a537e8323d932125232c305f9573daef89aef0df (diff) | |
added yhttpd and ycurses trunk versions
Diffstat (limited to 'yhttpd/src/name.cpp')
| -rw-r--r-- | yhttpd/src/name.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/yhttpd/src/name.cpp b/yhttpd/src/name.cpp new file mode 100644 index 0000000..79167f5 --- /dev/null +++ b/yhttpd/src/name.cpp @@ -0,0 +1,49 @@ +#ifndef NAME_CPP +#define NAME_CPP + +#include "name.h" +#include "tool/tool.h" + +using namespace std; + +name::name() +{ + pthread_mutex_init( &mut_s_name, NULL); +} + +name::name( string s_name ) +{ + pthread_mutex_init( &mut_s_name, NULL); + set_name( s_name ); +} + +name::~name() +{ + pthread_mutex_destroy( &mut_s_name ); +} + +string +name::get_name() +{ + string s_ret; + pthread_mutex_lock ( &mut_s_name ); + s_ret = s_name; + pthread_mutex_unlock( &mut_s_name ); + return s_ret; +} + +string +name::get_lowercase_name() +{ + return tool::to_lower( get_name() ); +} + +void +name::set_name( string s_name ) +{ + pthread_mutex_lock ( &mut_s_name ); + this->s_name = s_name; + pthread_mutex_unlock( &mut_s_name ); +} + +#endif |
