static void Assign() { { FgString s; s = "12345"; FGASSERT(s.length() == 5); } { FgString s; s = L"12345"; FGASSERT(s.length() == 5); } { FgString s; s = L"12345"; FgString s1; s1 = s; FGASSERT(s1.length() == 5); } }
static void Construct() { { FgString s; FGASSERT(s.length() == 0); } { FgString s("12345"); FGASSERT(s.length() == 5);} { FgString s(L"12345"); FGASSERT(s.length() == 5); } { FgString s1("12345"); FgString s2(s1); FGASSERT(s1.length() == s2.length() && s1.length() == 5); } }
void fgSaveImgAnyFormat( const FgString & fname, const FgImgRgbaUb & img) { FGASSERT(fname.length() > 0); fgEnsureMagick(); FgScopePtr<ImageInfo> image_info(CloneImageInfo(0),DestroyImageInfo); FgScopePtr<ExceptionInfo> exception(AcquireExceptionInfo(),DestroyExceptionInfo); FgScopePtr<Image> image(ConstituteImage(img.width(),img.height(),"RGBA", CharPixel, img.dataPtr(), exception.get()), DestroyImage); (void) strcpy(image_info->filename,fname.as_utf8_string().c_str()); FGASSERT( MagickTrue == WriteImages(image_info.get(),image.get(),fname.as_utf8_string().c_str(),exception.get())); }