Skip to content

This c++ program lets you control your pc with phone

Notifications You must be signed in to change notification settings

uyitroa/message2syncKouhai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

message2sync

A program which do everythin through imessage. It lets you control your pc with phone

Requirement

  • npm
  • brew

Setup

./setup

Creating new command

Folder: src/commands/

To create a new command:

  • a class that inherit from ACommand in src/abstracts/ACommand.h
  • .h and .cpp
  • requires a virtual method run virtual void run(std::string &input); and contructors ACommand has a parameter which is the prefix string

Bash.h:

#ifndef SRC_COMMANDS_BASH_H_
#define SRC_COMMANDS_BASH_H_

#include "../abstracts/ACommand.h"

// Bash is to run shell command
class Bash : public ACommand {
public:
	Bash();
	virtual ~Bash();

	virtual void run(std::string &my_string) override final; // the "main" method
};

#endif

Bash.cpp:

#include "Bash.h"

Bash::Bash()
	: ACommand("bash") { // <- the prefix string here is "bash"

}

Bash::~Bash() {
}

void Bash::run(std::string &my_string) {
	// remove "bash" from the string to execute shell command
	my_string = my_string.substr(5, my_string.size());

	system(my_string.c_str()); // run shell script
}

About

This c++ program lets you control your pc with phone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published