2011-03-24 10:38:08 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2010 cocos2d-x.org
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __PLATFOMR_CCNS_H__
|
|
|
|
#define __PLATFOMR_CCNS_H__
|
|
|
|
|
|
|
|
#include "CCGeometry.h"
|
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_BEGIN
|
2012-06-20 18:09:11 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @addtogroup data_structures
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
/**
|
|
|
|
@brief Returns a Core Graphics rectangle structure corresponding to the data in a given string.
|
|
|
|
@param pszContent A string object whose contents are of the form "{{x,y},{w, h}}",
|
|
|
|
where x is the x coordinate, y is the y coordinate, w is the width, and h is the height.
|
|
|
|
These components can represent integer or float values.
|
|
|
|
An example of a valid string is "{{3,2},{4,5}}".
|
|
|
|
The string is not localized, so items are always separated with a comma.
|
|
|
|
@return A Core Graphics structure that represents a rectangle.
|
2013-06-20 14:13:12 +08:00
|
|
|
If the string is not well-formed, the function returns RectZero.
|
2012-04-18 18:43:45 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
Rect CC_DLL RectFromString(const char* pszContent);
|
2011-03-24 10:38:08 +08:00
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
/**
|
|
|
|
@brief Returns a Core Graphics point structure corresponding to the data in a given string.
|
|
|
|
@param pszContent A string object whose contents are of the form "{x,y}",
|
|
|
|
where x is the x coordinate and y is the y coordinate.
|
|
|
|
The x and y values can represent integer or float values.
|
|
|
|
An example of a valid string is "{3.0,2.5}".
|
|
|
|
The string is not localized, so items are always separated with a comma.
|
|
|
|
@return A Core Graphics structure that represents a point.
|
2013-06-20 14:13:12 +08:00
|
|
|
If the string is not well-formed, the function returns PointZero.
|
2012-04-18 18:43:45 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
Point CC_DLL PointFromString(const char* pszContent);
|
2011-03-24 10:38:08 +08:00
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
/**
|
|
|
|
@brief Returns a Core Graphics size structure corresponding to the data in a given string.
|
|
|
|
@param pszContent A string object whose contents are of the form "{w, h}",
|
|
|
|
where w is the width and h is the height.
|
|
|
|
The w and h values can be integer or float values.
|
|
|
|
An example of a valid string is "{3.0,2.5}".
|
|
|
|
The string is not localized, so items are always separated with a comma.
|
|
|
|
@return A Core Graphics structure that represents a size.
|
2013-06-20 14:13:12 +08:00
|
|
|
If the string is not well-formed, the function returns SizeZero.
|
2012-04-18 18:43:45 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
Size CC_DLL SizeFromString(const char* pszContent);
|
2012-04-18 18:43:45 +08:00
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
// end of data_structure group
|
|
|
|
/// @}
|
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_END
|
2011-03-24 10:38:08 +08:00
|
|
|
|
|
|
|
#endif // __PLATFOMR_CCNS_H__
|
|
|
|
|
|
|
|
|