A driver has been charged after a lorry mounted the pavement and crashed into a building in Edinburgh city centre.