Now you can download a copy of these docs so you can use them offline! Download now
StringEntry.cpp
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2011. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #include "NetworkTables/StringEntry.h" 00008 #include "NetworkTables/Buffer.h" 00009 00010 namespace NetworkTables 00011 { 00012 00013 StringEntry::StringEntry(const char *str) 00014 { 00015 m_value = str; 00016 } 00017 00018 NetworkTables_Types StringEntry::GetType() 00019 { 00020 return kNetworkTables_Types_STRING; 00021 } 00022 00023 void StringEntry::Encode(Buffer *buffer) 00024 { 00025 Entry::Encode(buffer); 00026 buffer->WriteByte(kNetworkTables_STRING); 00027 buffer->WriteString(m_value.c_str()); 00028 } 00029 00030 int StringEntry::GetString(char *str, int len) 00031 { 00032 return (int)m_value.copy(str, len); 00033 } 00034 00035 std::string StringEntry::GetString() 00036 { 00037 return m_value; 00038 } 00039 00040 } // namespace
Generated on Thu Jan 12 2012 22:35:24 for WPILibC++ by
1.7.1