Game Development Reference
In-Depth Information
3.
A list may be large and contain many pages. We can choose a page by an index:
if ( PageIndex > -1 )
{
Result += std::string( "&page=" ) +
IntToStr( PageIndex + 1 );
}
return Result;
}
4.
And the other function is for Picasa:
std::string Picasa_GetListURL( const std::string& BaseURL,
int MaxResults,
int PageIndex,
const std::string& SearchQuery )
{
std::string Result = BaseURL;
Result += std::string( "kind=photo&imgmax=1600" );
if ( !SearchQuery.empty() )
{
Result += std::string( "&q=\"" ) +
SearchQuery + std::string( "\"" );
}
Result += std::string( "&max-results=" );
Result += IntToStr( MaxResults );
if ( PageIndex > 0 )
{
Result += std::string( "&start-index=" ) +
IntToStr( ( int )( 1 + PageIndex * MaxResults ) );
}
return Result;
}
5.
Depending on the list we want, we pass either the FlickrFavoritesURL
or FlickrRecentURL constants as the BaseURL parameter of the
Flickr_GetListURL() function and either the PicasaFavoritesURL or
PicasaRecentURL constants as the BaseURL parameter of the Picasa_
GetListURL() function.
 
Search WWH ::




Custom Search