Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) TestServerPusher

 

TestServerPusher is a web application to test the WtServerPusher and WtServerPusherClient in the form of an edit widget, that can be viewed and edited by multiple visitors at the same time.

 

 

 

 

 

Downloads

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./ToolTestServerPusher/ToolTestServerPusherConsole.pro

 

include(../../ConsoleApplication.pri)

include(../../Libraries/Boost.pri)

include(../../Classes/CppAbout/CppAbout.pri)
include(../../Classes/CppFileIo/CppFileIo.pri)
include(../../Classes/CppHelp/CppHelp.pri)
include(../../Classes/CppMenuDialog/CppMenuDialog.pri)
include(../../Classes/CppRichelBilderbeekProgram/CppRichelBilderbeekProgram.pri)
include(../../Classes/CppTrace/CppTrace.pri)

include(../../Classes/CppCanvas/CppCanvas.pri)
include(../../Classes/CppImageCanvas/CppImageCanvas.pri)
#include(../../Classes/CppDotMatrix/CppDotMatrix.pri)
include(../../Classes/CppXml/CppXml.pri)
include(ToolAsciiArterConsole.pri )

SOURCES += main.cpp

 

 

 

 

 

Qt project file: ./ToolTestServerPusher/ToolTestServerPusherDesktop.pro

 

include(../../DesktopApplication.pri)
include(../../Libraries/Boost.pri)
include(../../Libraries/GeneralConsole.pri)
include(../../Libraries/GeneralDesktop.pri)

#Specific, console
include(../../Classes/CppCanvas/CppCanvas.pri)
include(../../Classes/CppDotMatrix/CppDotMatrix.pri)
include(../../Classes/CppImageCanvas/CppImageCanvas.pri)
#
include(ToolAsciiArterDesktop.pri)

SOURCES += qtmain.cpp

 

 

 

 

 

Qt project file: ./ToolTestServerPusher/ToolTestServerPusherWebsite.pro

 

include(../../Libraries/BoostAll.pri)
include(../../Libraries/Wt.pri)
include(../../WebApplication.pri)

include(../../Libraries/GeneralConsole.pri)
include(../../Libraries/GeneralWeb.pri)

include(../../Classes/CppWtServerPusher/CppWtServerPusher.pri)

include(ToolTestServerPusherWebsite.pri)

SOURCES += wtmain.cpp

 

 

 

 

 

./ToolTestServerPusher/ToolTestServerPusherConsole.pri

 

INCLUDEPATH += \
    ../../Tools/ToolTestServerPusher

SOURCES += \
    ../../Tools/ToolTestServerPusher/testserverpusherdata.cpp \
    ../../Tools/ToolTestServerPusher/testserverpushermenudialog.cpp \

HEADERS += \
    ../../Tools/ToolTestServerPusher/testserverpusherdata.h \
    ../../Tools/ToolTestServerPusher/testserverpushermenudialog.h \

OTHER_FILES += \
    ../../Tools/ToolTestServerPusher/Licence.txt

 

 

 

 

 

./ToolTestServerPusher/ToolTestServerPusherDesktop.pri

 

include(../../Tools/ToolAsciiArter/ToolAsciiArterConsole.pri)

FORMS += \
    ../../Tools/ToolAsciiArter/qtasciiartermenudialog.ui \
    ../../Tools/ToolAsciiArter/qtasciiartermaindialog.ui


SOURCES += \
    ../../Tools/ToolAsciiArter/qtasciiartermenudialog.cpp \
    ../../Tools/ToolAsciiArter/qtasciiartermaindialog.cpp

HEADERS += \
    ../../Tools/ToolAsciiArter/qtasciiartermenudialog.h \
    ../../Tools/ToolAsciiArter/qtasciiartermaindialog.h

 

 

 

 

 

./ToolTestServerPusher/ToolTestServerPusherWebsite.pri

 

include(../../Tools/ToolTestServerPusher/ToolTestServerPusherConsole.pri)

SOURCES += \
    ../../Tools/ToolTestServerPusher/wttestserverpushermaindialog.cpp \
    ../../Tools/ToolTestServerPusher/wttestserverpushermenudialog.cpp \


