Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <cstdlib>
- using namespace std;
- int main(void) {
- cout << "This program is meant to append frames to GAP animations.\nThe developers seem to have thought of everything, but this." << endl;
- cout << "Please enter the name of the frames, from the starting character\nand including the seporation character." << endl;
- string firstpartoffilename;
- cin >> firstpartoffilename;
- cout << "Please type the last frame's number (Don't add one to it)." << endl;
- int lastusernumber;
- cin >> lastusernumber;
- lastusernumber++;
- cout << "Please type the amount of frames to append." << endl;
- int appendthismany;
- cin >> appendthismany;
- cout << "Please type the extension, including the dot." << endl;
- string extension;
- cin >> extension;
- int spaceavailable;
- cout << "Please type the amount of space for frame numbers." << endl;
- cin >> spaceavailable;
- int spacehold;
- string dome;
- string domf;
- for(int i = 1; i < (appendthismany+1); i++, lastusernumber++) {
- char arrayone[10];
- char arraytwo[10];
- itoa(i, arrayone, 10);
- itoa(lastusernumber, arraytwo, 10);
- dome = firstpartoffilename;
- if(i < 10) {
- spacehold = (spaceavailable - 1);
- }
- else if(i < 100) {
- spacehold = (spaceavailable - 2);
- }
- else if(i < 1000) {
- spacehold = (spaceavailable - 3);
- }
- else if(i < 10000) {
- spacehold = (spaceavailable - 4);
- }
- else if(i < 100000) {
- spacehold = (spaceavailable - 5);
- }
- else if(i < 1000000) {
- spacehold = (spaceavailable - 6);
- }
- else if(i < 10000000) {
- spacehold = (spaceavailable - 7);
- }
- else if(i < 100000000) {
- spacehold = (spaceavailable - 8);
- }
- else if(i < 1000000000) {
- spacehold = (spaceavailable - 9);
- }
- else {
- cout << "An amount of frames this large may exceed this program's limitations. Sorry." << endl;
- return 0;
- }
- for(;spacehold > 0; spacehold--) {
- dome += "0";
- }
- dome += arrayone;
- dome += extension;
- domf = firstpartoffilename;
- if(lastusernumber < 10) {
- spacehold = (spaceavailable - 1);
- }
- else if(lastusernumber < 100) {
- spacehold = (spaceavailable - 2);
- }
- else if(lastusernumber < 1000) {
- spacehold = (spaceavailable - 3);
- }
- else if(lastusernumber < 10000) {
- spacehold = (spaceavailable - 4);
- }
- else if(lastusernumber < 100000) {
- spacehold = (spaceavailable - 5);
- }
- else if(lastusernumber < 1000000) {
- spacehold = (spaceavailable - 6);
- }
- else if(lastusernumber < 10000000) {
- spacehold = (spaceavailable - 7);
- }
- else if(lastusernumber < 100000000) {
- spacehold = (spaceavailable - 8);
- }
- else if(lastusernumber < 1000000000) {
- spacehold = (spaceavailable - 9);
- }
- else {
- cout << "An amount of frames this large may exceed this program's limitations. Sorry." << endl;
- return 0;
- }
- for(;spacehold > 0; spacehold--) {
- domf += "0";
- }
- domf += arraytwo;
- domf += extension;
- rename(dome.c_str(), domf.c_str());
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment