00001 // Filename: parameterRemapBasicStringRefToString.cxx 00002 // Created by: drose (09Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include "parameterRemapBasicStringRefToString.h" 00020 00021 //////////////////////////////////////////////////////////////////// 00022 // Function: ParameterRemapBasicStringRefToString::Constructor 00023 // Access: Public 00024 // Description: 00025 //////////////////////////////////////////////////////////////////// 00026 ParameterRemapBasicStringRefToString:: 00027 ParameterRemapBasicStringRefToString(CPPType *orig_type) : 00028 ParameterRemapToString(orig_type) 00029 { 00030 } 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Function: ParameterRemapBasicStringRefToString::pass_parameter 00034 // Access: Public, Virtual 00035 // Description: Outputs an expression that converts the indicated 00036 // variable from the original type to the new type, for 00037 // passing into the actual C++ function. 00038 //////////////////////////////////////////////////////////////////// 00039 void ParameterRemapBasicStringRefToString:: 00040 pass_parameter(ostream &out, const string &variable_name) { 00041 out << variable_name; 00042 } 00043 00044 //////////////////////////////////////////////////////////////////// 00045 // Function: ParameterRemapBasicStringRefToString::get_return_expr 00046 // Access: Public, Virtual 00047 // Description: Returns an expression that evalutes to the 00048 // appropriate value type for returning from the 00049 // function, given an expression of the original type. 00050 //////////////////////////////////////////////////////////////////// 00051 string ParameterRemapBasicStringRefToString:: 00052 get_return_expr(const string &expression) { 00053 return "(" + expression + ").c_str()"; 00054 }