HEADERS += \
    ../../Tools/ToolTestServerPusher/wttestserverpushermaindialog.h \
    ../../Tools/ToolTestServerPusher/wttestserverpushermenudialog.h

 

 

 

 

 

./ToolTestServerPusher/testserverpusherdata.h

 

//---------------------------------------------------------------------------
/*
TestServerPusher, tool to test WtServerPusher
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestServerPusher.htm
//---------------------------------------------------------------------------
#ifndef TOOLTESTSERVERPUSHERDATA_H
#define TOOLTESTSERVERPUSHERDATA_H

#include <regex>

#include <boost/checked_delete.hpp>

namespace ribi {
namespace ToolTestServerPusher {

///Data is a Singleton
struct Data
{
  ///Set the data
  void SetData(const std::string& s);

  ///Get the Data single instance
  static Data * GetInstance();

  ///Get the data
  std::string GetData() const;

  private:
  ///Data constructor
  Data();

  ///Data destructor
  ~Data();

  ///Only let a smart pointer (that is, m_instance) delete Data
  friend void boost::checked_delete<>(Data*);

  static Data * m_instance;

  static std::mutex m_mutex;

  ///The data
  std::string m_s;
};

} //~namespace ToolTestServerPusher
} //~namespace ribi

#endif // TOOLTESTSERVERPUSHERDATA_H

 

 

 

 

 

./ToolTestServerPusher/testserverpusherdata.cpp

 

//---------------------------------------------------------------------------
/*
TestServerPusher, tool to test WtServerPusher
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestServerPusher.htm
//---------------------------------------------------------------------------
#include "testserverpusherdata.h"



ribi::ToolTestServerPusher::Data * ribi::ToolTestServerPusher::Data::m_instance = 0;

std::mutex ribi::ToolTestServerPusher::Data::m_mutex;

ribi::ToolTestServerPusher::Data::Data()
  : m_s("TestServerPusher")
{

}

ribi::ToolTestServerPusher::Data::~Data()
{

}

void ribi::ToolTestServerPusher::Data::SetData(const std::string& s)
{
  if (s != m_s)
  {
    //Double-lock idiom
    std::lock_guard<std::mutex> lock(m_mutex);
    if (s != m_s)
    {
      m_s = s;
    }
  }
}

ribi::ToolTestServerPusher::Data * ribi::ToolTestServerPusher::Data::GetInstance()
{
  if (!m_instance)
  {
    //Double-lock idiom
    std::lock_guard<std::mutex> lock(m_mutex);
    if (!m_instance)
    {
      m_instance = new Data;
    }
  }
  return m_instance;
}

std::string ribi::ToolTestServerPusher::Data::GetData() const
{
  std::lock_guard<std::mutex> lock(m_mutex);
  return m_s;
}

 

 

 

 

 

./ToolTestServerPusher/testserverpushermenudialog.h

 

//---------------------------------------------------------------------------
/*
TestServerPusher, tool to test WtServerPusher
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestServerPusher.htm
//---------------------------------------------------------------------------
#ifndef TESTSERVERPUSHERMENUDIALOG_H
#define TESTSERVERPUSHERMENUDIALOG_H

#include <string>
#include <vector>

#include "about.h"

namespace ribi {
namespace ToolTestServerPusher {

///The GUI independent part of the menu
struct MenuDialog
{
  ///Get this class its version
  static std::string GetVersion();

  ///Get this class its version history
  static std::vector<std::string> GetVersionHistory();

  ///Get this class its About
  static const About GetAbout();
};

} //~namespace ToolTestServerPusher
} //~namespace ribi

#endif // TESTSERVERPUSHERMENUDIALOG_H

 

 

 

 

 

./ToolTestServerPusher/testserverpushermenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestServerPusher, tool to test WtServerPusher
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestServerPusher.htm
//---------------------------------------------------------------------------
#include "about.h"
#include "testserverpushermenudialog.h"



const ribi::About ribi::ToolTestServerPusher::MenuDialog::GetAbout()
{
  About a(
    "Richel Bilderbeek",
    "TestServerPusher",
    "tool to test WtServerPusher",
    "the 5th of August 2011",
    "2011-2015",
    "http://www.richelbilderbeek.nl/ToolTestServerPusher.htm",
    GetVersion(),
    GetVersionHistory());
  return a;
}

std::string ribi::ToolTestServerPusher::MenuDialog::GetVersion()
{
  return "1.0";
}

std::vector<std::string> ribi::ToolTestServerPusher::MenuDialog::GetVersionHistory()
{
  return {
    "2011-08-05: Version 1.0: initial version, derived from TestWtBroadcastServer"
  };
}

 

 

 

 

 

./ToolTestServerPusher/wtmain.cpp

 

//---------------------------------------------------------------------------
/*
TestServerPusher, tool to test WtServerPusher
Copyright (C) 2011-2014 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestServerPusher.htm
//---------------------------------------------------------------------------
#include <iostream>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <boost/program_options.hpp>

#include <Wt/WApplication>
#include <Wt/WEnvironment>
#include <Wt/WText>

#include "wtautoconfig.h"
#include "wtserverpusher.h"
#include "wttestserverpushermenudialog.h"
#pragma GCC diagnostic pop

struct WtApplication : public Wt::WApplication
{
  WtApplication(const Wt::WEnvironment& env)
  : WApplication(env)
  {
    setTitle("TestServerPusher");
    this->useStyleSheet("wt.css");
    root()->addWidget(new ribi::ToolTestServerPusher::WtMenuDialog);
  }
};

Wt::WApplication *createApplication(const Wt::WEnvironment& env)
{
  return new WtApplication(env);
}

int main(int argc, char **argv)
{
  ribi::WtAutoConfig::SaveDefaultStylesheet();
  ribi::WtAutoConfig a(argc,argv,createApplication);
  return a.Run();
}

 

 

 

 

 

./ToolTestServerPusher/wttestserverpushermaindialog.h

 

//---------------------------------------------------------------------------
/*
TestServerPusher, tool to test WtServerPusher
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestServerPusher.htm
//---------------------------------------------------------------------------
#ifndef WTTESTSERVERPUSHERMAINDIALOG_H
#define WTTESTSERVERPUSHERMAINDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <Wt/WContainerWidget>

#include "wtserverpusherclient.h"
#pragma GCC diagnostic pop

namespace Wt
{
  struct WLineEdit;
}

namespace ribi {
namespace ToolTestServerPusher {

///TestServerPusher its main dialog
struct WtMainDialog : public Wt::WContainerWidget, WtServerPusherClient
{
  WtMainDialog();

  private:
  ///The user interface
  struct Ui
  {
    Ui() : m_edit(0) {}
    Wt::WLineEdit * m_edit;
  } ui;

  ///The user changes the text in the Wt::WLineEdit
  void OnEditChanged();

  ///The server updates the page
  void OnServerPush();
};

} //~namespace ToolTestServerPusher
} //~namespace ribi


#endif // WTTESTSERVERPUSHERMAINDIALOG_H

 

 

 

 

 

./ToolTestServerPusher/wttestserverpushermaindialog.cpp

 

//---------------------------------------------------------------------------
/*
TestServerPusher, tool to test WtServerPusher
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestServerPusher.htm
//---------------------------------------------------------------------------
#include "wttestserverpushermaindialog.h"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <boost/lexical_cast.hpp>
#include <boost/numeric/conversion/cast.hpp>

#include <Wt/WContainerWidget>
#include <Wt/WLineEdit>

#include "testserverpusherdata.h"
#include "testserverpushermenudialog.h"
#include "wtserverpusher.h"
#include "wtaboutdialog.h"
#pragma GCC diagnostic pop

ribi::ToolTestServerPusher::WtMainDialog::WtMainDialog()
  : ui{}
{
  this->clear();
  this->setContentAlignment(Wt::AlignCenter);
  ui.m_edit = new Wt::WLineEdit(this);
  ui.m_edit->keyWentUp().connect(this,&ribi::ToolTestServerPusher::WtMainDialog::OnEditChanged);
  ui.m_edit->setMinimumSize(400,Wt::WLength::Auto);
  OnServerPush();
}

void ribi::ToolTestServerPusher::WtMainDialog::OnEditChanged()
{
  const std::string s = ui.m_edit->text().toUTF8();
  const std::string t = ToolTestServerPusher::Data::GetInstance()->GetData();
  if (s!=t)
  {
    ToolTestServerPusher::Data::GetInstance()->SetData(s);
    WtServerPusher::GetInstance()->Post();
  }
}

void ribi::ToolTestServerPusher::WtMainDialog::OnServerPush()
{
  ui.m_edit->setText(ToolTestServerPusher::Data::GetInstance()->GetData());
}

 

 

 

 

 

./ToolTestServerPusher/wttestserverpushermenudialog.h

 

//---------------------------------------------------------------------------
/*
TestServerPusher, tool to test WtServerPusher
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestServerPusher.htm
//---------------------------------------------------------------------------
#ifndef WTTESTSERVERPUSHERMENUDIALOG_H
#define WTTESTSERVERPUSHERMENUDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <Wt/WContainerWidget>
#pragma GCC diagnostic pop

namespace ribi {
namespace ToolTestServerPusher {

struct WtMenuDialog : public Wt::WContainerWidget
{
  WtMenuDialog();
  private:
  void CheckResources();
  Wt::WWidget * CreateNewAboutDialog();
  Wt::WWidget * CreateNewMainDialog() const;
  Wt::WWidget * CreateNewWelcomeDialog() const;
};

} //~namespace ToolTestServerPusher
} //~namespace ribi

#endif // WTTESTSERVERPUSHERMENUDIALOG_H

 

 

 

 

 

./ToolTestServerPusher/wttestserverpushermenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestServerPusher, tool to test WtServerPusher
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestServerPusher.htm
//---------------------------------------------------------------------------
#include "wttestserverpushermenudialog.h"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <Wt/WBreak>
#include <Wt/WContainerWidget>
#include <Wt/WLabel>
#include <Wt/WStackedWidget>
#include <Wt/WMenu>
#include <Wt/WMenuItem>

#include "testserverpushermenudialog.h"
#include "wtaboutdialog.h"
#include "wtautoconfig.h"
#include "wttestserverpushermaindialog.h"
#include "wtserverpusher.h"
#include "wtserverpusherclient.h"
#pragma GCC diagnostic pop

ribi::ToolTestServerPusher::WtMenuDialog::WtMenuDialog()
{
this->setContentAlignment(Wt::AlignCenter);
  {
    Wt::WLabel * const title = new Wt::WLabel("TestServerPusher");
    title->setStyleClass("title");
    this->addWidget(title);
  }
  //Menu
  {
    Wt::WStackedWidget * const contents = new Wt::WStackedWidget;
    Wt::WMenu * const menu = new Wt::WMenu(contents,Wt::Horizontal);
    //Using CSS styleclass is the best (only?) way to display the menu well
    menu->setStyleClass("menu");
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "Welcome",
        CreateNewWelcomeDialog());
      menu->addItem(item);
    }
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "Start",
        CreateNewMainDialog());
      menu->addItem(item);
    }
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "About",
        CreateNewAboutDialog());
      menu->addItem(item);
    }
    //Display menu on top
    this->addWidget(menu);
    this->addWidget(new Wt::WBreak);
    //Display contents below menu
    this->addWidget(contents);
  }
}

Wt::WWidget * ribi::ToolTestServerPusher::WtMenuDialog::CreateNewAboutDialog()
{
  About a = MenuDialog::GetAbout();
  a.AddLibrary("WtAutoConfig version: " + WtAutoConfig::GetVersion());
  a.AddLibrary("WtServerPusher version: " + WtServerPusher::GetVersion());
  a.AddLibrary("WtServerPusherClient version: " + WtServerPusherClient::GetVersion());
  WtAboutDialog * const d = new WtAboutDialog(a,false);
  assert(d);
  return d;
}

Wt::WWidget * ribi::ToolTestServerPusher::WtMenuDialog::CreateNewMainDialog() const
{
  WtMainDialog * const d = new WtMainDialog;
  assert(d);
  return d;
}

Wt::WWidget * ribi::ToolTestServerPusher::WtMenuDialog::CreateNewWelcomeDialog() const
{
  Wt::WContainerWidget * dialog = new Wt::WContainerWidget;
  dialog->setContentAlignment(Wt::AlignCenter);
  dialog->addWidget(new Wt::WBreak);
  new Wt::WLabel("Welcome to TestServerPusher",dialog);
  new Wt::WBreak(dialog);
  new Wt::WBreak(dialog);
  new Wt::WLabel("TestServerPusher demonstrates how to view the same changing info",dialog);
  new Wt::WBreak(dialog);
  new Wt::WLabel("from different browsers and/or computers",dialog);
  new Wt::WBreak(dialog);
  new Wt::WLabel("using the WtServerPusher and WtServerPusherClient classes",dialog);
  return dialog;
}

 

 

 

 

 

./ToolTestServerPusher/helgrind.sh

 

#!/bin/sh
valgrind --tool=helgrind --log-file=helgrind.txt ../ToolTestServerPusher-build-desktop/./ToolTestServerPusher

 

 

 

 

 

./ToolTestServerPusher/zip.sh

 

#!/bin/sh
#zip packs all the files to port into a single .zip file,
#minicking the same folder structure
#Folder structure
# *
#   * Classes
#     * CppAbout
#     * CppWtAboutDialog
#     * CppWtAutoConfig
#     * CppWtServerPusher
#   * Tools
#    * ToolTestServerPusher

echo "Removing old user information"
rm copy.txt
rm tmp.txt
rm ToolTestServerPusher.pro.user

echo "Mimicking file structure"
mkdir temp_zip
mkdir temp_zip/Classes
mkdir temp_zip/Classes/CppAbout
mkdir temp_zip/Classes/CppWtAboutDialog
mkdir temp_zip/Classes/CppWtAutoConfig
mkdir temp_zip/Classes/CppWtServerPusher

mkdir temp_zip/Tools
mkdir temp_zip/Tools/ToolTestServerPusher

echo "Copying files"
cp ../../Classes/CppAbout/*.* temp_zip/Classes/CppAbout
cp ../../Classes/CppWtAboutDialog/*.* temp_zip/Classes/CppWtAboutDialog
cp ../../Classes/CppWtAutoConfig/*.* temp_zip/Classes/CppWtAutoConfig
cp ../../Classes/CppWtServerPusher/*.* temp_zip/Classes/CppWtServerPusher

cp ../../Tools/ToolTestServerPusher/*.* temp_zip/Tools/ToolTestServerPusher



FILENAME=ToolTestServerPusherSource_1_0
ZIP_FILENAME=$FILENAME".zip"

echo "Remove previous zip"
rm $ZIP_FILENAME

#echo "Compressing files"
cd temp_zip
zip -r $FILENAME Classes
#zip -r $FILENAME Games
#zip -r $FILENAME Libraries
#zip -r $FILENAME Projects
zip -r $FILENAME Tools
cd ..
cp "temp_zip/"$ZIP_FILENAME $ZIP_FILENAME

echo "Cleaning up"

#Classes
rm temp_zip/Classes/CppAbout/*.*
rm temp_zip/Classes/CppWtAboutDialog/*.*
rm temp_zip/Classes/CppWtAutoConfig/*.*
rm temp_zip/Classes/CppWtServerPusher/*.*
rmdir temp_zip/Classes/CppAbout
rmdir temp_zip/Classes/CppWtAboutDialog
rmdir temp_zip/Classes/CppWtAutoConfig
rmdir temp_zip/Classes/CppWtServerPusher
rmdir temp_zip/Classes

#Tools
rm temp_zip/Tools/ToolTestServerPusher/*.*
rmdir temp_zip/Tools/ToolTestServerPusher
rmdir temp_zip/Tools
rm temp_zip/*.*
rmdir temp_zip
echo "Done"

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml